Bug 416993 - GTK applications do not accept a font with localized style name
Summary: GTK applications do not accept a font with localized style name
Status: RESOLVED DUPLICATE of bug 333146
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_style (show other bugs)
Version: 5.17.90
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-31 19:14 UTC by Ilya Bizyaev
Modified: 2020-02-12 22:14 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Weird GTK previewers behavior (1.20 MB, video/mp4)
2020-02-01 17:49 UTC, Ilya Bizyaev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Bizyaev 2020-01-31 19:14:12 UTC
SUMMARY
Likely a wrong component, but GTK apps now use a font different from what was configured in System Settings before the upgrade.

STEPS TO REPRODUCE
1. Configure a custom font for GTK apps
2. Upgrade to 5.17.90
3. Open an app that respects GTK configuration (Firefox, Inkscape)

OBSERVED RESULT
A different font is used

EXPECTED RESULT
Users' font configurations are preserved

SOFTWARE/OS VERSIONS
Operating System: openSUSE Leap 15.1
KDE Plasma Version: 5.17.90
KDE Frameworks Version: 5.66.0
Qt Version: 5.14.1
Kernel Version: 5.5.0-1.g3f183bf-default
OS Type: 64-bit

ADDITIONAL INFORMATION
In ~/.gtkrc-2.0 and ~/.config/gtk-3.0/settings.ini, I see a suspicious line:
gtk-font-name="Some Font Обычный 13"
where "Обычный" is "Regular" in Russian. There is likely some undesired i18n going on, though changing the font in those config files seems to have no effect. Still, gtk-query-settings reports gtk-font-name: "Some Font \320\236\320\261\321\213\321\207\320\275\321\213\320\271 13", so that's the most likely reason IMO.
Comment 1 Nate Graham 2020-01-31 19:27:37 UTC
In 5,18, GTK apps should be using the same font that you've got configured in the fonts KCM. Is this what you're seeing, or are they using some random different font?
Comment 2 Mikhail Zolotukhin 2020-01-31 19:57:21 UTC
> gtk-font-name="Some Font Обычный 13"
In the newest kde-gtk-config from 5.18 branch there should be comma after "Some font". If you add comma after "Some Font", would the font in GTK apps become the one, that is expected?
Comment 3 Ilya Bizyaev 2020-02-01 17:47:40 UTC
(In reply to Nate Graham from comment #1)
> In 5,18, GTK apps should be using the same font that you've got configured
> in the fonts KCM. Is this what you're seeing, or are they using some random
> different font?

They are using a random different font.

(In reply to Mikhail Zolotukhin from comment #2)
> > gtk-font-name="Some Font Обычный 13"
> In the newest kde-gtk-config from 5.18 branch there should be comma after
> "Some font". If you add comma after "Some Font", would the font in GTK apps
> become the one, that is expected?
No, and I thought that I am doing something wrong because editing both ~/.gtkrc-2.0 and ~/.config/gtk-3.0/settings.ini did not affect the font that I saw in `gtk-query-settings | grep font` and apps. But then I tried using GTK theme previewers in System Settings, and they are able to detect the correct font... in a weird way.
The font used by the GTK3 previewer depends on whether on not the GTK2 previewer has been used since the last GTK app launch. Plus, all this seems to affect fonts used in the KCM itself... (I attach the recording)

All this is pretty weird to me, but I hope this helps.
Comment 4 Ilya Bizyaev 2020-02-01 17:49:07 UTC
Created attachment 125598 [details]
Weird GTK previewers behavior
Comment 5 Mikhail Zolotukhin 2020-02-01 17:52:31 UTC
Do you have xsettingsd installed?
Comment 6 Ilya Bizyaev 2020-02-02 16:39:56 UTC
(In reply to Mikhail Zolotukhin from comment #5)
> Do you have xsettingsd installed?

Yes, I do
Comment 7 Iyán Méndez Veiga 2020-02-12 16:06:58 UTC
I confirm this issue after upgrading to Plasma 5.18.0 using Arch Linux. Firefox fonts doesn't look correct (as before), but rather like anti-aliasing is disabled (or maybe just different font). Content is not affected, only menus and interface.

Any additional info I can provide?
Comment 8 A. Wilcox (awilfox) 2020-02-12 16:19:14 UTC
On my system still running 5.12 (not yet updated to 5.18), I'm seeing the following lines at the top of gtkrc-2.0 that I do not see on my 5.18 system:

include "/usr/share/themes/Breeze/gtk-2.0/gtkrc"
style "user-font"
{
   font_name="Liberation Sans Regular"
}
widget_class "*" style "user-font"
Comment 9 Mikhail Zolotukhin 2020-02-12 16:31:34 UTC
(In reply to A. Wilcox (awilfox) from comment #8)
> On my system still running 5.12 (not yet updated to 5.18), I'm seeing the
> following lines at the top of gtkrc-2.0 that I do not see on my 5.18 system:
> 
> include "/usr/share/themes/Breeze/gtk-2.0/gtkrc"
> style "user-font"
> {
>    font_name="Liberation Sans Regular"
> }
> widget_class "*" style "user-font"

This is unrelated. This bug happens, because gtk configuration files cannot read localized name of font style. The only solution I can provide on our side is to ignore selected style (Bold, Italic, Medium, Semibold, Condenced etc) for the font, that is selected under "Font Style" category in Font Selection dialog. This does not mean, that you cannot select the font with a given style, because there are fonts, that have these styles as part of the Family name.
Comment 10 Nate Graham 2020-02-12 20:24:30 UTC
Please file a separate bug here (i.e. "systemsettings | kcm_style") for the Incorrect Firefox font issue. Thanks!
Comment 11 Mikhail Zolotukhin 2020-02-12 22:14:20 UTC

*** This bug has been marked as a duplicate of bug 333146 ***