From dde22e946ccfb0bd937224daf42403b80528c2a6 Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 25 Mar 2013 10:20:34 +0100 Subject: fontconfig mesa pixman xserver git update 25 Mar 2013 xserver commit 2967391c6d35f03121afa8003e0fb94b62495129 pixman commit d8ac35af1208a4fa4d67f03fee10b5449fb8495a fontconfig commit b561ff2016ce84eef3c81f16dfb0481be6a13f9b mesa commit 92b8a37fdfff9e83f39b8885f51ed2f60326ab6a --- fontconfig/src/fcmatch.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'fontconfig/src/fcmatch.c') diff --git a/fontconfig/src/fcmatch.c b/fontconfig/src/fcmatch.c index 7993b81de..68f39aef5 100644 --- a/fontconfig/src/fcmatch.c +++ b/fontconfig/src/fcmatch.c @@ -76,6 +76,24 @@ FcCompareFamily (FcValue *v1, FcValue *v2) return (double) FcStrCmpIgnoreBlanksAndCase (v1_string, v2_string) != 0; } +static double +FcComparePostScript (FcValue *v1, FcValue *v2) +{ + const FcChar8 *v1_string = FcValueString (v1); + const FcChar8 *v2_string = FcValueString (v2); + int n; + size_t len; + + if (FcToLower (*v1_string) != FcToLower (*v2_string) && + *v1_string != ' ' && *v2_string != ' ') + return 1.0; + + n = FcStrMatchIgnoreCaseAndDelims (v1_string, v2_string, (const FcChar8 *)" -"); + len = strlen ((const char *)v1_string); + + return (double)(len - n) / (double)len; +} + static double FcCompareLang (FcValue *v1, FcValue *v2) { @@ -198,6 +216,7 @@ FcCompareFilename (FcValue *v1, FcValue *v2) #define PRI_FcCompareFilename(n) PRI1(n) #define PRI_FcCompareCharSet(n) PRI1(n) #define PRI_FcCompareLang(n) PRI1(n) +#define PRI_FcComparePostScript(n) PRI1(n) #define FC_OBJECT(NAME, Type, Cmp) PRI_##Cmp(NAME) @@ -219,8 +238,10 @@ typedef enum _FcMatcherPriority { PRI1(CHARSET), PRI_FAMILY_STRONG, PRI_LANG_STRONG, + PRI_POSTSCRIPT_NAME_STRONG, PRI_LANG_WEAK, PRI_FAMILY_WEAK, + PRI_POSTSCRIPT_NAME_WEAK, PRI1(SPACING), PRI1(PIXEL_SIZE), PRI1(STYLE), -- cgit v1.2.3