GNOME Bugzilla – 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
Last modified: 2017-09-04 13:26:50 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.
Created attachment 358521 [details] Droid Sans Fallback picked by GNOME Shell after Droid Sans Fonts installed
Created attachment 358522 [details] Droid Sans Fallback picked by GNOME Shell after Droid Sans Fonts installed
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".
Review of attachment 359060 [details] [review]: OK
Attachment 359060 [details] pushed as 6fc5b04 - theme-node: Fix font family formatting