118 lines
7.5 KiB
HTML
118 lines
7.5 KiB
HTML
|
|
||
|
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||
|
<html><head><title>Python: module robofab.pens.filterPen</title>
|
||
|
</head><body bgcolor="#f0f0f8">
|
||
|
|
||
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
|
||
|
<tr bgcolor="#7799ee">
|
||
|
<td valign=bottom> <br>
|
||
|
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="robofab.html"><font color="#ffffff">robofab</font></a>.<a href="robofab.pens.html"><font color="#ffffff">pens</font></a>.filterPen</strong></big></big></font></td
|
||
|
><td align=right valign=bottom
|
||
|
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/code/projects/robofab/Lib/robofab/pens/filterPen.py">/code/projects/robofab/Lib/robofab/pens/filterPen.py</a></font></td></tr></table>
|
||
|
<p><tt>A couple of point pens to filter contours in various ways.</tt></p>
|
||
|
<p>
|
||
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||
|
<tr bgcolor="#aa55cc">
|
||
|
<td colspan=3 valign=bottom> <br>
|
||
|
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
|
||
|
|
||
|
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
|
||
|
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="math.html">math</a><br>
|
||
|
</td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
|
||
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||
|
<tr bgcolor="#ee77aa">
|
||
|
<td colspan=3 valign=bottom> <br>
|
||
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
|
||
|
|
||
|
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
|
||
|
<td width="100%"><dl>
|
||
|
<dt><font face="helvetica, arial"><a href="fontTools.pens.basePen.html#AbstractPen">fontTools.pens.basePen.AbstractPen</a>
|
||
|
</font></dt><dd>
|
||
|
<dl>
|
||
|
<dt><font face="helvetica, arial"><a href="robofab.pens.filterPen.html#ThresholdPen">ThresholdPen</a>
|
||
|
</font></dt></dl>
|
||
|
</dd>
|
||
|
<dt><font face="helvetica, arial"><a href="fontTools.pens.basePen.html#BasePen">fontTools.pens.basePen.BasePen</a>(<a href="fontTools.pens.basePen.html#AbstractPen">fontTools.pens.basePen.AbstractPen</a>)
|
||
|
</font></dt><dd>
|
||
|
<dl>
|
||
|
<dt><font face="helvetica, arial"><a href="robofab.pens.filterPen.html#FlattenPen">FlattenPen</a>
|
||
|
</font></dt></dl>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<p>
|
||
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||
|
<tr bgcolor="#ffc8d8">
|
||
|
<td colspan=3 valign=bottom> <br>
|
||
|
<font color="#000000" face="helvetica, arial"><a name="FlattenPen">class <strong>FlattenPen</strong></a>(<a href="fontTools.pens.basePen.html#BasePen">fontTools.pens.basePen.BasePen</a>)</font></td></tr>
|
||
|
|
||
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
||
|
<td colspan=2><tt>Process the contours into a series of straight lines by flattening the curves.<br> </tt></td></tr>
|
||
|
<tr><td> </td>
|
||
|
<td width="100%"><dl><dt>Method resolution order:</dt>
|
||
|
<dd><a href="robofab.pens.filterPen.html#FlattenPen">FlattenPen</a></dd>
|
||
|
<dd><a href="fontTools.pens.basePen.html#BasePen">fontTools.pens.basePen.BasePen</a></dd>
|
||
|
<dd><a href="fontTools.pens.basePen.html#AbstractPen">fontTools.pens.basePen.AbstractPen</a></dd>
|
||
|
</dl>
|
||
|
<hr>
|
||
|
Methods defined here:<br>
|
||
|
<dl><dt><a name="FlattenPen-__init__"><strong>__init__</strong></a>(self, otherPen, approximateSegmentLength<font color="#909090">=5</font>, segmentLines<font color="#909090">=False</font>, filterDoubles<font color="#909090">=True</font>)</dt></dl>
|
||
|
|
||
|
<dl><dt><a name="FlattenPen-addComponent"><strong>addComponent</strong></a>(self, glyphName, transformation)</dt></dl>
|
||
|
|
||
|
<hr>
|
||
|
Methods inherited from <a href="fontTools.pens.basePen.html#BasePen">fontTools.pens.basePen.BasePen</a>:<br>
|
||
|
<dl><dt><a name="FlattenPen-closePath"><strong>closePath</strong></a>(self)</dt></dl>
|
||
|
|
||
|
<dl><dt><a name="FlattenPen-curveTo"><strong>curveTo</strong></a>(self, *points)</dt></dl>
|
||
|
|
||
|
<dl><dt><a name="FlattenPen-endPath"><strong>endPath</strong></a>(self)</dt></dl>
|
||
|
|
||
|
<dl><dt><a name="FlattenPen-lineTo"><strong>lineTo</strong></a>(self, pt)</dt></dl>
|
||
|
|
||
|
<dl><dt><a name="FlattenPen-moveTo"><strong>moveTo</strong></a>(self, pt)</dt></dl>
|
||
|
|
||
|
<dl><dt><a name="FlattenPen-qCurveTo"><strong>qCurveTo</strong></a>(self, *points)</dt></dl>
|
||
|
|
||
|
</td></tr></table> <p>
|
||
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||
|
<tr bgcolor="#ffc8d8">
|
||
|
<td colspan=3 valign=bottom> <br>
|
||
|
<font color="#000000" face="helvetica, arial"><a name="ThresholdPen">class <strong>ThresholdPen</strong></a>(<a href="fontTools.pens.basePen.html#AbstractPen">fontTools.pens.basePen.AbstractPen</a>)</font></td></tr>
|
||
|
|
||
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
||
|
<td colspan=2><tt>Removes segments shorter in length than the threshold value.<br> </tt></td></tr>
|
||
|
<tr><td> </td>
|
||
|
<td width="100%">Methods defined here:<br>
|
||
|
<dl><dt><a name="ThresholdPen-__init__"><strong>__init__</strong></a>(self, otherPen, threshold<font color="#909090">=10</font>)</dt></dl>
|
||
|
|
||
|
<dl><dt><a name="ThresholdPen-addComponent"><strong>addComponent</strong></a>(self, glyphName, transformation)</dt></dl>
|
||
|
|
||
|
<dl><dt><a name="ThresholdPen-closePath"><strong>closePath</strong></a>(self)</dt></dl>
|
||
|
|
||
|
<dl><dt><a name="ThresholdPen-curveTo"><strong>curveTo</strong></a>(self, pt1, pt2, pt3)</dt></dl>
|
||
|
|
||
|
<dl><dt><a name="ThresholdPen-endPath"><strong>endPath</strong></a>(self)</dt></dl>
|
||
|
|
||
|
<dl><dt><a name="ThresholdPen-lineTo"><strong>lineTo</strong></a>(self, pt, smooth<font color="#909090">=False</font>)</dt></dl>
|
||
|
|
||
|
<dl><dt><a name="ThresholdPen-moveTo"><strong>moveTo</strong></a>(self, pt)</dt></dl>
|
||
|
|
||
|
<dl><dt><a name="ThresholdPen-qCurveTo"><strong>qCurveTo</strong></a>(self, *points)</dt></dl>
|
||
|
|
||
|
</td></tr></table></td></tr></table><p>
|
||
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||
|
<tr bgcolor="#eeaa77">
|
||
|
<td colspan=3 valign=bottom> <br>
|
||
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
|
||
|
|
||
|
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
|
||
|
<td width="100%"><dl><dt><a name="-distance"><strong>distance</strong></a>(pt1, pt2)</dt></dl>
|
||
|
<dl><dt><a name="-flattenGlyph"><strong>flattenGlyph</strong></a>(aGlyph, threshold<font color="#909090">=10</font>, segmentLines<font color="#909090">=True</font>)</dt><dd><tt>Replace curves with series of straight l ines.</tt></dd></dl>
|
||
|
<dl><dt><a name="-halftoneGlyph"><strong>halftoneGlyph</strong></a>(aGlyph, invert<font color="#909090">=False</font>)</dt><dd><tt>Convert the glyph into some sort of halftoning pattern.<br>
|
||
|
Measure a bunch of inside/outside points to simulate grayscale levels.<br>
|
||
|
Slow.</tt></dd></dl>
|
||
|
<dl><dt><a name="-spikeGlyph"><strong>spikeGlyph</strong></a>(aGlyph, segmentLength<font color="#909090">=20</font>, spikeLength<font color="#909090">=40</font>, patternFunc<font color="#909090">=None</font>)</dt><dd><tt>Add narly spikes or dents to the glyph.<br>
|
||
|
patternFunc is an optional function which recalculates the offset.</tt></dd></dl>
|
||
|
<dl><dt><a name="-thresholdGlyph"><strong>thresholdGlyph</strong></a>(aGlyph, threshold<font color="#909090">=10</font>)</dt></dl>
|
||
|
</td></tr></table>
|
||
|
</body></html>
|