From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:OpenType font file" |
|---|
| claim | "The sfnt table directory at the start of a font (or at each offset of a collection header): 12 bytes, then numTables 16-byte table records sorted by tag. All fields big endian. Table offsets are from the start of the file." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:OpenType font file" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "TableDirectory" |
|---|
| size | 12 |
|---|
| fields | | offset | 0 |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "sfntVersion" |
|---|
| notes | "big endian; 0x00010000 or 'OTTO' (also 'true', 'typ1' in old Apple fonts)" |
|---|
|
| offset | 4 |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "numTables" |
|---|
| notes | "big endian" |
|---|
|
| offset | 6 |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "searchRange" |
|---|
| notes | "16 * 2^floor(log2(numTables))" |
|---|
|
| offset | 8 |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "entrySelector" |
|---|
| notes | "floor(log2(numTables))" |
|---|
|
| offset | 10 |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "rangeShift" |
|---|
| notes | "16 * numTables - searchRange" |
|---|
|
| offset | 12 |
|---|
| size | 16 |
|---|
| type | "TableRecord[numTables]" |
|---|
| name | "tableRecords" |
|---|
| notes | "16 bytes each, sorted by tag" |
|---|
|
|
|---|
|
|---|
| evidence | | type | "documentation" |
|---|
| detail | "OpenType 1.9.1 otff, TableDirectory and TableRecord; records must be sorted in ascending order by tag; tables begin on four-byte boundaries" |
|---|
|
| type | "runtime_test" |
|---|
| detail | "sfntinfo parsed 303 font resources of a Windows 11 font directory and both FreeType test fonts: all directories sorted by tag, searchRange as computed, every table offset a multiple of 4." |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | | "Code:OpenType font file/sfntinfo (Python)" |
|
|---|
| key | "Table directory" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T16:02:59.190Z" |
|---|
| verifications | |
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-17T16:08:18.864Z" |
|---|
| summary | "Trailing array typed with the new TableRecord struct fact and its count field, so export_header emits a flexible array; note big-endian fields" |
|---|
| changed | |
|---|
|
|
|---|