[Linux] Set monospace fonts for terminal

I don’t know why, openSUSE and Chakra, the two KDE distro seems reluctant to setup the fonts and make their Konsole available out-of-box….

If your konsole (or any other terminal emulator) cannot display text in bold, or characters cannot align correctly, you can:

  1. Set the font of konsole to monospace.
  2. If not solved, do following:

Create a file /etc/fonts/local.conf:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<alias binding="strong">
<family>monospace</family>
<prefer>
<family>DejaVu Sans Mono</family>
<family>Ubuntu Mono</family>
<family>Droid Sans Mono</family>
<family>Noto Mono</family>
<family>Roboto Mono</family>
</prefer>
</alias>
</fontconfig>
  • binding="strong" to forcely set.
  • You can re-order the <family>‘s in <prefer>...</prefer> by your personal preference. I like DejaVu Sans Mono.

Save, then run as root:

1
fc-cache -v -f

Restart your konsole, wow.

You also can use fc-match -s monospace | less to see if it took effect.