Convert .fnt to .ttf?

5,918

Solution 1

As @mjturner states you would be best of finding a close approximation.

But if you are really serious about font conversion - it can be done! The trick is to get these old raster format converted to more modern file formats which the modern tools uses. PSF Tools come in handy for that! It handles many of the old simple bitmap formats.

You can then convert a raster font to a vector font. It is just a question about doing a number of conversions and then trace the outline into vector format.

Most console fonts are pretty simple bitmaps. But if you look at the .fnt file in FreeBSD you will notice that the file is uuencoded. These steps are from the top of my head (and notes) but you will probably get the gist. The hard part here is to figure out what the source format is. I have other notes where I converted a PSF font to a "bsd" font using psf2bsd - I am not sure whether I needed to uuencode it (It was years ago).

First we uudecode to get the raw data:

uudecode -o iso-8x16.raw /usr/share/syscons/fonts/iso-8x16.fnt

If my guess is right that we now simply have the raw raster font data then we can take a detour over PSF to get to TTF.

With that bundle you can convert raw to psf:

raw2psf iso-8x16.raw iso-8x16.psf

When it is in PSF format we can than get it into a number of other formats. A good candidate is X11 BDF:

psf2bdf iso-8x16.psf iso-8x16.bdf

X11 BDF is nice because it can be handled by our friend fontforge. You can use fontforge to trace the file into TTF format.

Or simply use PSF Tools to convert into a more common format and then use one of the many online tools.

UPDATE: Description of the font format by Poul-Henning Kamp:

It's a raw bit-map font, this is from iso-8x14:

Hex Binary
18  00011000
3c  00111100
3c  00111100
3c  00111100
18  00011000
18  00011000
00  00000000
18  00011000
00  00000000
00  00000000
00  00000000
00  00000000

66  01100110
66  01100110
66  01100110
24  00100100
00  00000000
00  00000000
00  00000000
00  00000000
00  00000000
00  00000000
00  00000000
00  00000000
00  00000000

And Dan Nelson adds:

They're only uuencoded for easy storage in CVS. Vidcontrol can take regular raw 8xN font bitmap files as well. I use an old DOS program called Font Mania, and there are hundreds of VGA fonts available for download at Simtel.

http://www.simtel.net/pub/msdos/vga/

http://www.simtel.net/pub/msdos/screen/

Solution 2

I think it's going to be tricky to find something to covert a .fnt file into TrueType. As has been mentioned by @Octopus, the former is a raster font and the latter is vector based. In addition, I believe the console font files used by FreeBSD and OpenBSD are not the same format as used by Windows, making finding a converter even trickier.

You'll be better off trying to find a TrueType font that matches the look of the console font you like. For example, Classic Console is a very close approximation of the classic VGA 8x16 font.

Share:
5,918

Related videos on Youtube

Mirco
Author by

Mirco

Updated on September 18, 2022

Comments

  • Mirco
    Mirco almost 2 years

    In FreeBSD's /usr/share/syscons/fonts one finds the syscons-fonts in .fnt-format.

    Is there a way to convert them to .ttf format?

    • Octopus
      Octopus almost 9 years
      the files in /usr/share/syscons/ are raster fonts. they cannot typically be converted to ttf which are vector based, but you might try searching for ttf font converters.
    • Mirco
      Mirco almost 9 years
      Thank you, octopus. I tried FontForge. But it sais: "This does not appear to be a Windows FNT for FON file". In a FreeBSD article I found "specifically, the .fnt files used by syscons under FreeBSD may not be the same format as a .fnt file one encounters in the MS-DOS®/Windows® environment. freebsd.org/doc/en/articles/fonts/article.html