From f18f2f88f287a2438d2bf9b27773cb14606cbb11 Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Mon, 9 Feb 2015 16:45:43 +0900 Subject: [PATCH] Don't add FC_LANG when it has "und" to avoid the situation to find the better fallback font. https://code.google.com/p/chromium/issues/detail?id=392724 has more words to explain the details. https://bugs.freedesktop.org/show_bug.cgi?id=81185 --- src/fccfg.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/fccfg.c b/src/fccfg.c index e2f7ea8..b92270b 100644 --- a/src/fccfg.c +++ b/src/fccfg.c @@ -1546,7 +1546,9 @@ FcConfigSubstituteWithPat (FcConfig *config, FcStrList *l = FcStrListCreate (strs); FcChar8 *lang; FcValue v; + FcLangSet *lsund = FcLangSetCreate (); + FcLangSetAdd (lsund, (const FcChar8 *)"und"); FcStrSetDestroy (strs); while (l && (lang = FcStrListNext (l))) { @@ -1570,10 +1572,16 @@ FcConfigSubstituteWithPat (FcConfig *config, FcLangSetDestroy (ls); if (b) goto bail_lang; + if (FcLangSetContains (vv.u.l, lsund)) + goto bail_lang; } else + { if (FcStrCmpIgnoreCase (vv.u.s, lang) == 0) goto bail_lang; + if (FcStrCmpIgnoreCase (vv.u.s, (const FcChar8 *)"und") == 0) + goto bail_lang; + } } } v.type = FcTypeString; @@ -1583,6 +1591,7 @@ FcConfigSubstituteWithPat (FcConfig *config, } bail_lang: FcStrListDone (l); + FcLangSetDestroy (lsund); } if (FcPatternObjectGet (p, FC_PRGNAME_OBJECT, 0, &v) == FcResultNoMatch) {