sfnt
ttLib/sfnt.py – low-level module to deal with the sfnt file format.
Defines two public classes:
SFNTReader
SFNTWriter
(Normally you don’t have to use these classes explicitly; they are used automatically by ttLib.TTFont.)
The reading and writing of sfnt files is separated in two distinct classes, since whenever the number of tables changes or whenever a table’s length changes you need to rewrite the whole file anyway.
- fontTools.ttLib.sfnt.compress(data, level=6)[source]
Compress ‘data’ to Zlib format. If ‘USE_ZOPFLI’ variable is True, zopfli is used instead of the zlib module. The compression ‘level’ must be between 0 and 9. 1 gives best speed, 9 gives best compression (0 gives no compression at all). The default value is a compromise between speed and compression (6).
- class fontTools.ttLib.sfnt.SFNTDirectoryEntry[source]
Bases:
DirectoryEntry
- format = '\n\t\t> # big endian\n\t\ttag: 4s\n\t\tcheckSum: L\n\t\toffset: L\n\t\tlength: L\n'
- formatSize = 16
- class fontTools.ttLib.sfnt.WOFFDirectoryEntry[source]
Bases:
DirectoryEntry
- format = '\n\t\t> # big endian\n\t\ttag: 4s\n\t\toffset: L\n\t\tlength: L # compressed length\n\t\torigLength: L # original length\n\t\tcheckSum: L # original checksum\n'
- formatSize = 20