Kingdom Hearts Birth By Sleep - Font archive
At the path
arc/system/, the two files
font.arc (Japanese font) and
fonten.arc (European font) can be found. Those files are nothing more than an archive with all the information needed to render a character or a font image.
The following font types can be found in both font archives:
cmdfont, used for the command HUD at the bottom left.
menufont, used inside the menu.
mesfont, used for game dialogs. This is the most complete font.
numeral, it just contains numbers between 0 and 9.
fonticon, stores console button and game icons.
Internally, the game engine uses UCS as encoding, meaning that all the Shift-JIS text is ingested and converted on-the-fly to 2-bytes for each character. Then it does a look-up to both INF for FontIcon and COD to match and print that specific character by searching it using the Character ID.
Embedded in the executable, a hard-coded switch table is responsible to convert the characters from
~) into a UCS character.
Describes the texture of a font.
|00||short||How many characters the texture contains.|
INF - FontIcon variant
fonticon, the associated INF file is structured in a completely different way.
Left, Top, Right and Bottom are used to locate the icon in the texture
A 4-bit image (8-bit for
fonticon) that stores all the characters in a grid. The texture is swizzled by 256 bytes, which means that the content is stored by 32x16 pixel blocks at the time (16x16 for
fonticon since it is in 8-bit).
The texture size will be smaller than
width * height * bpp / 8 bytes long since it is swizzled. That means that the image content at the bottom-right does not contain any data since the 32x16 pixel blocks are not needed to be stored.
Since the colors of each pixel is indexed, a color look-up table is provided.
1024 bytes long file that stores one or more palettes for a given MTX.
For 4-bit MTXs, this file will contain up to 4 different palettes of 16 colors, but is most likely that only the first two are actually used.
For font files, switching between palette 1 and palette 2 will reveal two different contents from the same bitmap, a technique used in Kingdom Hearts II font files too.
For 8-bit MTXs, the file will be considered as a single palette of 256 colors.
The palette format is RGBA (bytes are stored as
0xRR 0xGG 0xBB 0xAA).
Provides the necessary info to print a given character.
|07||byte||Actual character width.|
The Character ID is not necessarly unique, for some weird reason. It is used to associate a specific font’s texture area to a given Shift-JIS character.