The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]

Things look quiet here. But I've been doing a lot of blogging at dan.langille.org because I prefer WordPress now. Not all my posts there are FreeBSD related. I am in the midst of migrating The FreeBSD Diary over to WordPress (and you can read about that here). Once the migration is completed, I'll move the FreeBSD posts into the new FreeBSD Diary website.

Customizing Console Fonts 27 March 2001
Share
Need more help on this topic? Click here
This article has 1 comment
Show me similar articles

Written by Troy Bowman

After playing with slackware for a while I got pretty excited about some interesting fonts that they have to replace the very boring and generic console font. A couple of the fonts I liked were "t" (technical) font and the unorthodox "scrawl" font.

Instantly, I remembered the ability to change the console font in freebsd, but that those console fonts were just international fonts, and didn't change the way the fonts on the console looked much at all. I wondered if the .fnt.gz files that slackware uses were compatible with freebsd's font files and if I could just copy one over and instigate it. My reflex was to go ask the people in #freebsd on undernet (as I often do). They didn't know, but said "there's only one way to find out!" So, I thought I'd give it a shot. When I told them it worked a few minutes later, Lazarus told me to send what I did in, so here it is.

Getting the Console Font you Want

I simply unzipped the fonts I wanted from slackware and dumped them into the /usr/share/syscons/fonts directory. The two fonts I liked were mentioned above, the "t" and "scrawl" fonts, t.fnt.gz and scrawl_w.fnt.gz, respectively.

After that, read the vidcontrol manpage a little I tried issuing the command that would change the font. It worked instantly! I issued this command:

# vidcontrol -f 8x16 t

Since t.fnt was in the directory it was supposed to be, it found it automatically. I tried it with a font in my home directory, specifying the full path, and that worked too, of course.

Aaah, my console already looked a TON nicer. I once again had the warm fuzzy feeling that comes from using an open operating system, and I no longer had to have those evil lingering connotations of MS-DOS that come with the standard textmode font.

It was easy to make my computer boot up with this font, since FreeBSD already has an rc mechanism to allow for font selection. For example, to add my "t.fnt" to rc.conf, I'd simply add the line:

font8x16="t"

Tada!

Font Editing

After all that, I wasn't satisfied. I wanted more. I liked the scrawl font a lot more than the technical font because it was so wacky looking that the clueless would probably think my video card went bad or bewitched or something. I had one peeve about the scrawl font. The "a" letter looked more like an "e" to me, and because of that, I'd get short brain-farts looking at the letter trying to realize what it was. I thought there must be a font editor, so I typed "font" on my console and pressed the awesome "tab" button and it expectedly filled out "fontedit" for me! (tab works for bash, but often for tcsh or csh, tab is not enough. For csh and its derivatives, you have to press control-D to get it to list possible stuff that you haven't written yet.)

I tried to start to use that program, but it didn't work. After reading the manpage, I noticed that it may have been written for those select people who own a Sun Keyboard with keys like "Help", "F13", "Select" and so on. I thought there had to be a better way.

I noticed there was a fontedit in the ports (/usr/ports/sysutils), and wondered if that was any different. Well, it was. It provides two programs: "fontdump", which dumps the whole font to a file that is "readable by humans" and "fontmake", which takes an edited dump file and converts it back to a binary .fnt file. Editing the font with a text editor was a piece of cake, and within minutes I had a new scrawl.fnt that didn't have a wacky "a". 

Share
Need more help on this topic? Click here
This article has 1 comment
Show me similar articles