The font files are divided into 4 main sections:
- [1] Header section
[2] UTF Table
[3] Index Table
[4] Character Data
Address range: 0x0000 -> 0x03ff
Code: Select all
0x0000 ->
0x01ff = Always filled with 0x00
0x0200 = [int32] Font File Identifier?
Always 0x010000F0
0x020c = [int32] Number of Index Table entries
0x0220 = Number of ?Unknown? entries in header table
0x0224 ->
0x0224 + NumberOf?Unknown? = Unknown codes
Address range: 0x000400 -> 0x0403ff
Code: Select all
Each entry (0x04 bytes in size)
Byte 0x00 [int32] = Entry number in Index Table
Does not have to be unique, Index entries may be shared
Address range: 0x040400 -> 0x040400 + NumberOfEntries * 0x10
Code: Select all
Each entry (0x10 bytes in size)
Byte 0x00: [int16] Character Display Width
Byte 0x02: [int16] Number of bytes used
Byte 0x04: [int16] Width of byte runs
Byte 0x06: [int16] Height of the byte runs
Byte 0x08: [int16] Unknown
Appears to usually be -1,0,1,2,3 although I have seen 5 and -3 as well
This may be some kind of draw shift, allowing for overlapping of previous characters
Byte 0x0A: (short) Unknown
Seems to remain the same value for all characters in a font
Byte 0x0C: (int32) Offset to data
Address range: 0x040400 + NumberOfEntries * 0x10 -> EndOfFile
Code: Select all
There are three methods used. The first is a color change, the second is a pixel run-length and the third is a coded run length.
Data Byte:
0x00 = COLOR CHANGE + 1 pixel run (This is the only multi-byte code)
The two bytes immediately following the 0x00 code are a4r4g4b4 data values.
*NOTE* After the color change a single pixel is drawn.
0x01->
0x7f = PIXEL RUN LENGTH
If bit 6 (0x40) is not set, the pixels are skipped.
If bit 6 (0x40) is set, the pixels are drawn.
bits 0 -> 5 (0x3f) = number of pixels to skip or draw
0x80 ->
0xff = CODED RUN-LENGTH
These are individual codes that provide a run-length as well as a brightness
*NOTE* The may possibly contain alpha changes as well
http://www.remnantmods.com/archive/misc ... Viewer.rar
*v0.91 RELEASE NOTES*
-> This update fixes a massive memory leak. When shut down, memory was not released.
-> Changed loading method and discovered there are actually many unused characters (multiple duplicates at times)
-> Fixed mouse popup displays to show correct information.