Bug 431649

Summary: Most KDE Applications Do Not Respect Fontconfig
Product: [Applications] systemsettings Reporter: Marek Paśnikowski <mail>
Component: kcm_fontsAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED NOT A BUG    
Severity: normal CC: ahiemstra, info, katyaberezyaka, kde, nate
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=431428
https://bugs.kde.org/show_bug.cgi?id=431197
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Presentation of Fontconfig Resistance
There is a difference on an Intel GPU.
fc-match output
Terminal Output of QML apps

Description Marek Paśnikowski 2021-01-15 17:55:05 UTC
Created attachment 134907 [details]
Presentation of Fontconfig Resistance

I have seen this problem for a couple of version now. Regardless of distribution or configuration, many of the KDE applications enforce their own fontconfig. In my previous, already discarded installation, even the system wide Fontconfig was ignored. The attached screenshot shows it all. The AA is in the disabled position, my GTK based browser, KWin and the Plasma Shell are properly aliased, but the Settings Manager is still smoothed.

My desire is to have no font antialiasing, because my eyes can't focus properly on the blurry curves.

The reproduction is as easy as unchecking the antialiasing button and applying the change.
Comment 1 Marek Paśnikowski 2021-01-18 12:36:38 UTC
I started to doubt if this bug is actually in Kirigami. Today I installed Libreoffice-QT and it also has this problem, but only in the menus and tooltips.
Comment 2 Nate Graham 2021-01-20 01:57:26 UTC
Can reproduce. In my case, turning off anti-aliasing doesn't seem to affect *anything*. Seems related to Bug 431428, but I don't understand how fontconfig files work well enough to triage any further.

I doubt this is related to Kirigami. It's more likely to be an issue with the way the distro's fontconfig interacts with the settings in the Fonts KCM. Moving there.
Comment 3 Marek Paśnikowski 2021-01-20 11:30:46 UTC
(In reply to Nate Graham from comment #2)
> I doubt this is related to Kirigami. It's more likely to be an issue with
> the way the distro's fontconfig interacts with the settings in the Fonts
> KCM. Moving there.

To test the interaction, I suggest to implement an option which clears the current KCM font configuration and keeps the options undeclared, which would let the inherited system configuration do its job. This would show in which direction the bug is hidden.

If the issue persists, it would indicate a problem with Fontconfig parsing or rendering by a library or a framework. If the issue disappears, it would indicate an actual KCM interaction problem.
Comment 4 Marek Paśnikowski 2021-01-25 10:46:35 UTC
Created attachment 135159 [details]
There is a difference on an Intel GPU.

When I deployed a new system to an old laptop, with Intel hardware platform, I discovered the bug is not as severe on that hardware. So far, it appears only in the Settings applications. The rest of the few applications that are installed there are properly rendering the text. 

It is a production computer, so I did not have a chance to test it yet. What tests could I do anyway?
Comment 5 Nate Graham 2021-02-04 15:51:24 UTC
Can people who are affected paste the output of `fc-match -v`?
Comment 6 Marek Paśnikowski 2021-02-04 15:53:33 UTC
Created attachment 135425 [details]
fc-match output
Comment 7 Nate Graham 2021-02-04 15:59:20 UTC
Thanks. Here's the important bit:

> antialias: False(w)
So it looks like our KCM is doing the right thing, but this setting isn't being respected for some reason. Based on your screenshot, it looks like QTWidgets-based apps and UI controls are respecting the setting, but System Settings--which uses QML--is not. Also based on that screenshot, it looks like your QML theming is not set up properly. The Fonts KCM doesn't look like how it's supposed to. Are you missing the QQC2 desktop theme package? Do you have the qt5ct package installed? Basically I wonder if you're missing a piece that reads that setting for QML software.
Comment 8 Marek Paśnikowski 2021-02-04 16:16:43 UTC
I am "dumb" user of NixOS. I had installed the KDE "service" which pulled in the Plasma Desktop. QT5CT was not installed. When running the program, it warns about QT_QPA_PLATFORMTHEME being not set.

The installation of this program did not change font rendering even after a reboot. I am not touching any of the settings in qt5ct because I do not know what I am doing with those changes.
Comment 9 Nate Graham 2021-02-04 16:18:38 UTC
Yeah, you *don't* want qt5ct to be installed. :)

How about the qqc2-desktop-theme package? Not sure what it would be called in nixos.
Comment 10 Marek Paśnikowski 2021-02-04 16:27:07 UTC
Declaration of kdeFrameworks.qqc2-desktop-style did not change anything, it seems it is already part of the dependency chain for KDE.
Comment 11 Nate Graham 2021-02-04 16:45:59 UTC
Hmm that's odd. Well *something* is causing your QML-based apps to have the wrong appearance. Those UI controls in the font KCM should look the same as the text fields, checkboxes, spinboxes in KDE apps. The appearance is visibly wrong in your screenshot.

Unfortunately I don't know enough about NixOS packaging to help further. Any chance you could ask for help in a distro-specific venue? I'm willing to bet that the font hinting will start working once your desktop QML theming is sorted out.
Comment 12 Marek Paśnikowski 2021-02-04 16:51:22 UTC
I have confirmed now, that there are actually two bugs related to Fontconfig. 

I used to have the following option be unset - meaning it was in the default state, "radeon".
https://search.nixos.org/options?channel=20.09&show=services.xserver.videoDrivers&from=0&size=50&sort=relevance&query=videoDrivers

I had tried "modesetting" first, it resulted in no change. But when I set it to "amdgpu", only the Settings application is broken. All the other applications like Konsole or Kmail render fonts correctly.

When you were writing about the theming, did you have the Settings application specifically in mind?
Comment 13 Nate Graham 2021-02-04 17:34:15 UTC
Yes, but it would affect other desktop apps with QML user interfaces, such as Discover, Elisa, or Plasma System Monitor, NeoChat. I would expect that you would see the same anti-aliases text and inappropriately-themed widgets in and all of those apps too. Can you confirm?
Comment 14 Marek Paśnikowski 2021-02-04 17:52:01 UTC
Created attachment 135428 [details]
Terminal Output of QML apps

Here is the terminal output of the Settings app and the Elisa app. There are some warnings which may or may not be relevant.

With regards to the theming, I have no clue what to do. Am I supposed to find a system package with the correct theme or something?
Comment 15 Nate Graham 2021-02-04 20:04:22 UTC
I don't know either; it's distro-specific. That's what I was recommending asking in a NixOS-specific venue. Hopefully the people there can help.
Comment 16 Marek Paśnikowski 2021-02-04 20:12:57 UTC
Thank you.

I will put it on a back burner for a while. There are other things that I need to get done. Maybe someone else will be able to provide better insight in the meantime. All I could do is some blind package installations in hopes of finding a missing link.
Comment 17 Bug Janitor Service 2021-02-19 04:33:11 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 18 info 2022-01-21 08:07:37 UTC
That is not a bug, i say.
The fontset is only if the kde used Application doesnt uses another font.
So its all like it should be.