aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src/fcmatch.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-07-28 21:19:00 +0200
committermarha <marha@users.sourceforge.net>2014-07-28 21:19:00 +0200
commitb33b8d8ae86876b50df96881b96074b3fe177cce (patch)
treebcdfa896ef05643b7edc1cd06518cbb7fed72c72 /fontconfig/src/fcmatch.c
parentd0c30e7945e76ac119f6d867e27137c8a76f7e15 (diff)
downloadvcxsrv-b33b8d8ae86876b50df96881b96074b3fe177cce.tar.gz
vcxsrv-b33b8d8ae86876b50df96881b96074b3fe177cce.tar.bz2
vcxsrv-b33b8d8ae86876b50df96881b96074b3fe177cce.zip
plink fontconfig libX11 libXext xserver xkeyboard-config mesa git update 28 July 2014
xserver commit 4afedf545b673282f2e214c0e2c759c9be9b9a2a xkeyboard-config commit 9010f6c0745f472b670c22340b5bbd36e33ce37e libX11 commit 0885cad1e4a9ed57266582be320be55259c881bf libXext commit efdcbb7634501e1117d422636a0a75d7ea84b16b fontconfig commit a9e7b0494e04b3925d1bccc140ff2500cfff9618 mesa commit cc1e1da24a6c535617d9fb38858d48d8c2999e68 plink revision 10211
Diffstat (limited to 'fontconfig/src/fcmatch.c')
-rw-r--r--fontconfig/src/fcmatch.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/fontconfig/src/fcmatch.c b/fontconfig/src/fcmatch.c
index 78255186f..b0e695df3 100644
--- a/fontconfig/src/fcmatch.c
+++ b/fontconfig/src/fcmatch.c
@@ -483,7 +483,7 @@ FcFontRenderPrepare (FcConfig *config,
{
FcPattern *new;
int i;
- FcPatternElt *fe, *pe, *fel, *pel;
+ FcPatternElt *fe, *pe;
FcValue v;
FcResult result;
@@ -508,36 +508,25 @@ FcFontRenderPrepare (FcConfig *config,
fe->object == FC_STYLE_OBJECT ||
fe->object == FC_FULLNAME_OBJECT)
{
+ FcPatternElt *fel, *pel;
+
FC_ASSERT_STATIC ((FC_FAMILY_OBJECT + 1) == FC_FAMILYLANG_OBJECT);
FC_ASSERT_STATIC ((FC_STYLE_OBJECT + 1) == FC_STYLELANG_OBJECT);
FC_ASSERT_STATIC ((FC_FULLNAME_OBJECT + 1) == FC_FULLNAMELANG_OBJECT);
fel = FcPatternObjectFindElt (font, fe->object + 1);
pel = FcPatternObjectFindElt (pat, fe->object + 1);
- }
- else
- {
- fel = NULL;
- pel = NULL;
- }
- pe = FcPatternObjectFindElt (pat, fe->object);
- if (pe)
- {
- const FcMatcher *match = FcObjectToMatcher (pe->object, FcFalse);
- if (!FcCompareValueList (pe->object, match,
- FcPatternEltValues(pe),
- FcPatternEltValues(fe), &v, NULL, NULL, &result))
- {
- FcPatternDestroy (new);
- return NULL;
- }
if (fel && pel)
{
+ /* The font has name languages, and pattern asks for specific language(s).
+ * Match on language and and prefer that result.
+ * Note: Currently the code only give priority to first matching language.
+ */
int n = 1, j;
FcValueListPtr l1, l2, ln = NULL, ll = NULL;
+ const FcMatcher *match = FcObjectToMatcher (pel->object, FcTrue);
- match = FcObjectToMatcher (pel->object, FcTrue);
if (!FcCompareValueList (pel->object, match,
FcPatternEltValues (pel),
FcPatternEltValues (fel), NULL, NULL, &n, &result))
@@ -580,9 +569,10 @@ FcFontRenderPrepare (FcConfig *config,
}
else if (fel)
{
+ /* Pattern doesn't ask for specific language. Copy all for name and
+ * lang. */
FcValueListPtr l1, l2;
- copy_lang:
l1 = FcValueListDuplicate (FcPatternEltValues (fe));
l2 = FcValueListDuplicate (FcPatternEltValues (fel));
FcPatternObjectListAdd (new, fe->object, l1, FcFalse);
@@ -590,12 +580,23 @@ FcFontRenderPrepare (FcConfig *config,
continue;
}
+ }
+
+ pe = FcPatternObjectFindElt (pat, fe->object);
+ if (pe)
+ {
+ const FcMatcher *match = FcObjectToMatcher (pe->object, FcFalse);
+ if (!FcCompareValueList (pe->object, match,
+ FcPatternEltValues(pe),
+ FcPatternEltValues(fe), &v, NULL, NULL, &result))
+ {
+ FcPatternDestroy (new);
+ return NULL;
+ }
FcPatternObjectAdd (new, fe->object, v, FcFalse);
}
else
{
- if (fel)
- goto copy_lang;
FcPatternObjectListAdd (new, fe->object,
FcValueListDuplicate (FcPatternEltValues (fe)),
FcTrue);