[Fontconfig] Using chinese fonts by default

Philip Jägenstedt philip at lysator.liu.se
Sat Jun 10 14:14:26 PDT 2006


Hello!

On my Ubuntu system I have three Chinese fonts (AR PL ShanHeiSun Uni, AR
PL ZenKai Uni and SimSun), two Japanese fonts and four Korean fonts. I'm
interested in the Chinese looking good, wanting SimSun by default, but
right now sometimes glyphs from the other Chinese fonts and the Japanese
and Korean fonts are sometimes used, which looks horrible when they are a
different style than the Chinese font. I tried this in my .fonts.conf:

<alias>
        <family>sans-serif</family>
        <prefer>
                <family>SimSun</family>
        </prefer>
</alias>

<alias>
        <family>serif</family>
        <prefer>
                <family>SimSun</family>
        </prefer>
</alias>

<alias>
        <family>monospace</family>
        <prefer>
                <family>SimSun</family>
        </prefer>
</alias>

Unsurprisingly, this causes the english glyphs in SimSun to be used for
all english text, which I don't want. So I tried adding

<match target="font">
        <test name="family"><string>SimSun</string></test>
        <edit name="lang" mode="assign"><string>zh-cn</string></edit>
</match>

But this doesn't change anything, SimSun is still used for english writing.

What is the proper way to use the Chinese font by default but forbid it
from being used for anything but Chinese?

BTW, do my alias-family-prefer snippets override the settings in
/etc/fonts/fonts.conf so that even if I could forbid SimSun from being
used for english text the font-matching would be completely broken for all
non-chinese text?

// Philip Jägenstedt



More information about the Fontconfig mailing list