aspose.info
EN

CFF - Compact Font File Format

Updated

What is a CFF file?

A file with .cff extension is a Compact Font Format and is also known as a PostScript Type 1, or CIDFont. CFF acts as a container to store multiple fonts together in a single unit known as a FontSet. The design of CFF fonts allow embedding PostScript language code that permits additional flexibility and extensibility of the format for usage with printer environments. CFF font files can be opened and converted using APIs such as Aspose.Font.

CFF File Format

CFF files are binary files that contain a structured data layout, has defined data types, a header, glyph organization and table dictionaries. More details about these can be found in the compact font format specifications.

Data Layout

The data layout of CFF file format is as shown below.

EntryComments
Header–
NameINDEX–
Top DICT INDEX–
String INDEX–
Global Subr INDEX–
Encodings–Charsets–
FDSelectCIDFonts only
CharStrings INDEXper-font
Font DICT INDEXper-font, CIDFonts only
Private DICTper-font
Local Subr INDEXper-font or per-Private DICT for CIDFonts
Copyright and Trademark Notices–

Data Types

CFF data types are as shown in the following table.

NameRangeDescription
Card80 –2551-byte unsigned number
Card160 – 655352-byte unsigned number
Offsetvaries1, 2, 3, or 4 byte offset (specified by OffSize field)
OffSize1–41-byte unsigned number specifies the size of an Offset field or fields
SID0 – 649992-byte string identifier

The binary data begins with a header having the format shown in the following table.

TypeNameDescription
Card8majorFormat major version (starting at 1)
Card8minorFormat minor version (starting at 0)
Card8hdrSizeHeader size (bytes)
OffSizeoffSizeAbsolute offset (0) size

References

See also