From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:PSF console font" |
|---|
| claim | "A PSF1 file starts with the 4-byte header 36 04, mode, charsize; width is 8, glyph count 256 (512 with mode bit 0x01), mode bit 0x02 = Unicode table, 0x04 = table with sequences, modes above 5 are rejected; the table uses 16-bit little-endian values with 0xFFFF as separator and 0xFFFE starting a sequence." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "PSF1 console fonts" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "psf1_header" |
|---|
| size | 4 |
|---|
| fields | | offset | "0x0" |
|---|
| size | 2 |
|---|
| type | "uint8[2]" |
|---|
| name | "magic" |
|---|
| notes | "36 04" |
|---|
|
| offset | "0x2" |
|---|
| size | 1 |
|---|
| type | "uint8" |
|---|
| name | "mode" |
|---|
| bits | |
|---|
|
| offset | "0x3" |
|---|
| size | 1 |
|---|
| type | "uint8" |
|---|
| name | "charsize" |
|---|
| notes | "bytes per glyph = height" |
|---|
|
|
|---|
| endianness | "little" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "PSF1_MAGIC0/1, MODE flags, MAXMODE, separators, struct psf1_header" |
|---|
| repo | "https://github.com/legionus/kbd" |
|---|
| commit | "9c3a59b5ba52e065e5a5398e728e2b1a41c4983e" |
|---|
| path | "src/include/kbd/kfont.h" |
|---|
| lines | "43-59" |
|---|
|
| type | "source" |
|---|
| detail | "reader: mode > PSF1_MAXMODE rejected, fontlen 512 or 256" |
|---|
| repo | "https://github.com/legionus/kbd" |
|---|
| commit | "9c3a59b5ba52e065e5a5398e728e2b1a41c4983e" |
|---|
| path | "src/libkfont/psffontop.c" |
|---|
| lines | "233-247" |
|---|
|
| type | "source" |
|---|
| detail | "assemble_ucs2 builds the value as byte0 | byte1<<8, compared with PSF1_SEPARATOR 0xFFFF and PSF1_STARTSEQ 0xFFFE; the table is read only when mode has HASTAB or HASSEQ and must end exactly at the file end" |
|---|
| repo | "https://github.com/legionus/kbd" |
|---|
| commit | "9c3a59b5ba52e065e5a5398e728e2b1a41c4983e" |
|---|
| path | "src/libkfont/psffontop.c" |
|---|
| lines | "43-56, 116-124, 244, 345-360" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "PSF1 header" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-18T23:42:38.224Z" |
|---|
| verifications | |
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T16:36:49.706Z" |
|---|
| summary | "Byte order of the unicode table was only in prose: data.endianness added (header is bytes only; table entries are 16-bit little-endian, assemble_ucs2 = u1 | u2<<8)." |
|---|
| changed | |
|---|
|
|
|---|