File Info: JKO/JKA Font Data Files (.fontdat) - Bejitt
I did a 'little' looking into how the fonts work in JKO/A (Academy, at least) and I ended up somewhat 'reverse-engineering,' if you will, the .fontdat files. =) I noticed you had an 'interest' in this (via lucasforums), so here are the notes I took:
7180 bytes per fontdat
0x0000 to 0x037F, the first 896 (0x0380) bytes are nulled out
0x20 is space, which is the first one on the targas
0x00 to 0x19, the first 32 characters, aren't normally printed, so they must be those nulled bytes
896 nulled bytes / 32 characters = 28 (0x1C) bytes / 1 character
28 (bytes/character) doesn't divide evenly into 7180 (bytes per fontdat)
7168 works (256 characters), though, so what are the last 12 bytes for?
I'm not really sure yet, but they seem to be correlated with the sizes/shapes; perhaps spacing info?
(The last one or two integers seem to always be zero)
so, 0x00 through 0xFF (0-255) correspond to their respective ascii character
0100 0100 0900 0000 0000 0000 0000 043E 0000 903E 0000 063E 0000 923E
0600 0F00 0500 0000 0E00 0000 0000 303E 0000 903E 0000 3C3E 0000 AE3E
0900 0E00 0800 0000 0D00 0000 0000 5C3E 0000 903E 0000 6E3E 0000 AC3E
1000 1000 0F00 0000 0E00 0000 0000 843E 0000 903E 0000 943E 0000 B03E
1800 1000 1800 0000 0D00 0000 0000 C03D 0000 C83E 0000 103E 0000 E83E
[ ] [ ] [ ] [ ] [ ] [ ] [ ]
wid high awid xoff ahig yoff left top right bottom
the first integers specify the width and the height of the spacing.
the next integer specifies the actual width of the character, followed by the printed x offset
the next integer specifies the actual height of the character, followed by the printed y offset
the next four floats (4 bytes each) specify the relative locations on the font image
(note: these values * image dimension = actual location)
- the origin of a printed character is its bottom-left corner and oriented upwards.
- this means that a negative yoffset would put the character's origin below the 'printed line'
I've checked a number of the characters with their values in the files, and all of this seems to be correct.
Comments and Suggestions Follow: