0

I have a .FON file I'd like to use, vgafix.FON, "use" in the sense that I'd like to be able to generate an image from individual characters of the font. I have seen this question regarding the .FON format, but am having trouble interpreting the answers.

From the various links in that question, I understand that the .FON format is just a .EXE wrapped around a .FNT, but I cannot tell where the .EXE ends and the .FNT begins. .FON's should be NE executables, and the extended header contains an offset to the resource table, where I'd expect the .FNT data to be contained. In vgafix.FON, the extended header starts at 0x80, and offset 0x24 should contain the resource table offset, and offset 0x34 for the number of resource table entries.

However, the resource table offset corresponds to an address that doesn't start with null, which .FNT files are supposed to. Additionally, 0xB4 contains 0, so there are zero resource tables anyways? I am unsure whether offsets are relative to the beginning of the header, or the position of the value within the header, but the above is true for both. I can see the copyright information which I believe is parts of the .FNT file(s), but that info is not exactly 60 characters so I'm unsure where that begins or ends too.

What about these file formats am I misunderstanding, and how can I tell where the .FON container data ends and the proper .FNT data begins?

hex editor

Gumpf
  • 197
  • 7

1 Answers1

0

I'm just finishing up code that does just this. It's still in a somewhat rough state, email me to get the complete class, it's a bit bulky to post here. The purpose of it is to use .FON files to make big letters in terminal windows, you can discard that part. The main thing is that it parses the complete FON file to identify resources - fonts in particular.

Here are the main points:

  • Traverse the MZ header
  • Traverse the NE header
  • Locate the Resource Table in the NE header
  • Parse the Resource Table to find the fonts (there can be many!)
  • Parse each font.
  • Do your stuff.

There is no logic to handle vector fonts, just raster/bitmapped

regards Kári Poulsen kpo@kvf.fo