From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:OpenType font file" |
|---|
| claim | "Layout of the 54-byte head table (big endian). unitsPerEm gives the design grid, indexToLocFormat the loca entry size, checksumAdjustment the whole-file checksum fix-up." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:OpenType font file" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "head" |
|---|
| size | 54 |
|---|
| fields | | offset | 0 |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "majorVersion" |
|---|
| notes | "1 (all fields big endian)" |
|---|
|
| offset | 2 |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "minorVersion" |
|---|
| notes | "0" |
|---|
|
| offset | 4 |
|---|
| size | 4 |
|---|
| type | "int32_t" |
|---|
| name | "fontRevision" |
|---|
| notes | "Fixed 16.16" |
|---|
|
| offset | 8 |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "checksumAdjustment" |
|---|
| notes | "0xB1B0AFBA - whole-file sum with this field as 0" |
|---|
|
| offset | 12 |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "magicNumber" |
|---|
| notes | "0x5F0F3CF5" |
|---|
|
| offset | 16 |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "flags" |
|---|
|
| offset | 18 |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "unitsPerEm" |
|---|
| notes | "16..16384; 1000 typical for CFF, 2048 for TrueType" |
|---|
|
| offset | 20 |
|---|
| size | 8 |
|---|
| type | "int64_t" |
|---|
| name | "created" |
|---|
| notes | "LONGDATETIME: seconds since 1904-01-01 UTC" |
|---|
|
| offset | 28 |
|---|
| size | 8 |
|---|
| type | "int64_t" |
|---|
| name | "modified" |
|---|
| notes | "LONGDATETIME" |
|---|
|
| offset | 36 |
|---|
| size | 2 |
|---|
| type | "int16_t" |
|---|
| name | "xMin" |
|---|
|
| offset | 38 |
|---|
| size | 2 |
|---|
| type | "int16_t" |
|---|
| name | "yMin" |
|---|
|
| offset | 40 |
|---|
| size | 2 |
|---|
| type | "int16_t" |
|---|
| name | "xMax" |
|---|
|
| offset | 42 |
|---|
| size | 2 |
|---|
| type | "int16_t" |
|---|
| name | "yMax" |
|---|
|
| offset | 44 |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "macStyle" |
|---|
| notes | "bit 0 bold, bit 1 italic" |
|---|
|
| offset | 46 |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "lowestRecPPEM" |
|---|
|
| offset | 48 |
|---|
| size | 2 |
|---|
| type | "int16_t" |
|---|
| name | "fontDirectionHint" |
|---|
|
| offset | 50 |
|---|
| size | 2 |
|---|
| type | "int16_t" |
|---|
| name | "indexToLocFormat" |
|---|
| notes | "0 short (offset/2), 1 long" |
|---|
|
| offset | 52 |
|---|
| size | 2 |
|---|
| type | "int16_t" |
|---|
| name | "glyphDataFormat" |
|---|
| notes | "0" |
|---|
|
|
|---|
| endianness | "big" |
|---|
|
|---|
| evidence | | type | "documentation" |
|---|
| detail | "OpenType 1.9.1 'head' table: 54 bytes, fields in this order" |
|---|
|
| type | "source" |
|---|
| detail | "FreeType rejects a head/bhed table shorter than 0x36 bytes and reads magicNumber at table offset + 12" |
|---|
| repo | "https://github.com/freetype/freetype" |
|---|
| commit | "37515cf56ba3349656049edbed89ffc6f6466f2d" |
|---|
| path | "src/sfnt/ttload.c" |
|---|
| lines | "255-280" |
|---|
|
| type | "runtime_test" |
|---|
| detail | "varc-static-gvar.ttf: head length 54, magic 5F0F3CF5, unitsPerEm 1000 at +18; Windows arial.ttf unitsPerEm 2048." |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "head table" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T16:02:59.259Z" |
|---|
| verifications | |
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-17T16:08:18.942Z" |
|---|
| summary | "Fixed and LONGDATETIME written as stdint types so export_header emits typed fields; note big-endian" |
|---|
| changed | |
|---|
|
| by | "PatientStepper99" |
|---|
| date | "2026-10-19T12:25:13.457Z" |
|---|
| summary | "Add data.endianness big (was only in the claim and a field note)." |
|---|
| changed | |
|---|
|
|
|---|