Bug 27377

Summary: Side effect of the binding inheritance by binding="same"
Product: fontconfig Reporter: Behdad Esfahbod <freedesktop>
Component: confAssignee: fontconfig-bugs
Status: RESOLVED MOVED QA Contact: Behdad Esfahbod <freedesktop>
Severity: normal    
Priority: medium CC: akira, freedesktop
Version: 2.7   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Behdad Esfahbod 2010-03-30 13:23:00 UTC
Akira hints at that on the fedora fonts list in message sent on 2010-03-19.  He writes:

I'm wondering if we should recommend the use of
/binding="same"/ in the locale-specific overrides rule of
the template because it introduces the unexpected result
depending on the queries pattern.

Here is the example of it:

$ rpm -qa \*-fonts | grep mono
dejavu-sans-mono-fonts-2.30-2.fc12.noarch
liberation-mono-fonts-1.05.2.20091019-5.fc13.noarch
$ rpm -q vlgothic-fonts
vlgothic-fonts-20100126-2.fc13.noarch

$ fc-match monospace:lang=ja
VL-Gothic-Regular.ttf: "VL Gothic" "regular"
$ fc-match monospace:lang=ja-jp
VL-Gothic-Regular.ttf: "VL Gothic" "regular"
$ fc-match monospace:lang=en
VL-Gothic-Regular.ttf: "VL Gothic" "regular"
$ fc-match monospace:lang=en-us
VL-Gothic-Regular.ttf: "VL Gothic" "regular"

Also same result for serif, but not for sans-serif, since
apparently fontconfig always deals with it as "sans" for the
initial query pattern, translating it to "sans-serif". and
all of rules are targetting "sans-serif" but not "sans". so
it's luckily working.
Comment 1 Akira TAGOH 2011-01-07 01:34:38 UTC
For more info to understand the issue...

http://lists.fedoraproject.org/pipermail/fonts/2010-March/001118.html

The logs in above mail should make this clearer what exactly happened with it.

Given that there are anything else can be fixed in fontconfig side, that may be to give the weak binding to the family in the initial pattern to avoid the _side-effect_ of the binding inheritance.
Comment 2 Akira TAGOH 2012-04-24 01:33:46 UTC
I have no idea what to do here. actually this side-effect is unfortunate in the pattern matching rule. but we should add binding="same" for renaming family name rule in fonts.conf to keep consistency at least:

        <match target="pattern">
                <test qual="any" name="family">
                        <string>sans serif</string>
                </test>
                <edit name="family" mode="assign" binding="same">
                        <string>sans-serif</string>
                </edit>
        </match>

        <match target="pattern">
                <test qual="any" name="family">
                        <string>sans</string>
                </test>
                <edit name="family" mode="assign" binding="same">
                        <string>sans-serif</string>
                </edit>
        </match>
Comment 3 Akira TAGOH 2012-07-11 02:54:33 UTC
BTW the above changes has been made in cc9d572d3e3d270653c994ff1269f56eb7ee1b1c
Comment 4 Behdad Esfahbod 2015-05-06 02:01:38 UTC
Also see bug 90330.
Comment 5 GitLab Migration User 2018-08-20 21:45:30 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/35.

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.