[Fontconfig] fontconfig: Branch 'master'

Akira TAGOH tagoh at kemper.freedesktop.org
Sun Mar 1 18:36:17 PST 2015


 src/fccfg.c |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit f18f2f88f287a2438d2bf9b27773cb14606cbb11
Author: Akira TAGOH <akira at tagoh.org>
Date:   Mon Feb 9 16:45:43 2015 +0900

    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

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


More information about the Fontconfig mailing list