Font formats compared: WOFF2, WOFF, TTF, OTF, CFF and PostScript Type 1
How desktop outline fonts (TrueType .ttf and OpenType .otf) differ from web font wrappers (.woff2 and .woff), how quadratic and cubic Bézier curves are stored, and how to test font pipelines.
1. Outline curves vs. packaging wrappers
When comparing font formats, separate the glyph outline mathematics from the outer file container:
- TrueType outlines (.ttf): Store glyph contours inside a
glyftable as 2nd-order (quadratic) Bézier splines with integer grid-fitting instructions (hinting bytecode). A raw TrueType file begins with the 4-bytesfntversion scalar00 01 00 00(or74 72 75 65, ASCIItrueon classic Apple fonts). - OpenType CFF outlines (.otf and .cff): Store glyph contours inside a
CFF(Compact Font Format) table as 3rd-order (cubic) PostScript Type 2 Bézier charstrings. An OpenType CFF file uses the exact samesfnttable directory structure as TTF, except its first 4 bytes are4F 54 54 4F(ASCIIOTTO). - Web Open Font Format 1.0 (.woff) and 2.0 (.woff2): Are not new outline formats—they wrap the exact same TrueType or OpenType tables for HTTP delivery. WOFF 1.0 (magic
wOFF,77 4F 46 46) compresses each table individually with zlib/DEFLATE. WOFF2 (magicwOF2,77 4F 46 32) applies a preprocessing transform to theglyfandlocatables to strip redundant coordinate headers and compresses the entire font stream together with Brotli.
| Format | Magic bytes | Curve math | Compression | Sample fixture |
|---|---|---|---|---|
| WOFF2 (.woff2) | 77 4F 46 32 ('wOF2') | Quadratic (glyf) or Cubic (CFF) | glyf transform + shared Brotli | sample-font-web.woff2 |
| WOFF 1.0 (.woff) | 77 4F 46 46 ('wOFF') | Quadratic (glyf) or Cubic (CFF) | Per-table zlib DEFLATE | sample.woff |
| TrueType (.ttf) | 00 01 00 00 | Quadratic Bézier (glyf + loca) | Uncompressed sfnt tables | sample-font-regular.ttf |
| OpenType (.otf) | 4F 54 54 4F ('OTTO') | Cubic Bézier (CFF table) | Uncompressed sfnt + CFF | sample.otf |
| CFF (.cff) | 01 00 04 | Cubic Type 2 charstrings | Compact binary dictionary | sample.cff |
| Type 1 PFB (.pfb) | 80 01 (+ '%!PS-AdobeFont') | Cubic Type 1 charstrings | Binary segment blocks | sample.pfb |
2. Why Adobe retired PostScript Type 1 (.pfb / .pfa) in 2023
Legacy PostScript Type 1 fonts (.pfb) split a single typeface across multiple files (one .pfb outline file plus a separate .afm or .pfm metrics file), supported at most 256 encoded glyphs without complex composite mappings, and lacked unified Unicode cmap tables. Adobe Creative Cloud, PDF/A-4 workflows, and modern operating systems have deprecated Type 1 fonts in favor of OpenType (.otf / .ttf). Keep sample.pfb in your QA test suite specifically to verify that document converters detect and flag deprecated Type 1 font dependencies cleanly.