Following patch (first try, naive, not upstreamable, ...) should workaround the problem, at least for fc-match. Could you please test?
M17N/fontconfig
In case that this is not enough: could you please tell me how is fontconfig used by *office?
Thanks
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++)
Following patch (first try, naive, not upstreamable, ...) should workaround the problem, at least for fc-match. Could you please test?
M17N/fontconfig
In case that this is not enough: could you please tell me how is fontconfig used by *office?
Thanks
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) ; ctAdd (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;
+ }
+
FcPatternObje
}
for (i = 0; i < pat->num; i++)