From 550fd49d4fb8efab33d1fa1687b1b9bd352202fe Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Tue, 22 May 2012 14:17:10 +0900 Subject: [PATCH] Add the default language to the pattern prior to do build the substitution the default language is referred from the FC_LANG environment variable or the current locale --- src/fccfg.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/fccfg.c b/src/fccfg.c index b45d74a..c3d95e8 100644 --- a/src/fccfg.c +++ b/src/fccfg.c @@ -1407,6 +1407,7 @@ FcConfigSubstituteWithPat (FcConfig *config, FcEdit *e; FcValueList *l; FcPattern *m; + FcStrSet *strs; if (!config) { @@ -1434,6 +1435,23 @@ FcConfigSubstituteWithPat (FcConfig *config, return FcFalse; FcMemAlloc (FC_MEM_SUBSTATE, config->maxObjects * sizeof (FcSubState)); + strs = FcGetDefaultLangs (); + if (strs) + { + FcStrList *l = FcStrListCreate (strs); + FcChar8 *lang; + FcValue v; + + FcStrSetDestroy (strs); + while (l && (lang = FcStrListNext (l))) + { + v.type = FcTypeString; + v.u.s = lang; + FcPatternObjectAddWithBinding (p, FC_LANG_OBJECT, v, FcValueBindingWeak, FcTrue); + } + FcStrListDone (l); + } + if (FcDebug () & FC_DBG_EDIT) { printf ("FcConfigSubstitute ");