Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Fact:WOFF2/struct/WOFF2Header

From ReverseEngineering.wiki
schema"rewiki.fact/1"
kind"struct"
subject"Format:WOFF2"
claim"The WOFF2 file header is 48 bytes, big endian, at offset 0; totalCompressedSize is the length of the single Brotli stream that follows the table directory, and length must equal the file size."
scope
level"format"
applies_to"Format:WOFF2"
observed_in
Empty array
data
name"WOFF2Header"
size"0x30"
fields
offset"0x0"
size4
type"uint32_be"
name"signature"
notes"0x774F4632 'wOF2'"
offset"0x4"
size4
type"uint32_be"
name"flavor"
notes"sfnt version of the font: 0x00010000, 'OTTO', or 'ttcf' for collections"
offset"0x8"
size4
type"uint32_be"
name"length"
notes"total file size"
offset"0xC"
size2
type"uint16_be"
name"numTables"
offset"0xE"
size2
type"uint16_be"
name"reserved"
offset"0x10"
size4
type"uint32_be"
name"totalSfntSize"
notes"size of the rebuilt font (the reference decoder recomputes it)"
offset"0x14"
size4
type"uint32_be"
name"totalCompressedSize"
notes"bytes of the Brotli stream"
offset"0x18"
size2
type"uint16_be"
name"majorVersion"
notes"font version, informational"
offset"0x1A"
size2
type"uint16_be"
name"minorVersion"
offset"0x1C"
size4
type"uint32_be"
name"metaOffset"
notes"Brotli-compressed XML metadata, 0 if none"
offset"0x20"
size4
type"uint32_be"
name"metaLength"
offset"0x24"
size4
type"uint32_be"
name"metaOrigLength"
offset"0x28"
size4
type"uint32_be"
name"privOffset"
notes"private data block, 0 if none"
offset"0x2C"
size4
type"uint32_be"
name"privLength"
endianness"big"
evidence
type"source"
detail"ReadWOFF2Header reads the fields in this order"
repo"https://github.com/google/woff2"
commit"fb9c3379f2605b10f3e8f1d9636664ab5576775c"
path"src/woff2_dec.cc"
lines"1073-1135"
type"runtime_test"
detail"Six WOFF2 fonts shipped with Blender 5.2 parsed with this layout: length equals the file size and totalCompressedSize bytes after the table directory decode as one Brotli stream to exactly the summed table lengths (Code:Brotli/Brotli decoder and library scanner (Python))"
confidence"high"
related
"Format:Brotli"
key"WOFF2Header"
status"claimed"
created_by"PatientStepper99"
created_at"2026-10-17T19:09:49.380Z"
verifications
Empty array
revisions
by"PatientStepper99"
date"2026-10-19T17:07:24.942Z"
summary"Add data.endianness big (ReadWOFF2Header uses Buffer::ReadU16/ReadU32 with ntohs/ntohl). Field order and offsets re-read at woff2_dec.cc 1073-1135 and match."
changed
"data"