Line 9:
Line 9:
The endianess is Big Endian.
The endianess is Big Endian.
−
=== BRFNT header ===
+
RFNT Header
+
10h bytes
−
The header is 16 bytes long.
+
0000: 'RFNT'
−
{| class="wikitable"
+
0004: FE FF 01 04
−
! Offset
−
! Size
−
! Description
−
|-
−
| 0x0000
−
| 4
−
| "RFNT" (0x52464E54)
−
|-
−
| 0x0004
−
| 2
−
| Endian? (0xFEFF)
−
|-
−
| 0x0006
−
| 2
−
| Version? (0x0104)
−
|-
−
| 0x0008
−
| 4
−
| File Size
−
|-
−
| 0x000C
−
| 2
−
| Header Size? (0x0010)
−
|-
−
| 0x000E
−
| 2
−
| Number of Sections?
−
|}
−
=== FINF section ===
+
0008: DWORD length of whole file
−
Contains font information. 32 bytes long.
+
000C: WORD ??
−
{| class="wikitable"
+
000E: WORD ?? (language flag?)
−
! Offset
+
−
! Size
+
FINF Header
−
! Description
+
20H bytes:
−
|-
+
−
| 0x0000
+
0000: 'FINF'
−
| 4
+
−
| "FINF" (0x46494E46)
+
0004: DWORD finf size
−
|-
+
−
| 0x0004
+
0008: BYTE ??
−
| 4
+
−
| Size of this section (bytes from section beginning)
+
0009: BYTE font height - 1
−
|}
+
+
000A: WORD ??
+
+
000C: BYTE ??
+
+
000D: BYTE character width or height + 1 (?)
+
+
000E: BYTE character height or width + 1 (?)
+
+
000F: BYTE 00 (?)
+
+
0010: DWORD TGLP section position
+
+
0014: DWORD CWDH section position
+
+
0018: DWORD CMAP section position
+
+
001C: BYTE font height - 1 (excluding left line?)
+
+
001D: BYTE font width - 1 (excluding bottom line?)
+
+
001E: BYTE character width or height - 1 (?)
+
+
001F: BYTE 00 (?)
+
+
TGLP Header
+
30h bytes
+
+
0000: 'TGLP'
+
+
0004: DWORD length of 'TGLP' section
+
+
0008: BYTE font width - 1
+
+
0009: BYTE font height - 1
+
+
000A: BYTE character width - 1
+
+
000B: BYTE character height - 1
+
+
000C: DWORD length of 1 image
+
+
0010: WORD images count
+
+
0012: WORD ??
+
+
0014: WORD characters per row
+
+
0016: WORD characters per column
+
+
0018: WORD width of image
+
+
001A: WORD height of image
+
+
001C: DWORD position of data
+
+
TGLP Data
+
Bitmap is formed in a Zig-zag way.
+
+
A single block of bitmap looks like this:
+
+
00 01 02 03 04 05 06 07
+
+
08 09 0A 0B 0C 0D 0E 0F
+
+
10 11 12 13 14 15 16 17
+
+
18 19 1A 1B 1C 1D 1E 1F
+
+
Multiple blocks:
+
+
B01 B02 B03 ... B08 (assume width=64)
+
+
B09 B0A B0B ...
+
+
...
+
+
Multiple images:
+
+
I01
+
+
I02
+
+
I03
+
+
...
+
+
CWDH Section
+
0000: 'CWDH'
+
+
0004: DWORD length of this section
+
+
0008: DWORD last character ? (= character count - 1)
+
+
000C: DWORD first character ? (= 0)
+
+
0010: character count * (
+
+
BYTE space width ?
+
BYTE character width
+
BYTE smaller than character width )
+
????: (0~3) * 00 (align to 4 bytes)
+
+
CMAP Section
+
Type 1 :
+
+
0000: ‘CMAP’
+
+
0004: DWORD length of this section
+
+
0008: WORD UTF-16 code of first char
+
+
000A: WORD UTF-16 code of last char
+
+
000C: DWORD 0 ?
+
+
0010: DWORD position of next CMAP + 8
+
+
0014: WORD offset of first char
+
+
0016: WORD ?
+
+
Type 2 :
+
+
0000: ‘CMAP’
+
+
0004: DWORD length of this section
+
+
0008: WORD 0
+
+
000A: WORD -1
+
+
000C: 00 02 00 00 ?
+
+
0010: DWORD position of next CMAP + 8 (0 if no next)
+
+
0014: WORD characters in this table (tbl_char count)
+
+
0016: tbl_char count * (
+
+
WORD UTF-16 code of char
+
WORD offset of char )
+
????: WORD 0