summaryrefslogtreecommitdiff
path: root/src/fccharset.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2003-04-24 15:29:33 +0000
committerKeith Packard <keithp@keithp.com>2003-04-24 15:29:33 +0000
commitf45d39b1fda93c949f4625a9fcee0c482b5cacd7 (patch)
tree7dfcbed2daa78489f636cfe06aec99dbdd2c8690 /src/fccharset.c
parent7d5c134a0a74b97438f3cdcc18ba44661d7253bf (diff)
FcFontList broken when presented a charset - was comparing inclusion in the
wrong direction
Diffstat (limited to 'src/fccharset.c')
-rw-r--r--src/fccharset.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/fccharset.c b/src/fccharset.c
index 1c0ebdd3..d87a720a 100644
--- a/src/fccharset.c
+++ b/src/fccharset.c
@@ -596,6 +596,9 @@ FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b)
{
an = a->numbers[ai];
bn = b->numbers[bi];
+ /*
+ * Check matching pages
+ */
if (an == bn)
{
FcChar32 *am = a->leaves[ai]->map;
@@ -604,6 +607,9 @@ FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b)
if (am != bm)
{
int i = 256/32;
+ /*
+ * Does am have any bits not in bm?
+ */
while (i--)
if (*am++ & ~*bm++)
return FcFalse;
@@ -611,6 +617,9 @@ FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b)
ai++;
bi++;
}
+ /*
+ * Does a have any pages not in b?
+ */
else if (an < bn)
return FcFalse;
else
@@ -618,6 +627,9 @@ FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b)
int low = bi + 1;
int high = b->num - 1;
+ /*
+ * Search for page 'an' in 'b'
+ */
while (low <= high)
{
int mid = (low + high) >> 1;
@@ -637,6 +649,9 @@ FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b)
bi++;
}
}
+ /*
+ * did we look at every page?
+ */
return ai >= a->num;
}