You are not logged in.

#1 2024-05-17 21:25:05

BudgieUser
Member
Registered: 2022-11-13
Posts: 8

[Solved] KDE apps have blurry bold text on GNOME

I installed Arch via archinstall (Profile: Desktop / Gnome) in a clean Virtual Box to reproduce this issue. No tweaking / icon theming / environment variables setting etc. was done besides from what was applied automatically by archinstall (only noto-fonts was installed as a fallback, but no font changing by hand was done).

Now the problem: When I use KDE Apps, text in the bold variant is rendered in a blurry and hard to read way, the letters appear too "fat". Regular, un-bolded "standard" text on the other hand is perfectly readable. This only seems to happen on QT apps, i didn't see this on GTK apps and I think also never on Electron apps.

I'm using https://apps.kde.org/kasts/ here as a demonstration: https://i.postimg.cc/FHhp7rsx/kasts-flatpak-wayland.png

This is regardless of whether I'm using X11 or Wayland, and also regardless of whether I run the Flatpak or native packages from the Arch Repo. The only difference seems to be (un)blurred text in the window titlebar. Text in the window itself still is blurred each and every time.

The screenshot above is from the Flatpak version on Wayland.
Here are the other 3 combinations, which have the same issue:

Flatpak + X11: https://i.postimg.cc/NfBmxNqs/kasts-flatpak-x11.png
Native + Wayland: https://i.postimg.cc/CMHfdjZW/kasts-native-wayland.png
Native + X11:  https://i.postimg.cc/jdMw4t4c/kasts-native-x11.png

This is happing also in other KDE apps and quite noticeable when a UI has a lot of bold text, for example in KWeather:
https://i.postimg.cc/fyJn4c1J/kweather- … ayland.png
https://i.postimg.cc/qqSfptdQ/kweather-flatpak-x11.png

I believe this is not intended, since on a fresh Fedora Silverblue 40 install even the bold fonts are looking perfectly fine, without me changing or installing anything. Here is how it is supposed to look like:
https://i.postimg.cc/FHmvzLLn/silverblu … ak-x11.png
https://i.postimg.cc/c6yDDfWq/Screensho … -58-59.png

Side by side comparison (Arch (left) vs Fedora (right)) should make it cleaner:
FluxBB bbcode test

And also on Phosh on PostmarketOS it is rendered correctly:
https://i.postimg.cc/HkP6RGd4/20240517- … s-grim.png

In the past, I've been using cantarell-static-fonts from the AUR, which is the only solution I found for this problem. However, it's not possible to build this package right now and Gnome is planning to switch from Cantarell to Inter anyway, so this workaround is not going to work anymore soon. (The whole problem also remains, when I set my system to Inter with

gsettings set org.gnome.desktop.interface font-name 'Inter Variable 11'

after installing inter-font, so I assume this problem will not go away after the switch).

I also noticed the bold text turns sharp when i set

gsettings set org.gnome.desktop.interface text-scaling-factor 3

, but i can't use that since everything then turns comically big.

Does anyone know what Fedora / pmOS do "out of the box" to render these bold QT fonts in a more appealing way?

Last edited by BudgieUser (2024-05-19 19:22:16)

Offline

#2 2024-05-18 06:42:28

seth
Member
Registered: 2012-09-03
Posts: 60,210

Re: [Solved] KDE apps have blurry bold text on GNOME

https://wiki.archlinux.org/title/Font_c … #Hintstyle and https://wiki.archlinux.org/title/Font_c … LCD_filter should have considerable input on this.

I also noticed the bold text turns sharp when i set

Do you currently use some fractional scaling (1.5 or sth. like that)?

Regular, un-bolded "standard" text on the other hand is perfectly readable.

"Perfectly readable" or "exactly the same as on fedora"?

Gnome is planning to switch from Cantarell to Inter anyway, so this workaround is not going to work anymore

Just for the records, you know that you dont *have* to use whatever font somebody else prefers?

Offline

#3 2024-05-19 19:14:30

BudgieUser
Member
Registered: 2022-11-13
Posts: 8

Re: [Solved] KDE apps have blurry bold text on GNOME

No, I don't use fractional scaling, never touched the experimental settings scale-monitor-framebuffer nor x11-randr-fractional-scaling.


I tried the four presets for LCD filter. Created a symbolic link in /etc/fonts/conf.d, rebooted and verified the filters are applied with

fc-match --verbose Sans | grep lcdfilter

Output is

x (i)(w)

, where x is a number in the range from 0-3.

I'm afraid this isn't helping me. Especially with the None filter, everything looks thinned out. I need something to change only the bold text, not the rest.

I also tried the 4 hinting styles and 3 antialiasing styles in gnome tweak, text definitely changes in the shell but not inside KDE apps, or at least I'm not seeing any difference. Might it be because of that: https://wiki.archlinux.org/title/Font_c … ng_hinting ?

Some applications or desktop environments may override default fontconfig hinting and anti-aliasing settings. This may happen with GNOME 3, for example while you are using Qt applications like vlc or smplayer.

Indeed, smplayer and vlc have exactly the same problem: crisy standard text, bad looking bold text.

Offline

#4 2024-05-19 19:20:10

BudgieUser
Member
Registered: 2022-11-13
Posts: 8

Re: [Solved] KDE apps have blurry bold text on GNOME

Weird, I can make bold text in VLC crispy by setting the env variable QT_QPA_PLATFORMTHEME=qt5ct … Text gets overall bigger as a result, but that does't bother me.

I will mark this thread as solved because I found 2 ways of dealing with my issue:

1) Setting QT_QPA_PLATFORMTHEME to qt5ct / qt6ct
2) Changing the system / shell font to Noto Sans, KDEs default font

Still curious what Fedora does under the hood so that they don't have this issue… these workarounds are not necessary there. env var QT_QPA_PLATFORMTHEME at least is not set, I checked.

Offline

#5 2024-05-19 22:56:45

seth
Member
Registered: 2012-09-03
Posts: 60,210

Re: [Solved] KDE apps have blurry bold text on GNOME

You're otherwise using the gnome platform theme.

Changing the system / shell font to Noto Sans, KDEs default font

This sounds interesting: did changing the platformtheme to qt*ct not just achieve the same?
How much did the text overall get bigger?

Cantarell-VF-bold renders very black here (qt6ct), but not "blurry" and distrinct from the extrabold variant.
I'd re-suspect scaling, but not if eg. cantarell-static would not cause this. Plus your screenshot does look a bit like the difference between bold and extrabold.

Qt internally uses a different weighting metric than css, I wonder whether because of rounding issues bold gets resolved to extra-bold.
If you've trouble picking the font variants, "qarma --font-selection" - https://aur.archlinux.org/packages/qarma-git

Offline

#6 2024-05-20 06:08:03

BudgieUser
Member
Registered: 2022-11-13
Posts: 8

Re: [Solved] KDE apps have blurry bold text on GNOME

Setting the whole system interface text to Noto Sans 12 produces the same window as if running picard with set QT_QPA_PLATFORMTHEME=qt5ct on default font Cantarell 11 -  Only 1) the text size of the titlebar differs and 2) you have an additional icon in the button.

Cantarell 11 with qtct5, crisp https://i.postimg.cc/qRb2747j/Cantarell11-qt5ct.png
Noto Sans 12, crisp https://i.postimg.cc/sfLpdjq2/Noto-Sans12.png

And for comparison:

Cantarell 11, no qtct5, blurred https://i.postimg.cc/k4Xx9B72/Cantarell11.png
Cantarell 12, no qtct5, blurred https://i.postimg.cc/fyVmtptZ/Cantarell12.png
Noto Sans 11, crisp https://i.postimg.cc/MHgRy5VB/Noto-Sans11.png

Hope the difference between blurred and crisp bolded text becomes "clear", so to speak, especially between the last two screenshots to show how "washed out" it is.


Comparing the bolded text from the window in the screenshots above with the different styling options in qarma: To my eye it's definitely ExtraBold, not Regular Bold.

Bold
ExtraBold

There's also another weird thing. Sometimes bold text can both bolded and crisp, in the same app.

https://i.postimg.cc/GmgBYqRm/Screensho … -30-40.png

Subscriptions on the left is blurred but not "No podcasts added yet" on the right.

Almost like it automatically gets blurred if it falls under a certain font size threshold. At least if you don't do any trickery with qt5ct or changing the whole system font. If I set the shell font to something small such as Noto Sans 8 - the bold text is tiny, but appears to be crisp!

Offline

#7 2024-05-20 08:13:24

seth
Member
Registered: 2012-09-03
Posts: 60,210

Re: [Solved] KDE apps have blurry bold text on GNOME

https://i.postimg.cc/qRb2747j/Cantarell11-qt5ct.png and https://i.postimg.cc/sfLpdjq2/Noto-Sans12.png are both Noto (look eg. at the shape of the "l", the bottom hook) so qt*ct basically just leaves you w/ a different font and the critical factor is cantarell.

The thing in "qarma" is actually a gtk dialog because of some environment variable ("QT_QPA_PLATFORMTHEME" or "XDG_CURRENT_DESKTOP" or so) that makes Qt go "gnome mode" - cantarell in https://i.postimg.cc/fyVmtptZ/Cantarell12.png looks exactly the same rendered in Qt proper here. I'll have to render it in some gtk client, but there's nothing odd - it's just the font.

nb. that my foreground color is #333 and not #000
scrot-1716192403.png

Edit: gtk3 renders the bold variant lighter:
https://i.postimg.cc/FFjyMVjp/scrot-1716192946.png

Edit: even on lcdlegacy, autohint and hintfull the particular font doesn't really thin out in Qt rasterization.
This could be an outfall of https://gitlab.gnome.org/GNOME/pango/-/issues/404 and the different hinting approaches of freetype and harfbuzz - but it would be weird that the static fonts then render differently (and equivalent?) with the static cantarell fonts.

Last edited by seth (2024-05-20 08:39:42)

Offline

#8 2024-05-23 01:43:49

BudgieUser
Member
Registered: 2022-11-13
Posts: 8

Re: [Solved] KDE apps have blurry bold text on GNOME

Since cantarell-static-fonts can be build now again from the AUR, it is possible to add another comparison with the default cantarell-fonts. Both windows look identical, except from the bold text which is rendered differently.

cantarell-fonts (blurred): https://postimage.me/images/2024/05/23/ … -fonts.png
cantarell-static-fonts (crisp): https://postimage.me/images/2024/05/23/ … -fonts.png

Offline

#9 2024-05-23 07:10:28

seth
Member
Registered: 2012-09-03
Posts: 60,210

Re: [Solved] KDE apps have blurry bold text on GNOME

https://gitlab.gnome.org/GNOME/cantarel … /issues/41

fc-match -v "cantarell:bold"

clearly picks the right font, though.

  <match target="font">
    <edit name="embeddedbitmap" mode="assign"><bool>false</bool></edit>
    <edit name="embolden" mode="assign"><bool>false</bool></edit>
  </match>

has no impact on the situation either and "Extra Bold" looks different from "Bold"

What does

fc-match -v "cantarell:bold"

print for cantarell-static?

Offline

#10 2024-05-23 15:39:27

BudgieUser
Member
Registered: 2022-11-13
Posts: 8

Re: [Solved] KDE apps have blurry bold text on GNOME

seth wrote:

What does

fc-match -v "cantarell:bold"

print for cantarell-static?

https://pastebin.com/raw/j7XUWWCX

The following lines are different compared to cantarell-fonts:

file: "/usr/share/fonts/cantarell/Cantarell-Bold.otf"(s)
index: 0(i)(w)
…
postscriptname: "Cantarell-Bold"(s)
namedinstance: False(s)

vs.

file: "/usr/share/fonts/cantarell/Cantarell-VF.otf"(s)
index: 262144(i)(w)
…
postscriptname: "Cantarell_700wght"(s)
namedinstance: True(s)

After deleting /usr/share/fonts/cantarell/Cantarell-VF.otf: https://i.postimg.cc/DyTS3xVG/Screensho … -38-17.png

Offline

Board footer

Powered by FluxBB