FONT (File Format): Difference between revisions

Jump to navigation Jump to search
>Aruki
>Aruki
Line 287: Line 287:
{{research|minor|Someone should look at the code to make sure the info in this section is accurate.}}
{{research|minor|Someone should look at the code to make sure the info in this section is accurate.}}


Textures used by FONT files are encoded in a bit of an unorthodox manner. The font format allows for multiple glyphs to be encoded in the same spot on the texture by splitting up the texture into multiple layers. The way this is handled on the textures is by encoding the textures with palettes (as C4), but modifying the palette indices at runtime and loading each layer one at a time as a separate layer. Each bit of the palette index corresponds to a layer, so up to four layers per font are supported. In DKCR, font texture are encoded as C8, so theoretically the game could use up to eight layers per font; however, it still never actually uses more than four.
Textures used by FONT files are encoded in a bit of an unorthodox manner. The font format allows for multiple glyphs to be encoded in the same spot on the texture by splitting up the texture into multiple layers. The way this is handled on the textures is by encoding the textures with palettes (as C4), but modifying the palette indices at runtime and loading each layer one at a time as a separate layer. Each bit of the palette index corresponds to a layer, so up to four layers per font are supported. The MSB refers to layer 0, while the LSB refers to layer 3. In DKCR, font texture are encoded as C8, so theoretically the game could use up to eight layers per font; however, it still never actually uses more than four.


The texture format is determined by a value in the header. These are the possible settings:
The texture format is determined by a value in the header. These are the possible settings:
Anonymous user

Navigation menu