fcdefault: Add the lang object at FcConfigSubstituteWithPat() only when kind is FcMatchPattern
This commit is contained in:
parent
07e52eeb09
commit
f4103bf708
33
src/fccfg.c
33
src/fccfg.c
|
@ -1419,6 +1419,22 @@ FcConfigSubstituteWithPat (FcConfig *config,
|
|||
switch (kind) {
|
||||
case FcMatchPattern:
|
||||
s = config->substPattern;
|
||||
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);
|
||||
}
|
||||
break;
|
||||
case FcMatchFont:
|
||||
s = config->substFont;
|
||||
|
@ -1435,23 +1451,6 @@ 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 ");
|
||||
|
|
Loading…
Reference in New Issue