[Fontconfig-bugs] [Bug 59385] Do the right thing for intermixed edit and test elements

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Jan 25 03:08:02 PST 2013


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

Akira TAGOH <akira at tagoh.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |akira at tagoh.org

--- Comment #1 from Akira TAGOH <akira at tagoh.org> ---
proposed fix for this:
  http://cgit.freedesktop.org/~tagoh/fontconfig/commit/?h=bz59385

maybe I should export FcSubst* as FcPrivate but static function, instead of own
structure to stock the FcTest and FcEdit to reorder.

        <match>
                <test name="lang" compare="eq">
                        <string>ja</string>
                </test>
                <edit name="family" mode="append">
                        <string>foo</string>
                </edit>
                <test name="family" compare="contains">
                        <string>foo</string>
                </test>
                <edit name="family" mode="assign">
                        <string>bar</string>
                </edit>
        </match>

before applying this change:

        Loading config file
/home/tagoh/.config/fontconfig/conf.d/00-bz59385.conf
Add Subst match
        pattern any lang Equal "ja"
        pattern any family Contains "foo"
edit
        Edit family Append "foo";
        Edit family Assign "bar";
...
FcConfigSubstitute test pattern any lang Equal "ja"
FcConfigSubstitute test pattern any family Contains "foo"
No match

after applying:

        Loading config file
/home/tagoh/.config/fontconfig/conf.d/00-bz59385.conf
Add Subst match
        pattern any lang Equal "ja"
edit
        Edit family Append "foo";

Add Subst match
        pattern any family Contains "foo"
edit
        Edit family Assign "bar";
...
FcConfigSubstitute test pattern any lang Equal "ja"
Substitute match
        pattern any lang Equal "ja"
edit
        Edit family Append "foo";

Append list before  "sans-serif"(w) [insert here]
Append list after  "sans-serif"(w) "foo"(w)
FcConfigSubstitute editPattern has 3 elts (size 16)
        family: "sans-serif"(w) "foo"(w)
        lang: "ja"(w)
        prgname: "lt-fc-match"(s)

FcConfigSubstitute test pattern any family Contains "foo"
Substitute match
        pattern any family Contains "foo"
edit
        Edit family Assign "bar";

Append list before  "sans-serif"(w) "foo"(w) [insert here]
Append list after  "sans-serif"(w) "foo"(w) "bar"(w)
FcConfigSubstitute editPattern has 3 elts (size 16)
        family: "sans-serif"(w) "bar"(w)
        lang: "ja"(w)
        prgname: "lt-fc-match"(s)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/fontconfig-bugs/attachments/20130125/871c78f9/attachment.html>


More information about the Fontconfig-bugs mailing list