fontTools.t1Lib (version 1.0b2)
index
/code/fontTools/Lib/fontTools/t1Lib.py

fontTools.t1Lib.py -- Tools for PostScript Type 1 fonts
 
Functions for reading and writing raw Type 1 data:
 
read(path)
        reads any Type 1 font file, returns the raw data and a type indicator: 
        'LWFN', 'PFB' or 'OTHER', depending on the format of the file pointed 
        to by 'path'. 
        Raises an error when the file does not contain valid Type 1 data.
 
write(path, data, kind='OTHER', dohex=0)
        writes raw Type 1 data to the file pointed to by 'path'. 
        'kind' can be one of 'LWFN', 'PFB' or 'OTHER'; it defaults to 'OTHER'.
        'dohex' is a flag which determines whether the eexec encrypted
        part should be written as hexadecimal or binary, but only if kind
        is 'LWFN' or 'PFB'.

 
Modules
       
MacOS
Carbon.Res
fontTools.misc.eexec
os
re
string

 
Classes
       
exceptions.Exception
T1Error
T1Font

 
class T1Error(exceptions.Exception)
     Methods inherited from exceptions.Exception:
__getitem__(...)
__init__(...)
__str__(...)

 
class T1Font
    Type 1 font class.
 
Uses a minimal interpeter that supports just about enough PS to parse
Type 1 fonts.
 
  Methods defined here:
__getitem__(self, key)
__init__(self, path=None)
getData(self)
getGlyphSet(self)
Return a generic GlyphSet, which is a dict-like object
mapping glyph names to glyph objects. The returned glyph objects
have a .draw() method that supports the Pen protocol, and will
have an attribute named 'width', but only *after* the .draw() method
has been called.
 
In the case of Type 1, the GlyphSet is simply the CharStrings dict.
parse(self)
saveAs(self, path, type)

 
Functions
       
assertType1(data)
deHexString(hexstring)
decryptType1(data)
findEncryptedChunks(data)
isHex(text)
longToString(long)
read(path, onlyHeader=0)
reads any Type 1 font file, returns raw data
readLWFN(path, onlyHeader=0)
reads an LWFN font file, returns raw data
readOther(path)
reads any (font) file, returns raw data
readPFB(path, onlyHeader=0)
reads a PFB font file, returns raw data
stringToLong(str)
write(path, data, kind='OTHER', dohex=0)
writeLWFN(path, data)
writeOther(path, data, dohex=0)
writePFB(path, data)

 
Data
        DEBUG = 0
EEXECBEGIN = 'currentfile eexec'
EEXECBEGINMARKER = '%-- eexec start\r'
EEXECEND = '0000000000000000000000000000000000000000000000000000000000000000'
EEXECENDMARKER = '%-- eexec end\r'
EEXECINTERNALEND = 'currentfile closefile'
HEXLINELENGTH = 80
LWFNCHUNKSIZE = 2000
__author__ = 'jvr'
__version__ = '1.0b2'
haveMacSupport = 1

 
Author
        jvr