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
This commit is contained in:
Akira TAGOH 2015-02-09 16:45:43 +09:00
parent 724664e3fd
commit f18f2f88f2
1 changed files with 9 additions and 0 deletions

View File

@ -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)
{