Bug 333146 - Font Family is localized and hence not understood by GTK applications
Summary: Font Family is localized and hence not understood by GTK applications
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_style (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: HI grave
Target Milestone: ---
Assignee: Mikhail Zolotukhin
URL:
Keywords:
: 416993 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-04-07 08:08 UTC by Aleksey Kontsevich
Modified: 2020-03-16 19:24 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.18.4


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aleksey Kontsevich 2014-04-07 08:08:20 UTC
After installing 42" TV instead of monitor fonts become ugly and very small. do not know why because screen DPI set correctly. This was solved successfully for KDE applications in systemsettings. However setting font size for gtk applications has no effect - fonts still very small and hard to understand. Moreover kde-gtk-config does not save font size - always show Arial 12 to me on start.

Reproducible: Always




Exists at least in KDE 4.11 and 4.12
Comment 1 Aleksey Kontsevich 2014-04-07 08:37:10 UTC
It does not save settings because with Russian locale You write font name in Russian into ~/.gtkrc-2.0-kde4:
gtk-font-name="Arial Обычный 17"
instead of
gtk-font-name="Arial Regular 17"

However fonts still small in all menus, dialogs for gtk applications.
Comment 2 Aleksey Kontsevich 2014-04-07 08:39:28 UTC
P.S. or gtk-font-name="Arial Medium 17"
Comment 3 Vishnu 2017-06-20 06:29:19 UTC
I too am facing this issue on my 2K monitor. Everything else is fine because I can increase font sizes, but firefox looks very out of place with its tiny, unreadable fonts. Tweaking fonts inside firefox only helps with the content, not with firefox tabs or menus.
Comment 4 Aleksey Kontsevich 2017-06-20 11:08:52 UTC
Exactly!
Comment 5 Aleix Pol 2017-06-21 19:17:31 UTC
Aleksey, if you change the name of the font then it shows properly?

Vishnu, are you sure you're facing this same issue?
Comment 6 Vishnu 2017-06-22 16:32:07 UTC
(In reply to Aleix Pol from comment #5)
> 
> Vishnu, are you sure you're facing this same issue?

Hmmm.. Okay, upon giving it a second look, I realise that the problem I'm facing is slightly different. I have my gtk-config font set to: Noto Sans 12. The font sizes are fine, but everything else in firefox (Tabs, buttons, etc.) are too small on my 117 DPI, 25" screen.

The rest of KDE was also small, but that was fixed when I increads the font as well as ICON sizes. But there isn't a corresponding option in kde-gtk-config; If I increas the gtk font size beyond 12, my tabs are only able to display a couple of letters, and the firfox menus don't display properly.

So there has to be a way to make other GTK aspect increase in size too, like the ICON size setting in Settings > Icons > Advanced
Comment 7 Mikhail Zolotukhin 2020-02-12 22:14:20 UTC
*** Bug 416993 has been marked as a duplicate of this bug. ***
Comment 8 Lionel Chauvin 2020-02-15 22:52:03 UTC
On my system (Kubuntu 19.10, KDE 5.18.0) I configured the following font in kcm_font:
font: "Ubuntu Light"
style: "Regular"
size: "11"

It automatically adjusts the file ~/.gtkrc-2.0 with the line:
gtk-font-name="Ubuntu Light, Regular 11"
Gtk2 doesn't seems to understand this setting: in Gimp and Inkscape it is "Ubuntu Light, Bold 11" that is rendered.

It is properly rendered if I manually change the file and remove the comma:
gtk-font-name="Ubuntu Light Regular 11"

Unfortunally this change is lost when I restart my computer.
Comment 9 Mikhail Zolotukhin 2020-02-15 23:00:22 UTC
(In reply to Lionel Chauvin from comment #8)
> On my system (Kubuntu 19.10, KDE 5.18.0) I configured the following font in
> kcm_font:
> font: "Ubuntu Light"
> style: "Regular"
> size: "11"
> 
> It automatically adjusts the file ~/.gtkrc-2.0 with the line:
> gtk-font-name="Ubuntu Light, Regular 11"
> Gtk2 doesn't seems to understand this setting: in Gimp and Inkscape it is
> "Ubuntu Light, Bold 11" that is rendered.
> 
> It is properly rendered if I manually change the file and remove the comma:
> gtk-font-name="Ubuntu Light Regular 11"

If you remove "Regular" word in the comma variant, does it change something?
Comment 10 Lionel Chauvin 2020-02-15 23:20:51 UTC
Yes, it also work with:
gtk-font-name="Ubuntu Light 11"
Comment 11 Lionel Chauvin 2020-02-15 23:22:11 UTC
It doesn't work with:
gtk-font-name="Ubuntu Light, 11"
Comment 12 Mikhail Zolotukhin 2020-02-20 19:18:00 UTC
Current patch, that is being reviewed: https://phabricator.kde.org/D27380
Comment 13 Mikhail Zolotukhin 2020-03-16 19:24:33 UTC
Git commit a581035b3f4793d96e9b5d2cf6b55191cbb4be91 by Mikhail Zolotukhin.
Committed on 16/03/2020 at 19:23.
Pushed by gikari into branch 'Plasma/5.18'.

[GTK Config] Construct font style by hand instead of relying on Qt function

Summary:
It has been reported, that on localized systems
the font style was written in local language.
Therefore config line was incorrectly read by
GTK and therefore applications displayed bad
font. To avoid that this commit is introduced.
FIXED-IN: 5.18.4

Test Plan:

Reviewers: #plasma, ervin, bport, meven, davidedmundson, ngraham

Reviewed By: ervin, ngraham

Subscribers: chauvin, davidre, davidedmundson, cfeck, ngraham, IlyaBizyaev, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D27380

M  +64   -1    kded/configvalueprovider.cpp
M  +1    -0    kded/configvalueprovider.h

https://commits.kde.org/kde-gtk-config/a581035b3f4793d96e9b5d2cf6b55191cbb4be91