Introduction
A .fon file holds the bitmap fonts of Microsoft Windows, from Windows 1.0
onwards. These are the fonts of early Windows screens, such as MS Sans Serif, Courier and
Terminal, drawn pixel by pixel at a few fixed sizes. Windows still ships and uses some of
them, for example for the Terminal font of the console and in old programs.
A .fnt file is a single font resource on its own, and a .fon
file packs one or more of them together.
Structure
A .fon file is a 16-bit Windows
NE executable with no code, used only as a container
for resources. It starts with MZ, and the offset at 0x3C points
to the NE header, whose resource table lists one FONT resource
per size or style and a FONTDIR resource that summarises them (see
NE container and font directory). Each
FONT resource is the content of a .fnt file
(font resource): a header with the version (2.0
or 3.0), the point size, resolution, character height and range, the face name and a
table of character widths and offsets, followed by the glyph bitmaps, stored in
columns 8 pixels wide. Some fonts are vector fonts instead, made of pen strokes.
Not described
Known, not yet covered
- Viewer: the container is read as far as fonts go: the NE header, resource table and name tables, the PE headers and resource directory, the font directory and every font. The NE segment, entry and module reference tables, OS/2 NE resources, other PE sections and non-font resources are shown as labelled bytes, not decoded (container).
Unknown
- Viewer: the glyphs of version 3.0 fonts that use the ABC or colour formats are not drawn (the table is shown, its entry size inferred), for the reason below. Version 1.0 fonts (the Windows vector fonts) are read from what the real files show, and each is flagged.
- Reference: the exact sizes of the entries of the 3.0 ABC and colour glyph tables: the two sources disagree (one gives a field as 2 bytes, the other as 4), and no 3.0 or vector font was available to settle it.
- Reference: version 0x0100 fonts: neither source covers them.
The Windows 3.1 vector fonts (
MODERN.FON,ROMAN.FON,SCRIPT.FON) use that version with a 117-byte header and the glyph table straight afterdfBitsOffset, stroke offsets counted fromdfBitsOffset, and a pen-up marker of −128 standing alone before a pair; this is not yet on the FNT page. - Reference: the full meaning of bit 7 of
dfType, beyond “realised by a device”.
Links
Software
- Windows font viewer – the font preview and Fonts settings built into Windows (Windows)
- FontForge – free font editor that opens FON and FNT fonts (Windows, macOS, Linux)
Developers
- FreeType – library that renders Windows FON and FNT fonts (C)
Reference
- Windows Developers Notes: Font File Format – Microsoft Knowledge Base article Q65123, the 2.0 and 3.0 headers and character tables
- Font File Format – the Windows 3.1 Device Development Kit’s description, with raster and vector glyph layouts