diff options
author | marha <marha@users.sourceforge.net> | 2013-03-25 10:20:34 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-03-25 10:20:34 +0100 |
commit | 176eab9e8277db1549bfc6c9ae805c4e1858f0b0 (patch) | |
tree | a4c8d2d939aa500304d979377e39316b115a8128 /fontconfig/src/fcmatch.c | |
parent | 9c17f511266fff48a936633de280f271f0ce0c11 (diff) | |
download | vcxsrv-176eab9e8277db1549bfc6c9ae805c4e1858f0b0.tar.gz vcxsrv-176eab9e8277db1549bfc6c9ae805c4e1858f0b0.tar.bz2 vcxsrv-176eab9e8277db1549bfc6c9ae805c4e1858f0b0.zip |
fontconfig mesa pixman xserver git update 25 Mar 2013
xserver commit 2967391c6d35f03121afa8003e0fb94b62495129
pixman commit d8ac35af1208a4fa4d67f03fee10b5449fb8495a
fontconfig commit b561ff2016ce84eef3c81f16dfb0481be6a13f9b
mesa commit 92b8a37fdfff9e83f39b8885f51ed2f60326ab6a
Diffstat (limited to 'fontconfig/src/fcmatch.c')
-rw-r--r-- | fontconfig/src/fcmatch.c | 21 |
1 files changed, 21 insertions, 0 deletions
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 @@ -77,6 +77,24 @@ FcCompareFamily (FcValue *v1, FcValue *v2) } 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) { FcLangResult result; @@ -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), |