-
Notifications
You must be signed in to change notification settings - Fork 11
Windows .FNT resources
-
Versions 2.0 and 3.0 bitmap
.fnt
resources are well documented by Microsoft Knowledge Base 65123 which is available in several places on the web, though no longer directly from Microsoft. -
That document does not describe Version 1.0 which is documented in the MS Windows SDK 1.03 Programmer's reference. See Appendix C: Font Files (p. 432 ff.)
-
Neither source documents the format in which vector glyphs are stored, and I have not found any definitive sources on this. My reverse-engineered notes below.
-
All vector
.fnt
files I have seen were Version 1.0 files, including those supplied with later versions of Windows. -
If fixed width, these vector fonts have a v1.0 GlyphEntry structure in the CharTable, which is simply
GlyphEntry
geOffset: uint16 // pointer to the stroke instructions
- If proportional, the vector GlyphEntry structure is
GlyphEntry
geOffset: uint16 // pointer to the stroke instructions
geWidth: uint16 // width of the glyph, in design units
-
Note that this structure has the
geWidth
andgeOffset
fields swapped compared to a v2.0 bitmap.fnt
. -
The glyph information is stored in the same place as the bitmap strike in a bitmap
.fnt
. Instructions consist of 2 signed bytes in the range [-127, 127], representing the X and Y relative offset of the move.- each pair represents a move drawn with a straight line,
-
unless it is preceded by
0x80
(-128) and represents a move without a line.
-
The coordinate system has origin at the top left of the glyph; positive directions are rightward and downward.