Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where I can find .fon format specification?

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?

like image 288
HolyBlackCat Avatar asked Dec 14 '14 14:12

HolyBlackCat


2 Answers

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).

like image 87
djangodude Avatar answered Oct 07 '22 19:10

djangodude


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:

  • Archive Team FON File Information
  • Simon Tatham's Fonts Page (including mkwinfont and dewinfont for encoding and decoding files in FNT format) -- updated version available at https://github.com/juanitogan/mkwinfont (thanks Richard)

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.

like image 27
Thomas Perl Avatar answered Oct 07 '22 18:10

Thomas Perl