90 lines
7.9 KiB
HTML
90 lines
7.9 KiB
HTML
|
|
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<html><head><title>Python: module robofab.pens.JSONPen</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>.JSONPen</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/JSONPen.py">/code/projects/robofab/Lib/robofab/pens/JSONPen.py</a></font></td></tr></table>
|
|
<p><tt>Pen en wrapper for exporting glyphs to a description in JSON format.<br>
|
|
The JSON structure is similar to the .GLIF format.<br>
|
|
<br>
|
|
{<br>
|
|
"glyph":{<br>
|
|
"advance":{"width":268.0},<br>
|
|
"name":"period",<br>
|
|
"unicode":{"hex":"002E"},<br>
|
|
"source":"/Foundry/Critter UFO work/Source june 05_2/instances/NeueCritter_ExtraBlack.ufo/period",<br>
|
|
"outline":[<br>
|
|
{"contour":[<br>
|
|
{"point":{"x":249.9, "y":83.3, "type":"curve"}},<br>
|
|
{"point":{"x":249.9, "y":151.8}},<br>
|
|
{"point":{"x":200.1, "y":186.8}},<br>
|
|
{"point":{"x":134.0, "y":186.8, "type":"curve"}},<br>
|
|
{"point":{"x":65.3, "y":186.8}},<br>
|
|
{"point":{"x":15.5, "y":148.2}},<br>
|
|
{"point":{"x":15.5, "y":83.3, "type":"curve"}},<br>
|
|
{"point":{"x":15.5, "y":12.5}},<br>
|
|
{"point":{"x":65.3, "y":-15.0}},<br>
|
|
{"point":{"x":134.0, "y":-15.0, "type":"curve"}},<br>
|
|
{"point":{"x":200.1, "y":-15.0}},<br>
|
|
{"point":{"x":249.9, "y":16.1}}<br>
|
|
]}<br>
|
|
]<br>
|
|
}<br>
|
|
}<br>
|
|
<br>
|
|
<br>
|
|
More on JSON<br>
|
|
<a href="http://en.wikipedia.org/wiki/JSON">http://en.wikipedia.org/wiki/JSON</a></tt></p>
|
|
<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="robofab.pens.pointPen.html#AbstractPointPen">robofab.pens.pointPen.AbstractPointPen</a>
|
|
</font></dt><dd>
|
|
<dl>
|
|
<dt><font face="helvetica, arial"><a href="robofab.pens.JSONPen.html#FabToJSONPen">FabToJSONPen</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="FabToJSONPen">class <strong>FabToJSONPen</strong></a>(<a href="robofab.pens.pointPen.html#AbstractPointPen">robofab.pens.pointPen.AbstractPointPen</a>)</font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>Pen object to write glyph outline data to a string in JSON format.<br>
|
|
This is not a complete glyph description.<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%">Methods defined here:<br>
|
|
<dl><dt><a name="FabToJSONPen-__init__"><strong>__init__</strong></a>(self, glyphSet, indents<font color="#909090">=2</font>)</dt></dl>
|
|
|
|
<dl><dt><a name="FabToJSONPen-addComponent"><strong>addComponent</strong></a>(self, glyphName, transformation)</dt></dl>
|
|
|
|
<dl><dt><a name="FabToJSONPen-addPoint"><strong>addPoint</strong></a>(self, pt, segmentType<font color="#909090">=None</font>, smooth<font color="#909090">=False</font>, name<font color="#909090">=None</font>, **kwargs)</dt></dl>
|
|
|
|
<dl><dt><a name="FabToJSONPen-beginPath"><strong>beginPath</strong></a>(self)</dt></dl>
|
|
|
|
<dl><dt><a name="FabToJSONPen-endPath"><strong>endPath</strong></a>(self)</dt></dl>
|
|
|
|
<dl><dt><a name="FabToJSONPen-getData"><strong>getData</strong></a>(self)</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="-exportGlyphToJSON"><strong>exportGlyphToJSON</strong></a>(font, glyph, indent<font color="#909090">=1</font>)</dt><dd><tt>Return a string with a complete glyph description as JSON.</tt></dd></dl>
|
|
</td></tr></table>
|
|
</body></html> |