From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:PSF console font" |
|---|
| claim | "A PSF2 file starts with the magic 72 B5 4A 86 (0x864AB572 little endian) and seven little-endian u32 fields; only version 0 is accepted, flags bit 0 means a Unicode table follows the glyphs, the table is UTF-8 with 0xFF as separator and 0xFE starting a sequence, and charsize = height * ((width + 7) / 8)." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "PSF2 console fonts" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "psf2_header" |
|---|
| size | 32 |
|---|
| fields | | offset | "0x0" |
|---|
| size | 4 |
|---|
| type | "uint8[4]" |
|---|
| name | "magic" |
|---|
| notes | "72 B5 4A 86" |
|---|
|
| offset | "0x4" |
|---|
| size | 4 |
|---|
| type | "uint32" |
|---|
| name | "version" |
|---|
| notes | "0" |
|---|
|
| offset | "0x8" |
|---|
| size | 4 |
|---|
| type | "uint32" |
|---|
| name | "headersize" |
|---|
| notes | "offset of the bitmaps" |
|---|
|
| offset | "0xC" |
|---|
| size | 4 |
|---|
| type | "uint32" |
|---|
| name | "flags" |
|---|
| bits | | bit | "0" |
|---|
| name | "HAS_UNICODE_TABLE" |
|---|
|
|
|---|
|
| offset | "0x10" |
|---|
| size | 4 |
|---|
| type | "uint32" |
|---|
| name | "length" |
|---|
| notes | "number of glyphs" |
|---|
|
| offset | "0x14" |
|---|
| size | 4 |
|---|
| type | "uint32" |
|---|
| name | "charsize" |
|---|
| notes | "bytes per glyph" |
|---|
|
| offset | "0x18" |
|---|
| size | 4 |
|---|
| type | "uint32" |
|---|
| name | "height" |
|---|
|
| offset | "0x1C" |
|---|
| size | 4 |
|---|
| type | "uint32" |
|---|
| name | "width" |
|---|
|
|
|---|
| endianness | "little" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "PSF2_MAGIC0-3, struct psf2_header, flags, MAXVERSION, UTF8 separators" |
|---|
| repo | "https://github.com/legionus/kbd" |
|---|
| commit | "9c3a59b5ba52e065e5a5398e728e2b1a41c4983e" |
|---|
| path | "src/include/kbd/kfont.h" |
|---|
| lines | "61-96" |
|---|
|
| type | "source" |
|---|
| detail | "reader checks version, fontlen, charsize, headersize" |
|---|
| repo | "https://github.com/legionus/kbd" |
|---|
| commit | "9c3a59b5ba52e065e5a5398e728e2b1a41c4983e" |
|---|
| path | "src/libkfont/psffontop.c" |
|---|
| lines | "249-300" |
|---|
|
| type | "source" |
|---|
| detail | "Comment: 'The integers here are little endian 4-byte integers.'" |
|---|
| repo | "https://github.com/legionus/kbd" |
|---|
| commit | "9c3a59b5ba52e065e5a5398e728e2b1a41c4983e" |
|---|
| path | "src/include/kbd/kfont.h" |
|---|
| lines | "58-69" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "PSF2 header" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-18T23:42:38.293Z" |
|---|
| verifications | |
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T12:52:46.214Z" |
|---|
| summary | "Byte order set: kfont.h says the psf2 integers are little endian 4-byte integers" |
|---|
| changed | |
|---|
|
|
|---|