Can I change the font of the text-mode console?
If you use the Linux console, the best way I found is:
in
/etc/default/console-setup
put, for example
CHARMAP="UTF-8"
CODESET="Lat7"
FONTFACE="Terminus"
FONTSIZE="28x14"
Another way is to use setfont
from the kbd
package:
setfont /usr/share/consolefonts/Lat7-Terminus28x14.psf
This works for my Debian; it may be different for you.
In Debian, you can also run dpkg-reconfigure -plow console-setup
to be prompted for the various console settings and pick them from menus.
Edit - I put together a small page how to setup the font colors. The section that is relevant for this post has the header "the Linux VTs" (= ttys, or "console").
/etc/default/console-setup
et al. have been superseded on systemd operating systems, although you will find that some operating systems such as Debian try to maintain the older configuration system.
The way to do this on a systemd operating system is to edit the font settings in the /etc/vconsole.conf
file. These settings are applied by the systemd-vconsole-setup
service, which is essentially a glorified way of running setfont
and loadkeys
before the login services are brought up.
So you would have FONT=Uni2-Terminus28x14
in that file, for example.
Note that the service program allows kernel command-line options such as vconsole.font
to override /etc/vconsole.conf
contents. If you are mucking around with GRUB kernel command-line options, bear this in mind.
Further reading
- Lennart Poettering et al..
vconsole.conf
. systemd manual pages. FreeDesktop.org. - Lennart Poettering et al..
systemd-vconsole-setup
. systemd manual pages. FreeDesktop.org. - Setting console font in vconsole.conf does not work (systemd)
- https://unix.stackexchange.com/a/326804/5132
If you want to use nearly any X-compatible font you should have a look at David Herrman's work on kmscon
. The name slightly belies the project, actually, as Kernel Mode Setting is not a requirement for it to work - it also works with with frame-buffer devices - for instance if you are using proprietary AMD or nvidia display drivers. With kmscon
you get multi-seat session management, xterm
like keyboard and UTF-8 font handling and session control. Changing the font can be done via the /etc/kmscon/kmscon.conf
or via a command-line option.