Plasma and KDE apps ignore fontconfig's "embolden" property

Plasma and KDE/Qt apps seem to ignore the embolden property of fontconfig. I’m curious if this is by design, and if it can somehow be overridden.

Steps:

  1. Create a user fontconfig file:

mkdir -p ~/.config/fontconfig/conf.d && touch ~/.config/fontconfig/conf.d/99-local.conf

  1. Add this to the file:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
<fontconfig>
  <match target="font">
    <edit name="embolden" mode="assign">
        <bool>true</bool>
    </edit>
  </match>
</fontconfig>
  1. Run:

fc-cache -fv

  1. Log out and log back in, or reboot.

Fonts aren’t emboldened in Plasma or in any KDE/Qt apps (neither QWidget not QML/Kirigami). This happens with all TrueType/OpenType fonts I tested.


GTK3/4 apps (Firefox, LibreOffice with gtk3 vcl, Nautilus, etc) do have emboldened fonts:

I have the same problem. Moreover, I notice that some KDE applications (such as System Settings and Plasma Shell) do not follow the system’s sub-pixel rendering setting. I have set “sub-pixel rendering” to none in both System Settings and fontconfig (/etc/fonts/local.conf). However, while Plasma Shell and System Settings still seem to use RGB sub-pixel rendering, Konsole, Dolphin, Gwenview, and GTK applications (such as Firefox and GVim) use the correct grayscale anti-aliasing.

Additionally, I notice that CJK fonts (Source Han Sans) in Konsole, Dolphin, and Gwenview appear bolder than those in Plasma Shell, System Settings, and GTK applications.

1 Like

I have chalked it down to a different type of rendering in QML/Kirigami/QtQuick apps. They ignore many fontconfig/freetype2 settings if not all. The Settings app is kind of a mix of both Kirigami and Q Widget, so parts of it obey fontconfig rules and parts of it don’t.

My major problem with the thin crisp fonts is that I have astigmatism and they look really bad in the default dark theme (Breeze Dark). The fonts bleed and tire my eyes out. Things are much better in light mode.

I decided to ask ChatGPT about this, and it suggested using low contrast themes, which have been a revelation especially in dark mode. I hadn’t given low contrast much thought, given how high contrast is always sold as an accessibility metric. That’s totally valid for people with other types of vision problems, but low contrast works so much better for me.

Anyway, ChatGPT generated color schemes for “Solarized Light” and “Solarized Dark” modes, and I have been using custom themes created with these schemes.

I also stopped using embolden in fontconfig and went back to freetype “stem darkening”, which really only seems to work with CFF/.otf fonts and only in the “traditional” apps like Dolphin and Gwenview along with GTK apps, but that’s alright.

tl;dr - Different parts of KDE Plasma and apps seem to use slightly different font rendering tech. It’s not super cohesive like on GTK/GNOME.