Expand description
CFF (Compact Font Format) binary parser.
Parses CFF binary data (Adobe TN#5176) into structured CffFont objects.
CFF is a compact binary encoding for Type 1-style fonts using Type 2 charstrings.
CFF data appears in PostScript via the FontSet resource mechanism: FontSetInit /ProcSet findresource begin … StartData
This parser handles:
- CFF Header, Name INDEX, Top DICT, String INDEX, Global Subr INDEX
- CharStrings INDEX, charset, encoding, Private DICT, Local Subr INDEX
- Both name-keyed and CID-keyed fonts
- Predefined charsets (ISOAdobe, Expert, ExpertSubset) and encodings
Structs§
Constants§
- EXPERT_
ENCODING_ MAP - Expert Encoding — (code, SID) pairs for non-zero entries.
Functions§
- get_
sid_ string - Resolve a String ID (SID) to its string. SID 0–390 are predefined standard strings. SID >= 391 indexes into the String INDEX (offset by 391).
- parse_
cff - Parse CFF binary data into a list of
CffFontobjects.