]> git.wh0rd.org - fontconfig.git/commitdiff
FcFontList broken when presented a charset - was comparing inclusion in the
authorKeith Packard <keithp@keithp.com>
Thu, 24 Apr 2003 15:29:33 +0000 (15:29 +0000)
committerKeith Packard <keithp@keithp.com>
Thu, 24 Apr 2003 15:29:33 +0000 (15:29 +0000)
    wrong direction

src/fccfg.c
src/fccharset.c

index 36a76a416c5619f54987872232dfe2c805ebb357..238edd3a1fc9150d0d0508adce4d457035913a0d 100644 (file)
@@ -578,12 +578,12 @@ FcConfigCompareValue (const FcValue       m_o,
        case FcTypeCharSet:
            switch (op) {
            case FcOpContains:
-               /* m contains v if v is a subset of m */
-               ret = FcCharSetIsSubset (v.u.c, m.u.c);
+               /* v contains m if m is a subset of v */
+               ret = FcCharSetIsSubset (m.u.c, v.u.c);
                break;
            case FcOpNotContains:
-               /* m contains v if v is a subset of m */
-               ret = !FcCharSetIsSubset (v.u.c, m.u.c);
+               /* v contains m if m is a subset of v */
+               ret = !FcCharSetIsSubset (m.u.c, v.u.c);
                break;
            case FcOpEqual:
                ret = FcCharSetEqual (m.u.c, v.u.c);
index 1c0ebdd38c3eca47ad136637c9ccc7fa114e6adc..d87a720a5f4b31efd6bfd81efc503145377599f1 100644 (file)
@@ -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;
 }