Problem with default monospace font

Bug #1872800 reported by Kenneth Hanson
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
kubuntu-settings (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

In Kubuntu 20.04, fontconfig refuses to prefer Noto Mono, Hack, and other monospace fonts over Noto Sans Mono, Noto Sans Mono CJK, and other non-latin fonts.

I discovered the problem after uninstalling all Noto fonts except for Noto Sans CJK and Noto Serif CJK. I prefer to have only the Latin and CJK fonts, as I don't need any other languages. Non-Latin fonts are currently included in the same packages as the basic Latin fonts, so I use manually installed Noto Sans/Serif/Mono fonts, which do not include the non-Latin fonts. This worked fine in Kubuntu 19.10.

Now, fontconfig insists on using Noto Sans Mono CJK SC for the default monospace font. This is true even though I have Noto Mono set as my monospace font in the KDE font settings. It remains true even using the default settings, which use Hack for the monospace font. Because of this, applications like Firefox use an incorrect font.

If I install Noto Sans Mono, either manually or via the Ubuntu package, fontspec insists on using that font instead.

I determined that at least part of the problem comes from a font configuration file:
  kubuntu-settings-desktop: /etc/fonts/conf.avail/56-kubuntu-noto.conf

This file specifies Noto Sans Mono, Noto Sans Mono CJK, and a host of random non-Latin fonts, and even symbols and emoji, over normal fonts like DejaVu Sans Mono. Noto Mono and Hack are absent entirely.

`dpkg -S` informs me that the package for this file is `kubuntu-settings-desktop`, so I am reporting the bug here. My version is 20.04.9.

There seems to be an additional problem with KDE System Settings, since I would expect the fonts I specify there to take precedence over system defaults. But I don't understand fontconfig very well, so I will wait for someone who knows better to confirm.

Additional info:

Noto Mono and Hack are recognized by fontconfig.

$ fc-match -a "monospace" | grep --line-number -e "Noto Mono"
128:NotoMono-Regular.ttf: "Noto Mono" "Regular"

$ fc-match -a "monospace" | grep --line-number -e "Hack"
44:Hack-Regular.ttf: "Hack" "Regular"

I already purged my home directory of any `fonts.conf` files and anything related to fontconfig except for my manually installed font files.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in kubuntu-settings (Ubuntu):
status: New → Confirmed
Revision history for this message
Matteo Italia (matteo-mitalia) wrote :

Related to https://bugs.launchpad.net/ubuntu/+source/kubuntu-settings/+bug/1872492; that 56-kubuntu-noto.conf that is installed stealthily by kubuntu-settings-desktop overrides way too much system-wide stuff, and should just NOT be included.

Revision history for this message
Kenneth Hanson (khanson679) wrote :

Thanks, Matteo. I started to look into this again, and it appears that nothing has changed. I will try removing the symlink in `/etc/fonts/conf.d` as a workaround. It's not even clear what the purpose is for setting all these "preferred" fonts. As long as aliases and default fonts are set correctly, everything should work fine.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.