FONT (File Format): Difference between revisions
Jump to navigation
Jump to search
→Textures
>Aruki (→Format) |
>Aruki |
||
Line 285: | Line 285: | ||
== Textures == | == Textures == | ||
{{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. To dump out every layer into a single texture by encoding each layer on a separate RGBA channel, the following palette colors could be substituted into the texture: | |||
<pre>0 (0000) - 0x8000 (none) | <pre>0 (0000) - 0x8000 (none) | ||
Line 303: | Line 305: | ||
14 (1110) - 0xFFFF (red/green/blue) | 14 (1110) - 0xFFFF (red/green/blue) | ||
15 (1111) - 0x7FFF (red/green/blue/alpha)</pre> | 15 (1111) - 0x7FFF (red/green/blue/alpha)</pre> | ||
[[Category:File Formats]] | [[Category:File Formats]] |