Bug 98

Summary: FcOpContains ordering problem
Product: fontconfig Reporter: Owen Taylor <otaylor>
Component: libraryAssignee: Keith Packard <keithp>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high    
Version: 2.2   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Owen Taylor 2003-07-03 14:19:19 UTC
The change:

revision 1.34
date: 2003/04/24 15:29:33;  author: keithp;  state: Exp;  lines: +4 -4
FcFontList broken when presented a charset - was comparing inclusion in the
wrong direction

was done by changing FcConfigCompareValue() to swap the order of comparison
for FcOpContains/FcOpNotContains, e.g:

            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;

But that broke using "contains" in fonts.conf:

        <match target="font">
               <test name="lang" compare="contains">
                        <string>ja</string>
                </test>

Now means "is the fonts set of languages contained with "ja".
Comment 1 Keith Packard 2003-07-04 09:59:02 UTC
Sigh.  Looks like it's time for a more comprehensive review of the operators to
make sure the order makes sense in every case.  I'll note that FcOpContains
also breaks FcFontList -- list 'Courier 10 Pitch' and you get 'Courier' as well.
Comment 2 Keith Packard 2003-09-05 09:11:10 UTC
This was fixed back in July after extensive messing around with operator ordering.
Comment 3 Owen Taylor 2003-09-05 09:21:03 UTC
Any hope of a backport to the stable branch? 2.2.1 has serious problems
in this area.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.