[Fontconfig] Bold Font replacement

Ken Joseph fontconfig@fontconfig.org
Thu, 13 Mar 2003 01:10:46 -0800


Around 17:00, 3/10/2003, Alger Hoi wrote:

>I am a Chinese user. As the Dynafonts I used in Chinese does not have bo=
ld
>style, so that fontconfig cannot return a bold font when the application=

>request a bold style of the same font (I already added them in alias ser=
if).

You only need to add DFPHeiLight-B5 to the Serif aliases.

>My fc-list of the fonts look like.
>
>DFPHeiLight\-B5:style=3DRegular
>DFPHeiBold\-B5:style=3DRegular
>
>Although they are different ttf, actually the second one is the bold ver=
sion
>of the first one. Is that any way so that, for example, when a applicati=
on
>requests a "serif" font in lang zh, return the first one, when it reques=
t
>a bold "serif" in lang zh, return the second one?

I don't think you need to specify zh lang in font matching.
Try the following:

    <match target=3D"pattern">
        <test name=3D"family">
            <string>Serif</string>
        </test>
        <test name=3D"weight" compare=3D"more">
            <const>medium</const>
        </test>
        <edit name=3D"family" mode=3D"prepend">
            <string>DFPHeiBold-B5</string>
        </edit>
    </match>
    <match target=3D"pattern">
       <test name=3D"family">
           <string>DFPHeiLight-B5</string>
       </test>
       <test name=3D"weight" compare=3D"more">
           <const>medium</const>
       </test>
       <edit name=3D"family" mode=3D"assign">
           <string>DFPHeiBold-B5</string>
       </edit>
    </match>

I use similar settings as above and mine works fine.
Good luck.




________________________________________
네띠앙 프리미엄 메일 오픈! (SMTP, 스팸메일 필터링 제공) http://www.netian.com/premium_mail/main.html