summaryrefslogtreecommitdiff
path: root/src/fcmatch.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2008-12-31 19:44:32 -0500
committerBehdad Esfahbod <behdad@behdad.org>2009-02-13 16:54:05 -0800
commita5a384c5ffb479e095092c2aaedd406f8785280a (patch)
tree5a852f5308a6195ac62269f6ec87788ec1493c7f /src/fcmatch.c
parentc7641f2872329197250db6ffe194df3d33ff42b3 (diff)
[fcmatch] When matching, reserve score 0 for when elements don't exist
Previously an index j was added to element score to prefer matches earlier in the value list to the later ones. This index started from 0, meaning that the score zero could be generated for the first element. By starting j from one, scores for when the element exists in both pattern and font can never be zero. The score zero is reserved for when the element is NOT available in both font and pattern. We will use this property later. This shouldn't change matching much. The only difference I can think of is that if a font family exists both as a bitmap font and a scalable version, and when requesting it at the size of the bitmap version, previously the font returned was nondeterministic. Now the scalable version will always be preferred.
Diffstat (limited to 'src/fcmatch.c')
-rw-r--r--src/fcmatch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fcmatch.c b/src/fcmatch.c
index 4d20a61f..49dd0dda 100644
--- a/src/fcmatch.c
+++ b/src/fcmatch.c
@@ -317,7 +317,7 @@ FcCompareValueList (FcObject object,
best = 1e99;
bestStrong = 1e99;
bestWeak = 1e99;
- j = 0;
+ j = 1;
for (v1 = v1orig; v1; v1 = FcValueListNext(v1))
{
for (v2 = v2orig; v2; v2 = FcValueListNext(v2))