[Fontconfig-bugs] [Bug 33644] Fontconfig doesn't match correctly in <test>

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue May 1 03:28:14 PDT 2012


https://bugs.freedesktop.org/show_bug.cgi?id=33644

--- Comment #17 from Akira TAGOH <akira at tagoh.org> 2012-05-01 03:28:14 PDT ---
(In reply to comment #12)
> Because you probably have "Courier" in the pattern and your rule tries to test
> it first. fontconfig finds it out earlier than "Courier New" and apply the edit
> pattern to it then. the bad news for you is "Courier" appears after "Courier
> New". so your pattern after FcConfigSubstitute() should looks like the pseudo
> array in comment#9.
> 
> You can see with FC_DEBUG=4 fc-match ... what happened there.

For reasonable solution, we could refer the binding to determine which is
better to match and edit the pattern.

for example:
FcConfigSubstitute test pattern any family Equal "Helvetica" Comma "Arial"
Substitute match
        pattern any family Equal "Helvetica" Comma "Arial"
edit
        Edit family Prepend "VL Gothic";

Prepend list before  "Arial"(s) "Liberation Sans"(s) "Albany"(s) "Albany
AMT"(s)
 "Helvetica"(w) "Nimbus Sans L"(w) "sans-serif"(w)
Prepend list after  "Arial"(s) "Liberation Sans"(s) "Albany"(s) "Albany AMT"(s) 
"VL Gothic"(w) "Helvetica"(w) "Nimbus Sans L"(w) "sans-serif"(w)
FcConfigSubstitute editPattern has 1 elts (size 16)
        family: "Arial"(s) "Liberation Sans"(s) "Albany"(s) "Albany AMT"(s) "VL 
Gothic"(w) "Helvetica"(w) "Nimbus Sans L"(w) "sans-serif"(w)

As I mentioned in the comment#12, this is correct behavior in current
implementation, because of the matching order depends on the order of the rule.
so adding "VL Gothic" prior to "Helvetica". however what one expects here
should be to be added prior to "Arial". so we can check the binding value of
"Helvetica" and "Arial" and do the thing for higher priority.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the Fontconfig-bugs mailing list