Converting classic Slackware fonts (.fnt) to TrueType fonts?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I recently re-discovered it while playing around with a LIVE CD archive I found online...
Nowadays I spend most of my time in Windows, but I'm falling back in love with Linux and I'd really like have this font... everywhere (Windows, Raspbian, Slackware 14+, etc).
So, I'd love to convert it (or be pointed to a conversion that's already been done...) to a monospace TrueType font. The crux of the issues is that I can't find an online converter anywhere that understands the .fnt format. Most websites even claim it's an archaic Windows bitmap font format (Windows doesn't recognize it anymore). I've verified that Windows recognizes .fon bitmap font files, but not .fnt (if it ever did...).
In addition to the monospaced criteria, Microsoft also specifies that the font for the Command Prompt:
Cannot be an italic font
Cannot have a negative A or C space
Must be FF_MODERN if it is a TrueType font
Must be OEM_CHARSET if it is not a TrueType font
Of course, I also want to use the font in Raspbian. I figure once I get it converted to a TTF, it should be trivial to get it working over there...
So, I'd also love to know how I can guarantee criteria 2 and 3. (1 and 4 are irrelevant).
Thanks in advance for the help!
About me:
I'm a developer who is getting "back into Linux" after a 20 year hiatus. Back in my college days (mid-90s) I spent most of my time in Slackware 3.5 (and, admittedly I spent most of that time in a telnet client playing MUDs, shell scripting, and abusing the university's dial-up access with auto-re-dialer scripts my roommate and I hacked together...). I dual-booted to Windows 95 when I wanted to play games. ;-)
Now all I need is a classic Slackware FNT spec and perhaps I can build a converter to the Windows .FNT format... which may still work "out-of-the-box" as a Raster/Bitmap-type font. Either way, once the RL.FNT is translated into a "proper" .FNT, most of the online converters should be able to translate it into a TTF...
So, any idea where to find the file format definition for the "classic" Slackware .FNT format?
The README that explains where the fonts come from
Looks like you forgot the http:// at the beginning of the link, so it now shows http://www.linuxquestions.org/questions/mirrors.slackware.com instead of pointing to the correct link: README
It certainly explains the pedigree (I did see the SCRIPT before but realized it wasn't doing much but copying 4k chunks from another file).
However, it doesn't provide insight into the actual binary .FNT format being used... at least not in an actionable way.
I suppose whatever font processing & display code Slackware is using could give some hints. I'd rather not reverse-engineer the format from the code, but if I get bored/motivated enough I suppose I could resort to that.
So, I'd love to convert it (or be pointed to a conversion that's already been done...) to a monospace TrueType font. The crux of the issues is that I can't find an online converter anywhere that understands the .fnt format. Most websites even claim it's an archaic Windows bitmap font format (Windows doesn't recognize it anymore). I've verified that Windows recognizes .fon bitmap font files, but not .fnt (if it ever did...).
Any clue on how to get this to happen?
I tried to convert rl.fnt to another format, but fontforge is unable to open this fnt file (Didier already mentioned this). It turns out that rl.fnt is a raw font!
Code:
$ file rl.fnt
rl.fnt: data
From the setfont manpage:
Code:
FONT FORMATS
The standard Linux font format is the PSF font. It has a header describing font proper‐
ties like character size, followed by the glyph bitmaps, optionally followed by a Unicode
mapping table giving the Unicode value for each glyph. Several other (obsolete) font
formats are recognized. If the input file has code page format (probably with suffix
.cp), containing three fonts with sizes e.g. 8x8, 8x14 and 8x16, then one of the options
-8 or -14 or -16 must be used to select one. Raw font files are binary files of size
256*N bytes, containing bit images for each of 256 characters, one byte per scan line,
and N bytes per character (0 < N <= 32). Most fonts have a width of 8 bits, but with the
framebuffer device (fb) other widths can be used.
Now this rl.bdf file can be opened with fontforge, and from there it can be manipulated and saved to different formats, including TTF. I'm no expert with fontforge, so I have no clue about the steps necessary to convert a bitmap font to another format. Here's some info from the fontforge website.
Jeremy, your post stirred up some nostalgia on my part so, armed with information others have posted on this thread, I decided to embark on an effort to utilize the old font in Konsole.The result of my effort is posted below.
For those interested, I have attached the file itself. Due to the restrictions of LQ, I've had to add the .txt extension to get it to upload, but once you've downloaded, do the following:
P.S. The font option displayed in Konsole's font selection dialog box is 'psf', for a reason I have yet to fathom. Probably someone who is more familiar with fonts could post why this is happening.
Might I inquire as to how you made the jump from fnt (or bdf, etc) to otf?
You may. I used the command:
Code:
raw2psf rl.fnt rl.psf
to convert the raw font to a psf file via the psftools package per Diantre's suggestions.
Then I used the command:
Code:
psf2bdf rl.psf rl.bdf
to convert it from a .psf file to a file .bdf file, one that fontforge could open.
In fontforge, I opened the file, went to Element --> Font Info, clicked on 'General' on the left side, change 'Em size' to a power of 2; in this case, 2^10, or 1024, then clicked OK.
To save, I went to File --> Generate Font. Where it says 'No Outline Font', I clicked on the drop-down menu and selected Open Type (CFF), renamed the file above the selection box to reflect the new extension, and clicked 'Generate'. Viola! an OpenType font I could drop right into /usr/share/fonts/OTF. Ran the commands to register the new font, and configured Konsole to use the font. Retro goodness!
Converting classic Slackware fonts (.fnt) to TrueType fonts?
You're welcome. I most certainly enjoyed the challenge. It's why I run Slackware in the first place. Keeps the mind sharp, especially as I am getting older and forgetting things.
Last edited by 1337_powerslacker; 03-18-2015 at 11:17 AM.
You're welcome. I most certainly enjoyed the challenge. It's why I run Slackware in the first place. Keeps the mind sharp, especially as I am getting older and forgetting things.
Well, I figured I'd circle back around after all these years because I tried to use the .OTF you labored over on Windows 10 and for some odd reason it doesn't like it. No errors, it just renders every glyph as completely transparent (no positive or negative space whatsoever)... so we may be missing something.
Here's a snapshot of what it looks like in FontForge:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.