After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 786868 - The font of shell in zh_TW locale does not fall back to the same font as in GTK programs for Chinese characters
The font of shell in zh_TW locale does not fall back to the same font as in G...
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2017-08-27 17:33 UTC by pswo10680
Modified: 2017-09-04 13:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The default font for zh_TW locale in Fedora (485.73 KB, image/png)
2017-08-27 17:33 UTC, pswo10680
  Details
Droid Sans Fallback picked by GNOME Shell after Droid Sans Fonts installed (485.73 KB, image/png)
2017-08-27 17:34 UTC, pswo10680
  Details
Droid Sans Fallback picked by GNOME Shell after Droid Sans Fonts installed (484.61 KB, image/png)
2017-08-27 17:35 UTC, pswo10680
  Details
theme-node: Fix font family formatting (1.43 KB, patch)
2017-09-04 09:53 UTC, Jonas Ådahl
committed Details | Review

Description pswo10680 2017-08-27 17:33:23 UTC
Created attachment 358520 [details]
The default font for zh_TW locale in Fedora

The font of shell in zh_TW locale does not fallback to the same font as in GTK programs for Chinese characters


GNOME 3 uses Cantarell as the default font, and it will fallback to the font according to Fontconfig configurations when there are missing glyphs such as Chinese characters in zh_TW locale.

In fedora 25 and 26, the default font installed for traditional Chinese is Source Han Sans TW provided by adobe-source-han-sans-tw-fonts package. According to the Fontconfig configurations provided by adobe-source-han-sans-tw-fonts, it picks Source Han Sans TW for zh_TW locale as fallback fonts for every fonts.

However, after installing Google Droid Sans fonts provided by google-droid-sans-fonts, GNOME Shell picks Droid Sans Fallback font instead of Source Han Sans TW font for Chinese characters while GTK3 programs still follow the rules.


Reproducible: always

Reproduce steps:
1. create a fresh environment for zh_TW locale, such as a fresh installation
2. sudo dnf install google-droid-sans-fonts
3. GNOME Shell now uses Droid Sans Fallback font for Chinese characters instead of Source Han Sans TW which matched from Fontconfig configurations. However, GTK programs not affected.

Expected result:
GNOME Shell should pick Source Han Sans TW as what it should be even with Google Droid Sans fonts installed. It should respect the matching result of Fontconfig.
Comment 1 pswo10680 2017-08-27 17:34:09 UTC
Created attachment 358521 [details]
Droid Sans Fallback picked by GNOME Shell after Droid Sans Fonts installed
Comment 2 pswo10680 2017-08-27 17:35:02 UTC
Created attachment 358522 [details]
Droid Sans Fallback picked by GNOME Shell after Droid Sans Fonts installed
Comment 3 Jonas Ådahl 2017-09-04 09:53:36 UTC
Created attachment 359060 [details] [review]
theme-node: Fix font family formatting

Unlike pango_font_description_from_string(),
pango_font_description_set_family() requires a already properly
formatted font family string. The proper format is a comma seperated
list of font families, but we generated a "comma space" separated list.
Passing a incorrectly formatted font family string to pango seems to
cause wierd issues, where the wrong font is sometimes selected.

For example, this fixes a font selection issue on zh_TW.UTF-8 locale for
chinese characters, where previously the "Droid Sans" font was selected
instead of "Source Han Sans TW" even though fontconfig had placed
"Source Han Sans TW" before "Droid Sans".
Comment 4 Florian Müllner 2017-09-04 11:13:21 UTC
Review of attachment 359060 [details] [review]:

OK
Comment 5 Jonas Ådahl 2017-09-04 13:26:46 UTC
Attachment 359060 [details] pushed as 6fc5b04 - theme-node: Fix font family formatting