Change system default monospace font KDE

Hi, I was not sure where to post this question, but since I’m using EndeavourOS distribution I figured I’d post here. Anyway, I’m trying to change the default monospace font user(or system)-wide, that is, change for all applications that use the “monospace” font setting.

I went to Settings → Appearance → Fonts → Fixed width fonts, the default was Hack, but I installed bitstream and saved it.

I went to Konsole, for example, and I noticed that the font didn’t change. Searching on the internet I found the fc-match command, to check the current monospace:

$~fc-match monospace
NotoSansMono-Regular.ttf: "Noto Sans Mono" "Regular"

Issuing fc-cache didn’t help either. I tried other monospaced font but the default won’t budge!

fc-match monospace | grep --line-number -e "Noto Sans Mono"         
1:NotoSansMono-Regular.ttf: "Noto Sans Mono" "Regular"

After searching a bit more I found this bug report in Kubuntu premises: https://bugs.launchpad.net/ubuntu/+source/kubuntu-settings/+bug/1872800

A very similar issue, but as the author in that bug I’m not a “font config expert”. I’d appreciate directions through these settings. I’d prefer not to meddle with .config/fontconfig/ directory if possible, I just want the system to respect the configuration in KDE Settings Panel, even though I can set the font for the application separately.

The only thing that I did until now was to remove the symbolic link of the noto-mono font, like so: rm /etc/fonts/conf.d/46-noto-mono.conf, but that’s it, and I think I shouldn’t done that either!

It sets its own font.

2 Likes

Ok, from my understanding there’s no standard for setting default fonts user or system wide.

With the help with this answer: https://unix.stackexchange.com/a/106170

I put:

<match target="pattern">
  <test name="family" qual="any">
    <string>monospace</string>
  </test>
  <edit binding="strong" mode="prepend" name="family">
    <string>MesloLGS Nerd Font</string> // Example
  </edit>
</match>

In ~/.config/fontconfig/fonts.conf. Now, if I change Konsole’s font to monospace it follows the setting from this file. Unfortunately it has to be done manually, and does not follow my System Settings’ choices.

An alternative is to install qt5ct and change it from there.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.