143 lines
8.9 KiB
HTML
143 lines
8.9 KiB
HTML
|
|
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<html><head><title>Python: module robofab.tools.toolsSVG</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.tools.html"><font color="#ffffff">tools</font></a>.toolsSVG</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/tools/toolsSVG.py">/code/projects/robofab/Lib/robofab/tools/toolsSVG.py</a></font></td></tr></table>
|
|
<p><tt># -*- coding: utf-8 -*-</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="os.html">os</a><br>
|
|
</td><td width="25%" valign=top><a href="re.html">re</a><br>
|
|
</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#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.tools.toolsSVG.html#FabToSVGPen">FabToSVGPen</a>
|
|
</font></dt></dl>
|
|
</dd>
|
|
<dt><font face="helvetica, arial"><a href="robofab.tools.toolsSVG.html#SVGFontReader">SVGFontReader</a>
|
|
</font></dt><dt><font face="helvetica, arial"><a href="robofab.tools.toolsSVG.html#SVGPath">SVGPath</a>
|
|
</font></dt></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="FabToSVGPen">class <strong>FabToSVGPen</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>A pen to create and draw the glyph as<br>
|
|
a path object into a SVG document.<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%"><dl><dt>Method resolution order:</dt>
|
|
<dd><a href="robofab.tools.toolsSVG.html#FabToSVGPen">FabToSVGPen</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="FabToSVGPen-__init__"><strong>__init__</strong></a>(self, glyphSet)</dt></dl>
|
|
|
|
<dl><dt><a name="FabToSVGPen-write"><strong>write</strong></a>(self)</dt></dl>
|
|
|
|
<hr>
|
|
Methods inherited from <a href="fontTools.pens.basePen.html#BasePen">fontTools.pens.basePen.BasePen</a>:<br>
|
|
<dl><dt><a name="FabToSVGPen-addComponent"><strong>addComponent</strong></a>(self, glyphName, transformation)</dt><dd><tt>This default implementation simply transforms the points<br>
|
|
of the base glyph and draws it onto self.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="FabToSVGPen-closePath"><strong>closePath</strong></a>(self)</dt></dl>
|
|
|
|
<dl><dt><a name="FabToSVGPen-curveTo"><strong>curveTo</strong></a>(self, *points)</dt></dl>
|
|
|
|
<dl><dt><a name="FabToSVGPen-endPath"><strong>endPath</strong></a>(self)</dt></dl>
|
|
|
|
<dl><dt><a name="FabToSVGPen-lineTo"><strong>lineTo</strong></a>(self, pt)</dt></dl>
|
|
|
|
<dl><dt><a name="FabToSVGPen-moveTo"><strong>moveTo</strong></a>(self, pt)</dt></dl>
|
|
|
|
<dl><dt><a name="FabToSVGPen-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="SVGFontReader">class <strong>SVGFontReader</strong></a></font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>Return a Fab Font object with the data found in the SVG font.<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%">Methods defined here:<br>
|
|
<dl><dt><a name="SVGFontReader-__init__"><strong>__init__</strong></a>(self, path, font)</dt></dl>
|
|
|
|
<dl><dt><a name="SVGFontReader-read"><strong>read</strong></a>(self)</dt></dl>
|
|
|
|
<dl><dt><a name="SVGFontReader-readSVGTree"><strong>readSVGTree</strong></a>(self, tree)</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="SVGPath">class <strong>SVGPath</strong></a></font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>Path object for SVG vector paths. Return the data<br>
|
|
in compact format, ready for <path> or <glyph> tag.<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%">Methods defined here:<br>
|
|
<dl><dt><a name="SVGPath-__init__"><strong>__init__</strong></a>(self, fillColor<font color="#909090">=None</font>, strokeColor<font color="#909090">=None</font>, strokeWidth<font color="#909090">=None</font>)</dt></dl>
|
|
|
|
<dl><dt><a name="SVGPath-closePath"><strong>closePath</strong></a>(self)</dt></dl>
|
|
|
|
<dl><dt><a name="SVGPath-concatenate"><strong>concatenate</strong></a>(self, cmd, *pts)</dt></dl>
|
|
|
|
<dl><dt><a name="SVGPath-curveTo"><strong>curveTo</strong></a>(self, (x1, y1, x2, y2, x3, y3))</dt></dl>
|
|
|
|
<dl><dt><a name="SVGPath-lineTo"><strong>lineTo</strong></a>(self, (x, y))</dt></dl>
|
|
|
|
<dl><dt><a name="SVGPath-moveTo"><strong>moveTo</strong></a>(self, (x, y))</dt></dl>
|
|
|
|
<dl><dt><a name="SVGPath-qCurveTo"><strong>qCurveTo</strong></a>(self, (x1, y1, x2, y2))</dt></dl>
|
|
|
|
<dl><dt><a name="SVGPath-write"><strong>write</strong></a>(self)</dt><dd><tt> <path d="M200,300 L400,50 L600,300 <br>
|
|
L800,550 L1000,300"<br>
|
|
fill="none" stroke="#888888" stroke-width="2" /></tt></dd></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="-entitify"><strong>entitify</strong></a>(string)</dt><dd><tt>Convert a string with possible unicode values to a string with entities.</tt></dd></dl>
|
|
<dl><dt><a name="-makeSVGFont"><strong>makeSVGFont</strong></a>(fabFont, svgFontPath<font color="#909090">=None</font>, exportKerning<font color="#909090">=True</font>)</dt><dd><tt>Convert a fab font to a SVG font tag.<br>
|
|
<a href="http://www.w3.org/TR/SVG11/fonts.html">http://www.w3.org/TR/SVG11/fonts.html</a></tt></dd></dl>
|
|
<dl><dt><a name="-makeSVGGlyph"><strong>makeSVGGlyph</strong></a>(fabGlyph, glyphSet, glyphClass<font color="#909090">='glyph'</font>)</dt><dd><tt>Convert a single fab glyph to a SVG glyph tag.</tt></dd></dl>
|
|
</td></tr></table><p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#55aa55">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
|
|
<td width="100%"><strong>cmdSearch</strong> = <_sre.SRE_Pattern object at 0x1909200><br>
|
|
<strong>pathSearch</strong> = <_sre.SRE_Pattern object at 0x11746e0><br>
|
|
<strong>svgFontHeader</strong> = '<?xml version="1.0" standalone="no"?><font color="#c040c0">\n</font><!DOCTYPE ...tp://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >'</td></tr></table>
|
|
</body></html> |