[Fontconfig] all font names of one font should be putted into <match target="font"> clause of config file?

drag chan zgchan317 at gmail.com
Sun Oct 14 19:41:32 PDT 2007


When run fc-match command, I find a issue. My system is Ubuntu 7.04,
which has a ttf-arphic-uming package, it contains a ttf font --
/usr/sahre/fonts/truetype/arphic/uming.ttf, and a config file --
/etc/fonts/conf.d/ttf-arphic-uming.

in locale en_US.utf8, run these commands:

1)
$ fc-list 'AR PL ShanHeiSun Uni' file family familylang
/usr/share/fonts/truetype/arphic/uming.ttf: AR PL ShanHeiSun
Uni,ÎĶ¦PL¼šÉϺ£ËÎUni,ÎĶ¦PLϸÉϺ£ËÎUni:familylang=en,zh-tw,zh-cn

2)
$ fc-match -v 'AR PL ShanHeiSun Uni' # font name of familylang en
Pattern has 33 elts (size 48)
        family: "AR PL ShanHeiSun Uni"(s)
        familylang: "zh-tw"(s)
			......
        size: 12(f)(s)
        pixelsize: 12.5(f)(s)
        foundry: "unknown"(s)
        antialias: FcFalse(w)
			......
3)
$ fc-match -v 'ÎĶ¦PL¼šÉϺ£ËÎUni' # font name of familylang zh-tw
Pattern has 30 elts (size 32)
        family: "ÎĶ¦PL¼šÉϺ£ËÎUni"(s)
        familylang: "zh-tw"(s)
			.......
        size: 12(f)(s)
        pixelsize: 12.5(f)(s)
        foundry: "unknown"(s)
        antialias: FcTrue(w)
 			.......

4)
$ fc-match -v 'ÎĶ¦PLϸÉϺ£ËÎUni' # font name of familylang zh-cn
Pattern has 30 elts (size 32)
        family: "ÎĶ¦PLϸÉϺ£ËÎUni"(s)
        familylang: "zh-tw"(s)
			......
        size: 12(f)(s)
        pixelsize: 12.5(f)(s)
        foundry: "unknown"(s)
        antialias: FcTrue(w)
			......

config file /etc/fonts/conf.d/ttf-arphic-uming has content just like:
<fontconfig>
        <match target="font">
                <test name="family">
                <string>AR PL ShanHeiSun Uni</string>
                <string>AR PL ShanHeiSun Uni MBE</string>
                </test>
						.......
                <edit name="antialias"><bool>false</bool></edit>
						.......
        </match>

        <match target="font">
                <test name="family">
                <string>AR PL ShanHeiSun Uni</string>
                <string>AR PL ShanHeiSun Uni MBE</string>
                </test>
                <test name="pixelsize" compare="more_eq"><int>17</int></test>
                <edit name="antialias" mode="assign"><bool>true</bool></edit>
						.....
        </match>
</fontconfig>

we can see that command 2) accept above rule, but 3) and 4) dosn't.

My question is: all font names of one font should be putted into
<match target="font"> clause? as a fontconfig user, if a clause in
config file which disable antialias for font uming.ttf, it should work
for any font name of uming.ttf.


Another issue: familylang outputs of command 2), 3), 4) are all same.
instead, 2) should be "en", and 4) should be "zh-cn".


dragchan


More information about the Fontconfig mailing list