TO:R Data Map

font: font packages

Source
docs/formats/font.md
SHA-256
ba854f70…6fc5df83

The game's fonts, one package per language in Font/<lang>.dat: FreeType fonts (TrueType .ttf and .ttc files, drawn with FreeType) and bitmap fonts (a btx texture plus glyph and kerning tables, the shape of AngelCode BMFont's .fnt), with the links between them that make one font fall back to another. Each package is a small list of typed chunks; the fonts are in chunk type 1000, fonts (not the game's "fontset", which is menu/fontset/fontset.dat). Font/FontAllFilePackage.dat has the same chunk list with one unknown chunk, and the game reads it and throws it away. Every file is wrapped in RotXor and ZIP (containers.md), with the member <lang>.bin or FontAllFilePackage.bin. The code gives the package no format name; this doc calls it font.

Based on All 9 files in Font/: FontAllFilePackage.dat (185 bytes, SHA-256 daa642c6565cc73000ca722e67ad9f2574e5f8a4fd56a7d87d11ee8640a8e966), ja-jp.dat (14,320,999, c180cba7975f513d4cb8e7ec9360f2d2c67ae6ae52fa56c7998123aa888f1907), en-us.dat (8,228,273, bec8f89f14b419ec9f5906d3fe914a5c8cf7d61aea1cd0ff4215a57300043bc5), fr-fr.dat (2,781,896, a80fb2440475549698b007b8a1b091051786717df5186f468ccc5bae64c0639e), de-de.dat (2,780,615, b8b9393de872fff1ecb8d1ab7635dfc4169b5b4cc86dab0c841b3b344d0a6442), es-es.dat (2,781,496, 0fa0515c5aba2901050fd4f49819cecfa10af34c4eddc7927a8aa7384af2cdca), zh-cn.dat (7,121,494, 5b88e582e9eba85deeffb4f5e271483d2014d15a40203a899109e9c42f14e5c5), zh-tw.dat (13,432,073, 4f2379da865dd409c375485d020bb7865d934788c5346504880f0d17be1b8ab8), ko-kr.dat (5,627,255, f99149b04c6554340301cf0a47a51d1ec72fdcafa2db0200953b77a90fdcca38); menu/fontset/fontset.dat (747, ca3e8380762155ebafad3093ce7923a5b5888c120e57c7b8027fbb0dc35c715f) for the font names it uses; FileTable.bin (filetable.md); the unpacked executable, SHA-256 7b0230a11498f40396c9048345e7cfe0ef442cb7ca8faffc6f197920d2669599; AngelCode BMFont file format (checked 2026-10-11).
Checked 2026-10-11
Method Static analysis with Ghidra 12.1.4 (the decompiled code in local/exe/decomp/, raw bytes of the executable for two field offsets) of the loaders 0x1402a3770, 0x1402a3860, the chunk walker 0x1402a3f00 and the fonts reader 0x1402ac010, and what they call. Single-file C# programs (session scratchpad, with the toolchain's Containers library): scan.cs and check.cs parse every file the way 0x1402a3f00 and 0x1402ac010 do and check every count, size, padding byte and string; faces.cs reads each TrueType face's name table and matches the font names in fontset.dat; ftable.cs finds the files' group and IDs in FileTable.bin. Not yet decoded or rebuilt by the toolchain. No in-game tests.

Where the files are

All in file-table group 600 (0x258). The game's language is 0x14026ca60, the same value the text loader uses (txte.md).

File File ID Language Payload FreeType fonts (faces) Bitmap fonts Font slots
Font/FontAllFilePackage.dat 0 — 76 — — —
Font/ja-jp.dat 0x14 0 36,089,484 tacos_font.ttf, dnp13forgame.ttc (2), ik4ll3.ttc (2), is4gm3.ttc (2), tacos_font_number.ttf 16 24
Font/en-us.dat 0x15 1 32,391,292 tacos_font.ttf, ik4ll3.ttc (2), se-alpscb_.ttf, se-mlseu.ttf, tacos_font_number.ttf 20 26
Font/fr-fr.dat 0x16 2 23,800,108 tacos_font.ttf, se-alpscb_.ttf, se-mlseu.ttf, tacos_font_number.ttf 19 23
Font/de-de.dat 0x17 3 23,800,012 same as fr-fr 19 23
Font/es-es.dat 0x18 4 23,800,012 same as fr-fr 19 23
Font/zh-cn.dat 0x19 5 26,184,668 tacos_font.ttf, arshulinsonggb.ttf, arshuyuansongh32gb_hv.ttf, arudjingxiheixgb_bd.ttf, tacos_font_number.ttf 15 20
Font/zh-tw.dat 0x1A 6 38,877,388 tacos_font.ttf, armingb5.ttf, arstdsongb5_bd.ttf, arudjingxiheie1b5hk_bd.ttf, tacos_font_number.ttf 15 20
Font/ko-kr.dat 0x1B 7 24,546,716 tacos_font.ttf, fttk-ydcharmingminchom.ttf, fttk-ydgothic140.ttf, tacos_font_number.ttf 15 19

Package

Offset Size Type Name Meaning Confidence Source
0x00 4 u32 chunk_count Number of chunks, n: 3 in every language package, 1 in FontAllFilePackage.dat. confirmed 0x1402a3f00; C# scan, all 9 files.
0x04 4 u32 chunk_type[i], i = 0 to n−1 Each chunk's type, below. 20, 150, 1000 in every language package, in that order; 10 in FontAllFilePackage.dat. likely 0x1402a3f00 (picks the reader by type); C# scan.
0x04 + 4n 4 u32 chunk_size[i], i = 0 to n−1 Each chunk's size, not counting its padding. confirmed 0x1402a3f00; C# scan: the chunks end exactly at the end of the payload in all 9 files.
0x04 + 8n — — chunks The chunks back to back, in table order. Each is followed by zero bytes up to a multiple of 16 bytes (none when its size already is one). confirmed 0x1402a3f00 (steps by the size rounded up to 16); C# scan: every padding byte is zero, all 9 files.

Chunk types

Type Name What it holds Confidence Source
10 control_code_sizes 54 bytes, each 1 to 6 (01 03 05 06 05 03 01 02 …), only in FontAllFilePackage.dat: the size of each text control code from 0x80 to 0xB5, code byte and arguments (txte.md). They match every code size the text needs: all 576 text tables of the eight languages decode and rebuild byte for byte with them (R19), and Gibbed's sizes for 0x80–0xB3 are the same. The code read so far frees the file without reading it, yet the drawing routines skip codes by a table of this shape (renderer +0xB0, indexed by code − 0x80), whose source isn't found. likely Contents: the R19 round trip of localize/; Gibbed MacroCodeHelpers. 0x1402a3770 frees the file once read, through 0x1402a45e0; 0x1402a4a00 reads the sizes at renderer +0xB0; C# scan.
20 (0x14) char_set_20 A NUL-terminated UTF-8 string: a set of characters. The game decodes it into a set with its lowest and highest code, and while drawing text counts runs of characters that are in it. Just the NUL in every package. likely 0x1402a3f00 (set at renderer +0x670, range at +0x668); 0x1402a3710 (membership); the draw and layout routines 0x1402a45e0 region (count at renderer +0xea); C# scan.
150 (0x96) char_set_150 A NUL-terminated UTF-8 string: a set of characters that the text control codes 0xB4 and 0xB5 test, to pick one of two text variants by whether a character is in the set. fr-fr: the 60 vowels aeiouyæœåàáâäèéêëìíîïòóôõöùúûü and their capitals; just the NUL in the others. guess: for French elision (le/l'). likely 0x1402a3f00 (set at renderer +0x680); 0x14029be20 (membership), used by the control codes in 0x14029bd80 region and 0x1402d8120 region; C# scan.
1000 fonts Every font, below. likely 0x1402a3f00 → 0x1402ac010; C# scan.

The game skips a chunk of any other type, using its size (0x1402a3f00).

Fonts

Chunk 1000. Four parts in a row: links, FreeType fonts, bitmap fonts, and a final u32. Strings are a u32 length (counting the NUL) then the bytes, NUL-terminated. Where the tables below say "pad to 4", zero bytes follow up to the next multiple of 4 from the start of the payload (which, since chunk data starts at 4 + 8n, is also from the start of the chunk). Offsets in a record are from the record's start, or from a named point in it.

A u32 link_count (18 to 24), then the records, with no alignment.

Offset Size Type Name Meaning Confidence Source
0x0 4 u32 name_length Length of name, with its NUL. confirmed 0x1402ac010; C# scan.
0x4 name_length raw name A font's record name (ik4ll3.ttc, captaincomic.fnt, …). likely 0x1402ac010; C# scan.
after name 4 u32 fallback_count Number of fallback names. confirmed Same.
after that — — fallbacks fallback_count strings (u32 length, then the bytes): the record names of the fonts to fall back to, in order. likely Same.

FreeType fonts

A u32 freetype_count (4 or 5), then the records.

Offset Size Type Name Meaning Confidence Source
0x0 4 u32 name_length Length of name, with its NUL. confirmed 0x1402ac010; C# scan.
0x4 name_length raw name The font's file name (tacos_font.ttf, ik4ll3.ttc, …): the name the links use. Then pad to 4; call that point A. likely Same.
A 4 u32 exclude_count Number of exclude_codes. confirmed Same.
A + 4 4 u32 exclude_codes[i] Character codes this font reports it doesn't have, so they come from its fallback. 0xAE (®) in every text font; is4gm3.ttc also 0x30FC (ー); none in tacos_font.ttf and tacos_font_number.ttf. Call the end B. likely 0x140175c70 (adds to the set at font asset +0x878), 0x14009aaf0 (returns "no glyph" for a code in it); C# scan.
B 4 u32 kern_count Number of kern_codes. confirmed 0x1402ac010; C# scan.
B + 4 4 u32 kern_codes[i] Character codes kerned even next to a glyph from another font. Only is4gm3.ttc has one, 0x30FC. Call the end C. guess 0x140175ca0 (adds to the set at font asset +0x8b0), 0x14009c1c0 (membership), used in the text layout 0x14009c600 region where adjacent glyphs come from different fonts; C# scan.
C 4 u32 unk_c_0x0 0 in every record. Stored as a byte in the FreeType font asset (+0x838). — 0x140174ed0 → 0x140099ff0; C# scan.
C + 0x4 4 u32 clear_fallback_mark 1 only for tacos_font.ttf. When set, the game clears bit 0 of +0x8ec on the font's asset after all links are made: the bit TextFontBlade::vfunction2 sets on a font added as a fallback. guess: lets a fallback font also serve as a main font. likely 0x1402ac010 (collects the slots), 0x140174e90, 0x1401756a0 (sets +0x8ec); C# scan.
C + 0x8 4 u32 debug_font 1 for one font per package (se-alpscb_.ttf, is4gm3.ttc, arudjingxihei*, fttk-ydgothic140.ttf). The first face with it set is also registered as @debug font in slot 0, with the value 52 (0x34) set on that text font (not a debug feature). likely 0x1402ac010; C# scan.
C + 0xC 4 u32 data_size Size of data. confirmed 0x1402ac010; C# scan (the next record starts right after data).
C + 0x10 data_size raw data The whole .ttf (starts 00 01 00 00) or .ttc (starts ttcf) file. The next record follows directly, with no padding. confirmed C# scan: every data is a TrueType file or collection, all 8 packages.

Bitmap fonts

A u32 bitmap_count (15 to 20), then the records. en-us has font_gaiji.fnt twice, with different base and unk_d_0x10; both are loaded.

Offset Size Type Name Meaning Confidence Source
0x0 4 u32 name_length Length of name, with its NUL. confirmed 0x1402ac010; C# scan.
0x4 name_length raw name The font's name (amery.fnt, icon_ps4.fnt, …): both its record name for the links and the name it's registered under. Then pad to 4; call that point A. likely Same.
A 4 u32 exclude_count As in FreeType fonts; 0 in every record. likely Same.
A + 4 4 u32 exclude_codes[i] As in FreeType fonts. Call the end B. likely Same.
B 4 u32 kern_count As in FreeType fonts; 0 in every record. likely Same.
B + 4 4 u32 kern_codes[i] As in FreeType fonts. Call the end C. likely Same.
C 4 u32 clear_fallback_mark As in FreeType fonts; 0 in every record. likely Same.
C + 0x4 4 u32 texture_size Size of texture. confirmed Same.
C + 0x8 texture_size raw texture The glyph sheet, a btx texture (starts btx\0), handed to the texture loader. Then pad to 4. likely 0x1402ac010 (passes it to the loader at 0x140f6c780); C# scan: every one starts btx\0.
next 4 u32 language_count Number of language codes. confirmed Same.
next — — languages language_count strings, each after pad to 4: language codes (en-us, fr-fr, …; ja-jp, zh-cn, … in the icon fonts). The game skips them. likely 0x1402ac010 (steps over them); C# scan.
next — — linked_name Pad to 4, then a string; a 0 length means none. Only captaincomic.fnt has one, captaincomic_bold.fnt. The game puts the linked font at the front of this font's chain, and sets a byte (+0x9c6) on the linked font's asset. guess: a bold variant. likely 0x1402ac010 (end), 0x140175740 (insert at the front), 0x140175d80; C# scan.
next — — pad Pad to 4, then a string; a 0 length means none. ps4, switch, xinput, dinput or ps5 makes this the button-icon font for that pad (the game's class Mx::Input::Pad, +0x48 mapped to 0–4); any other value (icon_ea, icon_es, icon_en, icon_asia in the icon_icon_* fonts) does nothing. likely 0x1402ac010 (compares with the list at 0x140c9a978, stores the slot at renderer +0x5a8 + 4 × index), 0x14029e550 region (picks the icon font by pad); C# scan.
D 4 s32 font_size Call this point D. The font's size; the game uses its absolute value. Negative in many (−64, −40, …), as BMFont writes it. likely 0x1402ac010 (absolute value passed twice to 0x140175290); C# scan; BMFont info fontSize.
D + 0x4 4 u32 unk_d_0x4 0, 1 or 2. Not read. — 0x1402ac010; C# scan.
D + 0x8 4 u32 line_height Line height in pixels (40 to 107). likely 0x1402ac010 → 0x140175290; C# scan; BMFont common lineHeight.
D + 0xC 4 u32 base Distance from the top of a line to the baseline (34 to 81); passed with every glyph. likely Same; BMFont common base.
D + 0x10 4 u32 unk_d_0x10 0 or 1 (1 in the icon fonts and one font_gaiji.fnt). Passed to the font texture as a byte (+0x210). — 0x140175290; C# scan.
D + 0x14 4 u32 unk_d_0x14 0 or 1 (1 in the text fonts). Passed to the font texture as a byte (+0x211). — Same.
D + 0x18 4 u32 unk_d_0x18 0 or 2 (2 in the icon fonts). Passed to the bitmap font asset. — Same.
D + 0x1C 4 u32 icon_kind 0 for an ordinary font; 1 icon_font*, 2 icon_dot_font, 3 icon_icon_*, 4 icon_badge_font*. The game keeps kinds 1 to 4 as its special icon fonts. likely 0x1402ac010 (stores the slot at renderer +0x598, +0x59c, +0x5a4, +0x5a0), 0x14029e550 region; C# scan.
D + 0x20 4 u32 glyph_count Number of glyph records (21 to 826). confirmed 0x1402ac010; C# scan.
D + 0x24 32 — glyphs[i] Glyphs, glyph_count of them. likely Same.
after the glyphs 4 u32 kerning_count Number of kerning records: up to 636 in captaincomic*.fnt, 0 in the rest. confirmed Same.
after that 12 — kerning[i] Kerning, kerning_count of them. The next record follows directly. likely Same.

Glyphs

Offset Size Type Name Meaning Confidence Source
0x00 4 u32 code The character code. font_gaiji.fnt and the icon fonts use private-use codes from 0x100000 up. likely 0x1402ac010, 0x140175cd0 (maps the code to the glyph index); C# scan; BMFont char id.
0x04 4 s32 x Left of the glyph on the texture. likely BMFont char x.
0x08 4 s32 y Top of the glyph on the texture. likely BMFont char y.
0x0C 4 s32 width Glyph width. likely BMFont char width.
0x10 4 s32 height Glyph height. likely BMFont char height.
0x14 4 s32 x_offset Offset from the pen to the glyph's left. likely BMFont char xoffset.
0x18 4 s32 y_offset Offset from the top of the line to the glyph's top. likely BMFont char yoffset.
0x1C 4 s32 x_advance How far the pen moves. likely BMFont char xadvance.

Kerning

Offset Size Type Name Meaning Confidence Source
0x0 4 u32 first Code of the first character. likely 0x1402ac010 (passes the three values to the font asset); BMFont kerning first.
0x4 4 u32 second Code of the second character. likely BMFont kerning second.
0x8 4 s32 amount Pen adjustment between them (e.g. −7). likely BMFont kerning amount; C# scan.

End

Offset Size Type Name Meaning Confidence Source
0x0 4 u32 unk_end 0 in every package; the last 4 bytes of the chunk. Not read. likely 0x1402ac010 stops before it; C# scan, all 8 packages.

How fonts are named and found

How the game reads it

Rebuilding

What a rebuilt or edited package needs, from the reader above. None of it is proven by a round trip or an in-game test yet.

So a replaced font has to be valid, not byte-identical:

Leads