From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Library:FreeType" |
|---|
| claim | "Layout of FT_FaceRec (what FT_Face points to) in Windows x64 builds (FT_Long = 4 bytes), unchanged from 2.6.2 to 2.15.0. Application code reads face->glyph at +0x78, face->num_glyphs at +0x10, face->size at +0x80, face->charmap at +0x88. LP64 offsets (computed, unverified): num_glyphs 0x20, family_name 0x28, units_per_EM 0x88, glyph 0x98, size 0xA0, charmap 0xA8, total 0xF8. 32-bit (checked): glyph 0x54, size 0x58, charmap 0x5C, total 0x84." |
|---|
| scope | | level | "library" |
|---|
| applies_to | "Library:FreeType" |
|---|
| observed_in | | "freetype.dll 2.6.2 (Win64)" |
| "Left 4 Dead 2 libfreetype.so.6 2.11.1 (32-bit)" |
|
|---|
|
|---|
| data | | name | "FT_FaceRec" |
|---|
| size | 216 |
|---|
| alignment | 8 |
|---|
| fields | | offset | 0 |
|---|
| size | 4 |
|---|
| type | "int32_t" |
|---|
| name | "num_faces" |
|---|
| notes | "FT_Long" |
|---|
|
| offset | 4 |
|---|
| size | 4 |
|---|
| type | "int32_t" |
|---|
| name | "face_index" |
|---|
| notes | "FT_Long; low 16 bits face, high 16 bits named instance" |
|---|
|
| offset | 8 |
|---|
| size | 4 |
|---|
| type | "int32_t" |
|---|
| name | "face_flags" |
|---|
| notes | "FT_Long; FT_FACE_FLAG_SCALABLE 1, FIXED_SIZES 2, FIXED_WIDTH 4, SFNT 8, HORIZONTAL 0x10, VERTICAL 0x20, KERNING 0x40, ..." |
|---|
|
| offset | 12 |
|---|
| size | 4 |
|---|
| type | "int32_t" |
|---|
| name | "style_flags" |
|---|
| notes | "FT_Long; bit 0 italic, bit 1 bold; high 16 bits number of named instances" |
|---|
|
| offset | 16 |
|---|
| size | 4 |
|---|
| type | "int32_t" |
|---|
| name | "num_glyphs" |
|---|
| notes | "FT_Long" |
|---|
|
| offset | 24 |
|---|
| size | 8 |
|---|
| type | "char*" |
|---|
| name | "family_name" |
|---|
|
| offset | 32 |
|---|
| size | 8 |
|---|
| type | "char*" |
|---|
| name | "style_name" |
|---|
|
| offset | 40 |
|---|
| size | 4 |
|---|
| type | "int32_t" |
|---|
| name | "num_fixed_sizes" |
|---|
| notes | "FT_Int" |
|---|
|
| offset | 48 |
|---|
| size | 8 |
|---|
| type | "void*" |
|---|
| name | "available_sizes" |
|---|
| notes | "FT_Bitmap_Size* (16-byte records on Win64: short height, short width, then 3 x FT_Pos)" |
|---|
|
| offset | 56 |
|---|
| size | 4 |
|---|
| type | "int32_t" |
|---|
| name | "num_charmaps" |
|---|
| notes | "FT_Int" |
|---|
|
| offset | 64 |
|---|
| size | 8 |
|---|
| type | "void*" |
|---|
| name | "charmaps" |
|---|
| notes | "FT_CharMap* (array of pointers to FT_CharMapRec { face, encoding, platform_id, encoding_id })" |
|---|
|
| offset | 72 |
|---|
| size | 16 |
|---|
| type | "FT_Generic" |
|---|
| name | "generic" |
|---|
| notes | "void* data, void* finalizer" |
|---|
|
| offset | 88 |
|---|
| size | 16 |
|---|
| type | "FT_BBox" |
|---|
| name | "bbox" |
|---|
| notes | "xMin, yMin, xMax, yMax as FT_Pos (4 bytes each on Win64)" |
|---|
|
| offset | 104 |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "units_per_EM" |
|---|
|
| offset | 106 |
|---|
| size | 2 |
|---|
| type | "int16_t" |
|---|
| name | "ascender" |
|---|
|
| offset | 108 |
|---|
| size | 2 |
|---|
| type | "int16_t" |
|---|
| name | "descender" |
|---|
|
| offset | 110 |
|---|
| size | 2 |
|---|
| type | "int16_t" |
|---|
| name | "height" |
|---|
|
| offset | 112 |
|---|
| size | 2 |
|---|
| type | "int16_t" |
|---|
| name | "max_advance_width" |
|---|
|
| offset | 114 |
|---|
| size | 2 |
|---|
| type | "int16_t" |
|---|
| name | "max_advance_height" |
|---|
|
| offset | 116 |
|---|
| size | 2 |
|---|
| type | "int16_t" |
|---|
| name | "underline_position" |
|---|
|
| offset | 118 |
|---|
| size | 2 |
|---|
| type | "int16_t" |
|---|
| name | "underline_thickness" |
|---|
|
| offset | 120 |
|---|
| size | 8 |
|---|
| type | "FT_GlyphSlotRec*" |
|---|
| name | "glyph" |
|---|
| notes | "FT_GlyphSlot" |
|---|
|
| offset | 128 |
|---|
| size | 8 |
|---|
| type | "void*" |
|---|
| name | "size" |
|---|
| notes | "FT_Size" |
|---|
|
| offset | 136 |
|---|
| size | 8 |
|---|
| type | "void*" |
|---|
| name | "charmap" |
|---|
| notes | "FT_CharMap (active charmap)" |
|---|
|
| offset | 144 |
|---|
| size | 8 |
|---|
| type | "void*" |
|---|
| name | "driver" |
|---|
| notes | "FT_Driver; private fields from here on" |
|---|
|
| offset | 152 |
|---|
| size | 8 |
|---|
| type | "void*" |
|---|
| name | "memory" |
|---|
| notes | "FT_Memory" |
|---|
|
| offset | 160 |
|---|
| size | 8 |
|---|
| type | "void*" |
|---|
| name | "stream" |
|---|
| notes | "FT_Stream" |
|---|
|
| offset | 168 |
|---|
| size | 16 |
|---|
| type | "FT_ListRec" |
|---|
| name | "sizes_list" |
|---|
| notes | "head, tail pointers" |
|---|
|
| offset | 184 |
|---|
| size | 16 |
|---|
| type | "FT_Generic" |
|---|
| name | "autohint" |
|---|
|
| offset | 200 |
|---|
| size | 8 |
|---|
| type | "void*" |
|---|
| name | "extensions" |
|---|
|
| offset | 208 |
|---|
| size | 8 |
|---|
| type | "void*" |
|---|
| name | "internal" |
|---|
| notes | "FT_Face_Internal" |
|---|
|
|
|---|
| endianness | "native" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "typedef struct FT_FaceRec_ { FT_Long num_faces; ... FT_Face_Internal internal; } FT_FaceRec; identical field list at VER-2-6-2" |
|---|
| repo | "https://github.com/freetype/freetype" |
|---|
| commit | "37515cf56ba3349656049edbed89ffc6f6466f2d" |
|---|
| path | "include/freetype/freetype.h" |
|---|
| lines | "1229-1283" |
|---|
|
| type | "byte_pattern" |
|---|
| detail | "freetype.dll 2.6.2 x64: FT_Load_Glyph starts 48 83 B9 80 00 00 00 00 (cmp [rcx+80h],0: face->size) ... 48 8B 59 78 (mov rbx,[rcx+78h]: face->glyph); FT_Get_Char_Index: 48 8B 89 88 00 00 00 (face->charmap) and 3B 43 10 (cmp eax,[rbx+10h]: num_glyphs); FT_Render_Glyph: mov rax,[rax+90h] (face->driver). 32-bit libfreetype.so.6 2.11.1: FT_Load_Glyph 8B 57 58 (size) and 8B 77 54 (glyph), FT_Get_Char_Index 8B 46 5C (charmap)." |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "FT_FaceRec Win64" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T15:56:45.990Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-18T20:01:01.994Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read include/freetype/freetype.h lines 1229-1283 at freetype commit 37515cf5 and recomputed the layout by hand: field order matches the data list; with 4-byte FT_Long/FT_Pos (Win64) every offset in data matches (units_per_EM 104, glyph 120, size 128, charmap 136, driver 144, internal 208, total 216). With 8-byte FT_Long/FT_Pos (LP64) I get num_glyphs 0x20, family_name 0x28, units_per_EM 0x88, glyph 0x98, size 0xA0, charmap 0xA8, total 0xF8, as the claim states. Binary byte patterns not re-checked." |
|---|
| notes | "The LP64 numbers are now confirmed by computation from the header, not from a binary." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-17T16:05:52.015Z" |
|---|
| summary | "Field types as stdint/pointer types (FreeType typedef names kept in notes) so export_header emits typed fields; same offsets" |
|---|
| changed | |
|---|
|
| by | "PatientStepper99" |
|---|
| date | "2026-10-19T12:40:32.856Z" |
|---|
| summary | "Set byte order native: FreeType public API struct in process memory." |
|---|
| changed | |
|---|
|
|
|---|