149 lines
9.9 KiB
HTML
149 lines
9.9 KiB
HTML
|
|
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<html><head><title>Python: module fontTools.t1Lib</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="fontTools.html"><font color="#ffffff">fontTools</font></a>.t1Lib</strong></big></big> (version 1.0b2)</font></td
|
|
><td align=right valign=bottom
|
|
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/code/fontTools/Lib/fontTools/t1Lib.py">/code/fontTools/Lib/fontTools/t1Lib.py</a></font></td></tr></table>
|
|
<p><tt>fontTools.t1Lib.py -- Tools for PostScript Type 1 fonts<br>
|
|
<br>
|
|
Functions for reading and writing raw Type 1 data:<br>
|
|
<br>
|
|
<a href="#-read">read</a>(path)<br>
|
|
reads any Type 1 font file, returns the raw data and a type indicator: <br>
|
|
'LWFN', 'PFB' or 'OTHER', depending on the format of the file pointed <br>
|
|
to by 'path'. <br>
|
|
Raises an error when the file does not contain valid Type 1 data.<br>
|
|
<br>
|
|
<a href="#-write">write</a>(path, data, kind='OTHER', dohex=0)<br>
|
|
writes raw Type 1 data to the file pointed to by 'path'. <br>
|
|
'kind' can be one of 'LWFN', 'PFB' or 'OTHER'; it defaults to 'OTHER'.<br>
|
|
'dohex' is a flag which determines whether the eexec encrypted<br>
|
|
part should be written as hexadecimal or binary, but only if kind<br>
|
|
is 'LWFN' or 'PFB'.</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="MacOS.html">MacOS</a><br>
|
|
<a href="Carbon.Res.html">Carbon.Res</a><br>
|
|
</td><td width="25%" valign=top><a href="fontTools.misc.eexec.html">fontTools.misc.eexec</a><br>
|
|
<a href="os.html">os</a><br>
|
|
</td><td width="25%" valign=top><a href="re.html">re</a><br>
|
|
<a href="string.html">string</a><br>
|
|
</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="exceptions.html#Exception">exceptions.Exception</a>
|
|
</font></dt><dd>
|
|
<dl>
|
|
<dt><font face="helvetica, arial"><a href="fontTools.t1Lib.html#T1Error">T1Error</a>
|
|
</font></dt></dl>
|
|
</dd>
|
|
<dt><font face="helvetica, arial"><a href="fontTools.t1Lib.html#T1Font">T1Font</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="T1Error">class <strong>T1Error</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)</font></td></tr>
|
|
|
|
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
|
|
<td width="100%">Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
|
|
<dl><dt><a name="T1Error-__getitem__"><strong>__getitem__</strong></a>(...)</dt></dl>
|
|
|
|
<dl><dt><a name="T1Error-__init__"><strong>__init__</strong></a>(...)</dt></dl>
|
|
|
|
<dl><dt><a name="T1Error-__str__"><strong>__str__</strong></a>(...)</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="T1Font">class <strong>T1Font</strong></a></font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>Type 1 font class.<br>
|
|
<br>
|
|
Uses a minimal interpeter that supports just about enough PS to parse<br>
|
|
Type 1 fonts.<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%">Methods defined here:<br>
|
|
<dl><dt><a name="T1Font-__getitem__"><strong>__getitem__</strong></a>(self, key)</dt></dl>
|
|
|
|
<dl><dt><a name="T1Font-__init__"><strong>__init__</strong></a>(self, path<font color="#909090">=None</font>)</dt></dl>
|
|
|
|
<dl><dt><a name="T1Font-getData"><strong>getData</strong></a>(self)</dt></dl>
|
|
|
|
<dl><dt><a name="T1Font-getGlyphSet"><strong>getGlyphSet</strong></a>(self)</dt><dd><tt>Return a generic GlyphSet, which is a dict-like object<br>
|
|
mapping glyph names to glyph objects. The returned glyph objects<br>
|
|
have a .draw() method that supports the Pen protocol, and will<br>
|
|
have an attribute named 'width', but only *after* the .draw() method<br>
|
|
has been called.<br>
|
|
<br>
|
|
In the case of Type 1, the GlyphSet is simply the CharStrings dict.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="T1Font-parse"><strong>parse</strong></a>(self)</dt></dl>
|
|
|
|
<dl><dt><a name="T1Font-saveAs"><strong>saveAs</strong></a>(self, path, type)</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="-assertType1"><strong>assertType1</strong></a>(data)</dt></dl>
|
|
<dl><dt><a name="-deHexString"><strong>deHexString</strong></a>(hexstring)</dt></dl>
|
|
<dl><dt><a name="-decryptType1"><strong>decryptType1</strong></a>(data)</dt></dl>
|
|
<dl><dt><a name="-findEncryptedChunks"><strong>findEncryptedChunks</strong></a>(data)</dt></dl>
|
|
<dl><dt><a name="-isHex"><strong>isHex</strong></a>(text)</dt></dl>
|
|
<dl><dt><a name="-longToString"><strong>longToString</strong></a>(long)</dt></dl>
|
|
<dl><dt><a name="-read"><strong>read</strong></a>(path, onlyHeader<font color="#909090">=0</font>)</dt><dd><tt>reads any Type 1 font file, returns raw data</tt></dd></dl>
|
|
<dl><dt><a name="-readLWFN"><strong>readLWFN</strong></a>(path, onlyHeader<font color="#909090">=0</font>)</dt><dd><tt>reads an LWFN font file, returns raw data</tt></dd></dl>
|
|
<dl><dt><a name="-readOther"><strong>readOther</strong></a>(path)</dt><dd><tt>reads any (font) file, returns raw data</tt></dd></dl>
|
|
<dl><dt><a name="-readPFB"><strong>readPFB</strong></a>(path, onlyHeader<font color="#909090">=0</font>)</dt><dd><tt>reads a PFB font file, returns raw data</tt></dd></dl>
|
|
<dl><dt><a name="-stringToLong"><strong>stringToLong</strong></a>(str)</dt></dl>
|
|
<dl><dt><a name="-write"><strong>write</strong></a>(path, data, kind<font color="#909090">='OTHER'</font>, dohex<font color="#909090">=0</font>)</dt></dl>
|
|
<dl><dt><a name="-writeLWFN"><strong>writeLWFN</strong></a>(path, data)</dt></dl>
|
|
<dl><dt><a name="-writeOther"><strong>writeOther</strong></a>(path, data, dohex<font color="#909090">=0</font>)</dt></dl>
|
|
<dl><dt><a name="-writePFB"><strong>writePFB</strong></a>(path, data)</dt></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>DEBUG</strong> = 0<br>
|
|
<strong>EEXECBEGIN</strong> = 'currentfile eexec'<br>
|
|
<strong>EEXECBEGINMARKER</strong> = '%-- eexec start<font color="#c040c0">\r</font>'<br>
|
|
<strong>EEXECEND</strong> = '0000000000000000000000000000000000000000000000000000000000000000'<br>
|
|
<strong>EEXECENDMARKER</strong> = '%-- eexec end<font color="#c040c0">\r</font>'<br>
|
|
<strong>EEXECINTERNALEND</strong> = 'currentfile closefile'<br>
|
|
<strong>HEXLINELENGTH</strong> = 80<br>
|
|
<strong>LWFNCHUNKSIZE</strong> = 2000<br>
|
|
<strong>__author__</strong> = 'jvr'<br>
|
|
<strong>__version__</strong> = '1.0b2'<br>
|
|
<strong>haveMacSupport</strong> = 1</td></tr></table><p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#7799ee">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td>
|
|
<td width="100%">jvr</td></tr></table>
|
|
</body></html> |