Bug 422586 - KDE resets GTK font setting to non-condensed font
Summary: KDE resets GTK font setting to non-condensed font
Status: REOPENED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_style (show other bugs)
Version: 5.18.5
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL: https://gitlab.gnome.org/GNOME/gtk/-/...
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-07 15:48 UTC by Yann Salmon
Modified: 2020-06-16 12:43 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot of dconf-editor (237.62 KB, image/png)
2020-06-13 07:03 UTC, Yann Salmon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yann Salmon 2020-06-07 15:48:48 UTC
SUMMARY


STEPS TO REPRODUCE
1. Set KDE default font to Noto Sans Condensed.
2. See that this does not apply to GTK2 nor GTK3 apps.
3. Tweak various GTK config files to set Noto Sans Condensed as the default font well.
4. Log out and back in.

OBSERVED RESULT
GTK config files are reset to "Noto Sans", nont condensed.

EXPECTED RESULT
GTK config files are either left untouched or correctly synchronised.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8

ADDITIONAL INFORMATION
For GTK2 apps, using gtk-chtheme and gtk-theme-switch2 works, but I had to go back to KDE settings GUI after using these tools and reapply the theme to overcome some residual glitches.

The big problem was with GTK3 apps.

Not sure which GTK3 config files actually need to be set. I did :

    update ~/.config/xsettingsd/xsettingsd.conf with Gtk/FontName "Noto Sans Condensed,  11"
    update ~/.config/gtk-3.0/settings.ini with gtk-font-name=Noto Sans Condensed,  11
    in dconf, under org.gnome.desktop.interface, set font-name to 'Noto Sans Condensed,  11'.

These files and dconf settings are reset to "Noto Sans, 11" at login.

KDE refers to the font as "Noto Sans" with the "Condensed" attribute while in GTK one needs to have "Noto Sans Condensed" as the font name ; maybe the setting transfer is buggy. Or maybe this has nothing to do with my wished font being Condensed.

Anyway, I had to disable the Plasma GTKd background service to make my GTK font setting stay.
Comment 1 Nate Graham 2020-06-13 03:04:51 UTC
Unfortunately GTK3 does not support font styles (e.g. "condensed") for user interface fonts. :( See https://gitlab.gnome.org/GNOME/gtk/-/issues/2484#note_727715
Comment 2 Yann Salmon 2020-06-13 07:03:24 UTC
Created attachment 129292 [details]
Screenshot of dconf-editor

Thanks for the pointer. For future reader, although it seems they should not, the steps I described above do make it possible to use a condensed font in GTK3 apps in KDE (see dconf-editor as an example).
Comment 3 Nate Graham 2020-06-16 05:23:13 UTC
orly...

Seems like there is a hidden method in dconf to do this. Mikhail, would it be feasible to use that here?
Comment 4 Mikhail Zolotukhin 2020-06-16 12:43:08 UTC
What "hidden dconf method" are you talking about?