Changing the Console Font of Linux Servers to a Classic VT100/VT220

I used to use a real VT220 terminal way back in the college days, and I remembered that I rather liked the font. So I decided to make a linux console font to use it on the text console of linux hosts.

Place the font file in /usr/share/consolefonts

Edit /etc/default/console-setup to have the lines:

CHARMAP="UTF-8"
FONTFACE="VGA"
FONTSIZE="8x16"
FONT="vt220.psf.gz" 

This gives the best effect when combined with changing to a blinking green block cursor.

There is a bug in the Ubuntu 20.x (and probably prior versions) script that sets the console fonts (/usr/bin/setupcon). When you specify a FONT, for some reason, the script puts its name in twice, which breaks the script. It’s a simple enough fix. Find the line (line 690 as of when I am writing this):

FONTFILES=`echo $FONTFILES` # remove extra spaces

and change it to read:

FONTFILES=`echo $FONTFILES | tr ' ' '\n' | sort | uniq | tr '\n' ' '` # remove extra spaces

This will remove any duplicate file names, which will make it load correctly instead of erroring out and not setting it to the requested font.

Extra bonus: If you use a Raspberry Pi, and have one of the official screens for it, when you use this font, you get a perfect old school 80×24 terminal. Now if only the linux console supported all of the DEC primitives like double sized text and such…

14 thoughts on “Changing the Console Font of Linux Servers to a Classic VT100/VT220”

  1. Hello,
    I’ve downloaded your psf.gz file but some characters are missing (ò and ì for example). May you help me to fix it?

    Thanks

    Reply
      • Maybe the problem is with the “ter-u20n_unicode.bdf” because these characters (ò and ì for example) are also missing in “ter-u20n.psf.gz” font file of my distro (Arch).

        From the Terminus README:

        ter-1* iso01, iso15, cp1252 ISO8859-1, ISO8859-15, Windows-1252
        ter-2* iso02, cp1250 ISO8859-2, Windows-1250
        ter-7* iso07, cp1253 ISO8859-7, Windows-1253
        ter-9* iso09, cp1254 ISO8859-9, Windows-1254
        ter-c* cp1251, iso05 Windows-1251, ISO8859-5
        ter-d* iso13, cp1257 ISO8859-13, Windows-1257
        ter-g* iso16 ISO8859-16
        ter-i* cp437 IBM-437
        ter-k* koi8r KOI8-R
        ter-m* mik Bulgarian-MIK
        ter-p* pt154 Paratype-PT154
        ter-u* koi8u KOI8-U

        So maybe it need to be compiled with a ter-1* variant.

        For example:

        bdf2psf –fb vt220-20.bdf+ter-120n.bdf /usr/share/bdf2psf/standard.equivalents /usr/share/bdf2psf/ascii.set+/usr/share/bdf2psf/linux.set+/usr/share/bdf2psf/useful.set 512 vt220.psf

        But I don’t know where to find (or how to generate) a ter-120n.bdf font file.

        Reply
        • I am trying to find that font again myself. It doesn’t seem to be in the same place in Ubuntu 22 as it was in 20, or I installed it manually and forgot… I’ll update when I figure out where I got it from. 🙂

          Reply
        • I’ve almost got it working. I am just taking the terminus font out of the picture entirely. I have the TTF of it that I merged with Unifont, which isn’t as pretty, but still works. I’m generating it off of that, and it (mostly) works now. I’m trying to get the height and width right so bdf2psf doesn’t fail. It insists that the AVERAGE_WIDTH be a multiple of 10, for no reason I can figure out. The BDF export sets that to 118. It looks perfect when I change that to 100, except for descenders; i.e. g, p, q, etc are getting chopped off at the bottom. I’ll upload the final font once I get it right, and update the “how to” page with updated commands.

          Reply
        • I have a new version uploaded to the same link. It’s not perfect; the Unifont glyphs are distorted, but all of the vt220 glyphs are there. I will keep working on getting alternate characters to look right, but this one should be better. Let me know how it works for you. I’m doing a deep dive into the BDF format so I can better understand how to make it exactly how I want.

          Reply
          • Tried and it’s ok, thanks again. So the problem was with the fontforge file or with the bdf2psf converted command? Is the .sfd file also updated?

    • Well, when I looked at the original PSF file, it seems like it only had a 256 character table instead of 512, so possibly I messed up when I generated it the first time. It’s been a while, so I don’t remember for sure. I have an sfd file that has all the other glyphs based on Unifont, but they’re really ugly to begin with. And for some reason, when I generate the BDF file, they get more distorted. I think it’s because they are 16 point, and the vt220 glyphs are 20, so it’s expanding the Unifont ones. They look OK when a scalable font is exported. I’ll add the merged sfd file to the page. The original one is only the DEC glyphs.

      Reply
    • I updated the command on the build page, and removed the Terminus font. It uses the original sfd file I have posted (which has a stripped down Unicode set). Adding the file /usr/share/bdf2psf/fontsets/Uni1.512 to the set list, seems to have fixed the missing characters. There are still a few characters that are “garbage” at the end of the 512 glyph table, but it looks like all of the DEC characters, and some of the other characters that were in the original sfd, are now rendering correctly. Once you install it, you can run the command /usr/bin/showconsolefont to output all the characters in the loaded font.

      Reply

Leave a Comment