Subpackages
Submodules
- macUtils - ttLib.macUtils.py -- Various Mac-specific stuff.
- sfnt - ttLib/sfnt.py -- low-level module to deal with the sfnt file format
Variables
- endian
endian = _test_endianness()
Classes
- GlyphOrder - A pseudo table
- TTFont - The main font object
- TTLibError
Function summary
- debugmsg(msg)
- getTableClass(tag)
- getTableModule(tag)
- identifierToTag(ident)
- newTable(tag)
- tagToIdentifier(tag)
- tagToXML(tag)
- xmlToTag(tag)
Functions
- debugmsg(msg)
- getTableClass(tag)
Fetch the packer/unpacker class for a table. Return None when no class is found.
- getTableModule(tag)
Fetch the packer/unpacker module for a table. Return None when no module is found.
- identifierToTag(ident)
the opposite of tagToIdentifier()
- newTable(tag)
Return a new instance of a table.
- tagToIdentifier(tag)
Convert a table tag to a valid (but UGLY) python identifier, as well as a filename that's guaranteed to be unique even on a caseless file system. Each character is mapped to two characters. Lowercase letters get an underscore before the letter, uppercase letters get an underscore after the letter. Trailing spaces are trimmed. Illegal characters are escaped as two hex bytes. If the result starts with a number (as the result of a hex escape), an extra underscore is prepended. Examples:
'glyf' -> '_g_l_y_f' 'cvt ' -> '_c_v_t' 'OS/2' -> 'O_S_2f_2'
- tagToXML(tag)
Similarly to tagToIdentifier(), this converts a TT tag to a valid XML element name. Since XML element names are case sensitive, this is a fairly simple/readable translation.
- xmlToTag(tag)
The opposite of tagToXML()
Imported Names
| Local name | Refers to |
|---|---|
| os | os |
| string | string |
| types | types |