Changing font is something that can be interesting in a lot of situations. First, the default font could be too small, too big or just look too unpleasant when you need to work on TTY for extended periods. For those cases, it could be interesting to be able to change the font. Today, I will explain how to change the font to the terminus font, which provide a lot of variants.
First, I extracted the Linux source files and installed the font into the console fonts directory. I executed a few commands, that are detailed in the font README.
Please take in account that these commands are executed on Fedora, where the fonts are located in
/usr/lib/kbd/consolefonts
. Depending on your distribution, the path may change! On Debian-based distributions, the fonts are located in/usr/share/consolefonts
.
./configure --psfdir=/usr/lib/kbd/consolefonts
make -j8
sudo make install fontdir
After that, you should now have the font installed.
Terminus is provided in a lot of variants, supporting several encodings and formats. They can be found in the console fonts folder. To keep it easier, we will only display variants that can be used with practically any language, since it has all the other encodings merged.
ls /usr/lib/kbd/consolefonts/ter-v*.psf.gz
We can still find a lot of variants not having the most meaningful names, so we need figure what all these files are named after.
According to the README, the font variants are named following the ter-[encoding][size][weight].psf.gz
pattern. It should be safe to expect the variant named term-v16n.psf.gz
to be smaller than the one named term-v18n.psf.gz
.
The font is also available with different weights using the following patterns:
ter-v*n.psf.gz
variants will be normalter-v*b.psf.gz
variants will be boldter-v*v.psf.gz
variants will be CRT VGA bold
At this point, we would like to be able to change the font. We can use the setfont
command to temporary change the font of the current TTY terminal.
setfont /usr/lib/kbd/consolefonts/ter-v18b.psf.gz
And that's it! Your font is changed!
Keep in mind that the font is not persistent, so you need to either reconfigure your kernel with your new font or load the font each time you go in a TTY, but that would be in another blog post.