Bug 417948 - Plasma -> GTK font synchronization ignores font family variant.
Summary: Plasma -> GTK font synchronization ignores font family variant.
Status: RESOLVED UPSTREAM
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_style (show other bugs)
Version: 5.18.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL: https://gitlab.gnome.org/GNOME/gtk/is...
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-20 19:51 UTC by Elvis Pranskevichus
Modified: 2020-03-03 18:32 UTC (History)
3 users (show)

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


Attachments
Screenshot (39.21 KB, image/png)
2020-02-20 19:51 UTC, Elvis Pranskevichus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Elvis Pranskevichus 2020-02-20 19:51:31 UTC
Created attachment 126227 [details]
Screenshot

SUMMARY

Plasma -> GTK font synchronization ignores font family variant.

STEPS TO REPRODUCE
1. Set "General" font to a non-default font family variant, e.g. "Noto SemiCondensed"
2. Observe fonts in KDE apps vs GTK apps.

OBSERVED RESULT

GTK apps use the "regular" font variant instead of the selected "SemiCondensed".


EXPECTED RESULT

GTK apps observe the selected fonts exactly.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Gentoo Linux

KDE Plasma Version: 5.18.0
KDE Frameworks Version: 5.67.0
Qt Version: 5.13.2
Comment 1 Elvis Pranskevichus 2020-02-20 20:15:32 UTC
FWIW, adding this:

<fontconfig>
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Noto Sans SemiCondensed</family>
    </prefer>
  </alias>
</fontconfig>

to fonts.conf helps.
Comment 2 Nate Graham 2020-02-21 06:10:57 UTC
Is your system in English, or another language? If it's not English, you're probably running into Bug 333146.
Comment 3 Mikhail Zolotukhin 2020-02-21 06:43:10 UTC
What is your contents of ~/.config/gtk-3.0/settings.ini file?
Comment 4 Elvis Pranskevichus 2020-02-21 16:15:12 UTC
$ locale
LANG=en_CA.UTF-8
LC_CTYPE="en_CA.UTF-8"
LC_NUMERIC="en_CA.UTF-8"
LC_TIME="en_CA.UTF-8"
LC_COLLATE=C
LC_MONETARY="en_CA.UTF-8"
LC_MESSAGES="en_CA.UTF-8"
LC_PAPER="en_CA.UTF-8"
LC_NAME="en_CA.UTF-8"
LC_ADDRESS="en_CA.UTF-8"
LC_TELEPHONE="en_CA.UTF-8"
LC_MEASUREMENT="en_CA.UTF-8"
LC_IDENTIFICATION="en_CA.UTF-8"

$ cat .config/gtk-3.0/settings.ini
[Settings]
gtk-application-prefer-dark-theme=1
gtk-button-images=1
gtk-cursor-theme-name=Breeze_Snow
gtk-decoration-layout=icon:minimize,maximize,close
gtk-enable-animations=1
gtk-fallback-icon-theme=Adwaita
gtk-font-name=Noto Sans, SemiCondensed 11
gtk-icon-theme-name=breeze-dark
gtk-menu-images=1
gtk-primary-button-warps-slider=0
gtk-theme-name=Breeze-Dark
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
Comment 5 Mikhail Zolotukhin 2020-02-21 16:31:56 UTC
(In reply to Elvis Pranskevichus from comment #4)
> $ locale
> LANG=en_CA.UTF-8
> LC_CTYPE="en_CA.UTF-8"
> LC_NUMERIC="en_CA.UTF-8"
> LC_TIME="en_CA.UTF-8"
> LC_COLLATE=C
> LC_MONETARY="en_CA.UTF-8"
> LC_MESSAGES="en_CA.UTF-8"
> LC_PAPER="en_CA.UTF-8"
> LC_NAME="en_CA.UTF-8"
> LC_ADDRESS="en_CA.UTF-8"
> LC_TELEPHONE="en_CA.UTF-8"
> LC_MEASUREMENT="en_CA.UTF-8"
> LC_IDENTIFICATION="en_CA.UTF-8"
> 
> $ cat .config/gtk-3.0/settings.ini
> [Settings]
> gtk-application-prefer-dark-theme=1
> gtk-button-images=1
> gtk-cursor-theme-name=Breeze_Snow
> gtk-decoration-layout=icon:minimize,maximize,close
> gtk-enable-animations=1
> gtk-fallback-icon-theme=Adwaita
> gtk-font-name=Noto Sans, SemiCondensed 11
> gtk-icon-theme-name=breeze-dark
> gtk-menu-images=1
> gtk-primary-button-warps-slider=0
> gtk-theme-name=Breeze-Dark
> gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ

It seems like you selected Noto Sans font family and then selected SemiCondenced style from Fonts KCM. Do you have a font, that has "Noto Sans Semicondenced" as the whole family name?
Comment 6 Elvis Pranskevichus 2020-02-21 17:02:08 UTC
Yes, there seems to be both a SemiCondensed style, and a font family (which is why the fontconfig hack works, I think).
Comment 7 Mikhail Zolotukhin 2020-02-21 17:10:25 UTC
(In reply to Elvis Pranskevichus from comment #6)
> Yes, there seems to be both a SemiCondensed style, and a font family (which
> is why the fontconfig hack works, I think).

If you select the one, that has SemiCondensed style in family name, will the font match in GTK apps and KDE ones? It should look the same, as the font you've selected before (short family name and the style SemiCondenced).
Comment 8 Elvis Pranskevichus 2020-02-22 02:30:33 UTC
Selecting Noto Sans SemiCondensed family does not work either.  What DOES work, though, is removing all mentions of Noto Sans from fonts.conf (regardless of priority).  Given that the selected font is actually reflected properly in .config/gtk-3.0/settings.ini, I assume this is actually a GTK or fontconfig bug, so feel free to close this one.
Comment 9 Patrick Silva 2020-02-28 15:35:39 UTC
Same thing here. I  use Liberation Sans font, I changed the style of "General" font to italic in Fonts kcm.
Now Qt apps use italic fonts as expected but GTK apps use regular Liberation Sans fonts even after relogin.

Operating System: Arch Linux 
KDE Plasma Version: 5.18.2
KDE Frameworks Version: 5.67.0
Qt Version: 5.14.1
Comment 10 Nate Graham 2020-02-28 17:57:21 UTC
This is a known issue that has been traced to a GTK bug. Mikhail, can you add the bug to the URL field once it's been filed? Thanks!
Comment 11 Mikhail Zolotukhin 2020-02-28 20:21:31 UTC
Nice, this is an intentional GTK3 bug-feature

https://gitlab.gnome.org/GNOME/gtk/issues/2484#note_727715
Comment 12 Nate Graham 2020-03-01 02:31:29 UTC
Sigh. Maybe we should add an InlineMessage in the KCM that warns you that styled fonts won't show up in GTK apps. :(
Comment 13 Elvis Pranskevichus 2020-03-03 18:32:02 UTC
The upstream explanation does not explain why selecting a "Condensed" **font-family** doesn't work either until fontconfig rules for "sans-serif" are fiddled with.