How W3C WOFF 1.0 Unpacking Restores Installable Desktop SFNT Files
Rebuilding the 12-Byte SFNT Offset Table and 4-Byte Table Padding
A W3C Web Open Font Format 1.0 archive encapsulates standard desktop SFNT tables inside a 44-byte big-endian wrapper followed by 20-byte directory records. Each table inside the webfont payload is compressed independently using RFC 1950 zlib deflate only when compression shrinks the raw byte length; compact tables such as head, maxp, or OS/2 frequently remain uncompressed inside the container.
Recovering an operating-system installable desktop file requires far more than stripping header bytes. The decoder validates the declared file length, inflates compressed streams, orders 16-byte SFNT Table Records lexicographically by four-character ASCII tag, computes binary search parameters (searchRange, entrySelector, and rangeShift), zero-pads every table payload to a four-byte boundary, and updates head.checkSumAdjustment so desktop font managers accept the binary cleanly.
- Preserves quadratic TrueType glyf contours (0x00010000) alongside composite glyph references such as U+0100.
- Automatically switches output extension to .otf whenever the WOFF header declares OTTO PostScript CFF outlines.
- Retains OpenType GSUB ligatures, GPOS kerning tables, variable fvar axes, and embedded licensing strings.
- Executes inside a network-locked browser Worker so proprietary typography files never leave local memory.