Distinguishing Quadratic TrueType Contours from Cubic CFF Outlines
How Magic Signatures and Outline Tables Govern Desktop Compatibility
Filename extensions on downloaded font assets are notoriously unreliable. Assets fetched from CDNs or legacy CMS exports often arrive without extensions or carry a generic .ttf label even when compiled from PostScript sources. Inspecting the binary SFNT version word and outline table tags resolves the ambiguity deterministically.
TrueType fonts begin with 0x00010000 (or 0x74727565 on legacy Apple fonts) and store quadratic off-curve B-splines inside paired glyf and loca tables, optionally accompanied by fpgm, prep, and cvt bytecode hinting programs. OpenType PostScript fonts begin with 0x4F54544F (OTTO) and store cubic Bezier Type 2 charstrings inside a CFF or variable CFF2 table with no loca table present.
- Reads container magic bytes (wOF2, wOFF, 0x00010000, OTTO) prior to full parsing.
- Cross-checks flavor headers against actual presence of glyf+loca vs CFF/CFF2 tables.
- Recommends the standards-compliant desktop extension (.ttf or .otf) and MIME type.
- Surfaces UPM grid resolution (typically 1000 UPM for CFF and 1000 or 2048 UPM for TrueType).
- Prevents corrupt print spooler jobs caused by renaming PostScript charstring binaries with .ttf suffixes.
- Inspects head.indexToLocFormat short vs long offset indexing when TrueType glyf contours are present.