76

I have a Unix-like OS installed without a windowing environment; i.e., just a text-mode console and no GUI.

Is it possible to change the font used by the console?

To be clear, I am not talking about the terminal emulator that comes with a desktop environment like KDE or GNOME.

Kevin E
  • 468
Weihang Jian
  • 1,227
  • 3
    Sure: https://wiki.archlinux.org/index.php/Fonts#Console_fonts – Blender Oct 03 '12 at 15:39
  • 2
    @Blender - hello from 2019! That resource has apparently moved here: https://wiki.archlinux.org/index.php/Linux_console#Fonts – Kevin E Sep 27 '19 at 20:37

7 Answers7

74

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").

Emanuel Berg
  • 6,903
  • 8
  • 44
  • 65
  • 12
    Font sizes listed by dpkg-configure console-setup are: 6x12, 8x14, 8x16, 10x20, 11x22, 12x24, 14x28, and 16x32. – Casey Watson Apr 08 '15 at 05:17
  • 1
    I had to reboot for this to take effect – mt025 Apr 05 '17 at 00:11
  • 1
    I used dpkg-reconfigure console-setup solution, and after i made my selections of font options, it modified /etc/default/console-setup and ran update-initramfs (i suppose with -u option). However, your answer does not mention running update-initramfs. Is it necessary? – Alexey Jul 28 '18 at 13:33
  • 1
    @mt025 you may use the command setupcon to apply the changes. It is part of the console-setup package. – Pankaj Jangid Mar 03 '20 at 06:22
  • 1
    On some distros (at least on Arch), the fonts will be in /usr/share/kbd/consolefonts. I will add a separate answer to highlight the setfont solution. – Leif Arne Storset Mar 05 '20 at 12:23
  • All the font sizes listed in dpkg-configure console-setup were smaller than I'd like for my 4K monitor. I want the font to be 5 times bigger! – Lonnie Best Dec 30 '21 at 07:25
16

/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

JdeBP
  • 68,745
  • The problem with this approach is that it is systemd-specific and changes the default for all users. – fpmurphy Oct 18 '17 at 10:42
  • 2
    FONT=Uni2-Terminus28x14 does not seems to work because there is no such font in my Arch-based system. Actually I don't care about the font face itself, but all I want is making the text bigger, because it is too small to read. Isn't there any way just to double or triple the console text size, without changing the font face? – Damn Vegetables Feb 28 '23 at 05:05
11

Using Ubuntu 16.04 (probably works in all supported versions), I edited ~/.bashrc and just before terminal splash at end of file, inserted the setfont command:

# Set font when running in console
/bin/setfont /usr/share/consolefonts/Lat2-Terminus32x16.psf.gz    

# Splash Calendar and time
now

# ASCII Linux distribution display
screenfetch

Now when selected Ctrl+Alt+F1 through Ctrl+Alt+F6 and get nice big fonts.

This is the largest font available and you can see a complete list with ls command:

$ ls /usr/share/consolefonts
Arabic-Fixed15.psf.gz             Lat15-Terminus20x10.psf.gz
Arabic-Fixed16.psf.gz             Lat15-Terminus22x11.psf.gz
Arabic-VGA14.psf.gz               Lat15-Terminus24x12.psf.gz
    (... SNIP ...)
Lat15-Terminus14.psf.gz           Vietnamese-Fixed16.psf.gz
Lat15-Terminus16.psf.gz           Vietnamese-Fixed18.psf.gz

Sample screen

This is a facsimile, not a true screen capture from console where screen is wider by 20% and background is black:

Sample console fonts

Prior to changes I couldn't read the screen on HDPI monitor.

  • 1
    That's nothing to do with the question. You're running a terminal in a gui. – RichieHH Dec 08 '20 at 23:22
  • 3
    @RichieHH The ~/.bashrc is processed when you open a terminal too. I just can't do a screen shot of a terminal session because there is no GUI running. – WinEunuuchs2Unix Dec 09 '20 at 12:49
  • A user having some trouble with the instructions: https://askubuntu.com/questions/1409347/error-when-i-go-the-the-root-sudo-s – muru May 19 '22 at 01:18
9

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.

mikeserv
  • 58,310
  • Given the age of this answer this makes sense, but for anyone reading this answer nowadays, there appears to have been no update to kmscon since 2014. I can imagine there are lot of security and compability issues with such an unmaintained tool – éclairevoyant Jul 05 '22 at 04:14
  • Project is not dead, it's just that development happens on different branches nowadays: https://github.com/Aetf/kmscon is the main one, and https://github.com/MacSlow/kmscon has a lot of cool, experimental new features. – the_yellow_logo Jun 24 '23 at 03:29
6

setfont worked for me. Choose a font; usually they are listed in one of these:

  • /usr/share/consolefonts
  • /usr/share/kbd/consolefonts

For example, to use the font /usr/share/kbd/consolefonts/ter-v32n.psf.gz, you can enter

setfont ter-v32n
5

A dead-simple, if inflexible, solution is to run setfont -d, which doubles the size of the current font. Running it twice won't quadruple the size, though (or at least not on my system).

  • At first i thought it did not work, because I ran it with sudo. I removed sudo and then it worked. But this seems to be applied to only the current session. If I log out and re-log in, the font goes back to its original size. How to make it persistent? – Damn Vegetables Feb 28 '23 at 05:13
  • I imagine putting the command in some file that loads when you start the shell -- ~/.inputrc or ~/.profile, for instance -- would have that effect. – Jeffrey Benjamin Brown Mar 01 '23 at 16:31
  • /usr/lib/kbd/consolefonts/ on Fedora – akostadinov Jan 07 '24 at 22:51
-2

In Linux Mint 18.1 terminal:

  1. Right click anywhere in the black space.
  2. Choose "profiles", "profile preferences".
  3. Put a tic in "custom font" box.
  4. Click on the big text sample box next to it.
  5. Choose whatever font size and type you want.

The changes will appear immediately.