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?
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).
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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With