11

I'm thinking about making a bitmap font editor, but I'm completely unable to find any information about .fon internal structure.

Someone knows where I can find it? Or the only solution is to analyse these files myself?

HolyBlackCat
  • 45,832
  • 5
  • 81
  • 134

2 Answers2

26

I will preface this by mentioning that "FON" has become a somewhat common file extension for several different font formats. By far the most common is Microsoft's, but there are other files calling themselves FON which use a completely different format. So you may want to double-check that. The information I include below is only about the Microsoft format.

FON is actually just EXE format, which is to say: FON files are EXEs that contain font resources (and only font resources), renamed with file extension FON. There is more information about that in this very old documentation written around the time FON was introduced.

You are probably actually interested in the font resource format, known as FNT. Microsoft has good documentation on that.

Essentially what you do is create your FNT resources, then compile them as if they were a Windows Executable (you may include several FNTs in a FON; typically what is done is to package multiple sizes of the same font into a single FON).

djangodude
  • 4,552
  • 3
  • 26
  • 37
  • HI. Is there a way we can use .FON in linux? – Ammar Ul Hassan Apr 06 '17 at 13:08
  • @AmmarUlHassan, please ask this as a new question (not as a comment on an existing question/answer). – djangodude Apr 06 '17 at 17:44
  • Pity... I made a pixel font editor for old game formats, and got the request to output them as Windows-usable bitmap fonts, but this file type doesn't seem very plausible to write programmatically from my editor. – Nyerguds Apr 13 '17 at 12:30
  • 3
    Here is an alternative link to the knowledge base article: https://jeffpar.github.io/kbarchive/kb/065/Q65123/ – Daveman Jul 03 '19 at 19:56
8

Since the Microsoft Knowledge Base Article #65123 linked from the other answer isn't working anymore ("Sorry, page not found"), here are some alternatives that I have found:

Quoting from the Archive Team page:

FON is a font file format native to Microsoft Windows. It began to be marginalized as of Windows 3.1, with the introduction of TrueType, though it continues to be supported. It contains fonts in FNT format. As such, it supports both bitmapped and stroked fonts; but aside from the stroked fonts included with Windows (Modern, Roman, and Script), it is used almost exclusively for bitmapped fonts. It is sometimes even called Windows bitmapped font format.

And that page links to the FNT (Windows Font) wiki page there, explaining the file format, and there is also the Windows SDK PDF, which starting on page 423 contains a description of the FON file format contents.

Thomas Perl
  • 1,686
  • 18
  • 19