This is my first try to workaround the problem for fc-match at least. Not sure if it resolves original problem. I don't see inside fontconfig structures far enough to find real solution -- let's wait for upstream.
Could you try and let me know?
Index: fontconfig-2.8.0/src/fcmatch.c
===================================================================
--- fontconfig-2.8.0.orig/src/fcmatch.c
+++ fontconfig-2.8.0/src/fcmatch.c
@@ -413,6 +413,40 @@ FcFontRenderPrepare (FcConfig *confi
}
else
v = FcValueCanonicalize(&FcPatternEltValues (fe)->value);
+
+ /* This is workaround only!! */
+ if (fe->object == FC_STYLE_OBJECT)
+ {
+ FcPatternElt *le, *sle;
+ FcValue lang, stlang;
+ FcValueList *stlangs, *sts;
+ int l;
+
+ if ((le = FcPatternObjectFindElt(pat, FC_LANG_OBJECT)))
+ lang = FcValueCanonicalize(&FcPatternEltValues(le)->value);
+ else
+ { /* I think it is not needed. */
+ lang.type = FcTypeString;
+ lang.u.s = (const FcChar8 *)"en";
+ }
+ sle = FcPatternObjectFindElt(font, FC_STYLELANG_OBJECT);
+ stlangs = FcPatternEltValues(sle);
+ sts = FcPatternEltValues(fe);
+ l = 0;
+
+ do
+ {
+ stlang = FcValueCanonicalize(&stlangs->value);
+ if (FcLangCompare(stlang.u.s, lang.u.s) < FcLangDifferentLang)
+ break;
+ sts = FcValueListNext(sts);
+ l++;
+ } while ((stlangs = FcValueListNext(stlangs)));
+
+ lang = FcValueCanonicalize(&sts->value);
+ v.u.s = lang.u.s;
+ }
+
FcPatternObjectAdd (new, fe->object, v, FcFalse);
}
for (i = 0; i < pat->num; i++)
This is my first try to workaround the problem for fc-match at least. Not sure if it resolves original problem. I don't see inside fontconfig structures far enough to find real solution -- let's wait for upstream.
Could you try and let me know?
Index: fontconfig- 2.8.0/src/ fcmatch. c ======= ======= ======= ======= ======= ======= ======= ======= ==== 2.8.0.orig/ src/fcmatch. c 2.8.0/src/ fcmatch. c lize(&FcPattern EltValues (fe)->value); FindElt( pat, FC_LANG_OBJECT))) lize(&FcPattern EltValues( le)->value) ; FindElt( font, FC_STYLELANG_ OBJECT) ; ues(sle) ; ues(fe) ; lize(&stlangs- >value) ; stlang. u.s, lang.u.s) < FcLangDifferent Lang) (sts); (stlangs) )); lize(&sts- >value) ; bjectAdd (new, fe->object, v, FcFalse);
=======
--- fontconfig-
+++ fontconfig-
@@ -413,6 +413,40 @@ FcFontRenderPrepare (FcConfig *confi
}
else
v = FcValueCanonica
+
+ /* This is workaround only!! */
+ if (fe->object == FC_STYLE_OBJECT)
+ {
+ FcPatternElt *le, *sle;
+ FcValue lang, stlang;
+ FcValueList *stlangs, *sts;
+ int l;
+
+ if ((le = FcPatternObject
+ lang = FcValueCanonica
+ else
+ { /* I think it is not needed. */
+ lang.type = FcTypeString;
+ lang.u.s = (const FcChar8 *)"en";
+ }
+ sle = FcPatternObject
+ stlangs = FcPatternEltVal
+ sts = FcPatternEltVal
+ l = 0;
+
+ do
+ {
+ stlang = FcValueCanonica
+ if (FcLangCompare(
+ break;
+ sts = FcValueListNext
+ l++;
+ } while ((stlangs = FcValueListNext
+
+ lang = FcValueCanonica
+ v.u.s = lang.u.s;
+ }
+
FcPatternO
}
for (i = 0; i < pat->num; i++)