reversing fonts by reversing fonts.
(second reversing meaning reverse engineering, obviously).
yay for being able to repack GGuiSys.
(second reversing meaning reverse engineering, obviously).
yay for being able to repack GGuiSys.
<"FONT":32> -- magic value <VERSION:32> -- 2 for MP1, 4 for MP2? <unknown1:32> <unknown2:32> <unknown3:32> <unknown4:32> <unknown5:16> <unknown6:32> <unknown7:32> [FONT NAME ...] -- null-terminated ASCII string <TEXTURE ID:32> <unknown8:32> <NUMBER OF CHARACTER TABLE ENTRIES:32>
<CHARCODE:16> -- UTF-16 character representation ('A', 'B' etc). The last record will have NULL here. <TEXTURE COORDINATE LEFT:32> | Defines a rectangle into the texture specified in the header. <TEXTURE COORDINATE TOP:32> | See notes. <TEXTURE COORDINATE RIGHT:32> | <TEXTURE COORDINATE BOTTOM:32> | (for prime 1 only -- 7 x 32-bit fields. character dimensions?) { <unknown A:32> | I haven't tried modifying these yet, but they are probably things like <unknown B:32> | the size of the character's clipping rectangle and how wide the <unknown C:32> | character is in pixels (so how far the "print head" should advance when the <unknown D:32> | character is plotted, in both X and Y directions). <unknown E:32> | <unknown F:32> | <KERNING TABLE INDEX:32> -- index into the kerning table at the bottom of the file. for many characters this seems to be one beyond the end of the kerning table, which presumably means there is no kerning adjustment for this character. } (or for prime 2 only -- 9 x 8-bit fields. character dimensions?) { <unknown X: 8> -- not present in prime 1 <unknown A: 8> <unknown B: 8> <unknown C: 8> <unknown D: 8> <unknown E: 8> <unknown F: 8> <unknown Y: 8> -- not present in prime 1 <KERNING TABLE INDEX:8> }
<NUMBER OF RECORDS IN KERNING TABLE:32> -- just the number of records in the kerning table that follows
<CHARCODE:16> -- UTF-16 character representation of first character ('A', 'B' etc) <CHARCODE:16> -- UTF-16 character representation of following character <KERNING ADJUST:32> -- *signed* 32-bit value which defines how much the X-spacing should be adjusted for this combination of characters. it may be positive (e.g. 0x00000002) or negative (e.g. 0xfffffffe).
<unknown A:32> -- glyph left padding <unknown B:32> -- distance to advance print head before printing next character? usually equals width (field D) <unknown C:32> -- glyph extra right padding? <unknown D:32> -- width | (texture region is scaled to fit <unknown E:32> -- height | this box) <unknown F:32> -- glyph baseline offset? raising this value moves the glyph up. often same value as height (E)?