From c7641f2872329197250db6ffe194df3d33ff42b3 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 31 Dec 2008 19:35:27 -0500 Subject: [PATCH] [fcmatch] Use larger multipliers to enforce order Previously the matcher multiplied comparison results by 100 and added index value to it. With long lists of families (lots of aliases), reaching 100 is not that hard. That could result in a non-match early in the list to be preferred over a match late in the list. Changing the multiplier from 100 to 1000 should fix that. To keep things relatively in order, the lang multiplier is changed from 1000 to 10000. --- src/fcmatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fcmatch.c b/src/fcmatch.c index ac63fbe..4d20a61 100644 --- a/src/fcmatch.c +++ b/src/fcmatch.c @@ -328,7 +328,7 @@ FcCompareValueList (FcObject object, *result = FcResultTypeMismatch; return FcFalse; } - v = v * 100 + j; + v = v * 1000 + j; if (v < best) { if (bestValue) @@ -768,7 +768,7 @@ FcFontSetSort (FcConfig *config, } } if (!satisfies) - nodeps[f]->score[MATCH_LANG_INDEX] = 1000.0; + nodeps[f]->score[MATCH_LANG_INDEX] = 10000.0; } /* -- 2.39.2