分页: 1 / 1

font problems

发表于 : 2007-09-15 2:50
dr_spork
I'm having problems with Chinese font display on an English Ubuntu 7.04 Fiesty system. In a word processor or other application where I can control the font, I have no problems, but when it's configured by the system, I get ugly looking aliased fonts in any size below 18pt. I need to reconfigure it so that the system just uses the good-looking fonts instead of the bitmap fonts. What font configuration file should I be editing to solve this problem? There are so many files to choose from. Is it one of the many files in /etc/fonts/conf.avail or is it in /usr/share/language-selector/fontconfig/zh_CN? If so, which file can I edit to change which font displays small Chinese characters?

Does someone (who is using the native Ubuntu fonts and not MS fonts) have a dump of these files configured correctly that I could look at?

谢谢

发表于 : 2007-09-15 9:34
roylez
I guess what you need is actually a good ~/.fonts.conf . If you do not mind, you can try out mine first. It is not that good actually, but bearable.

代码: 全选

<?xml version="1.0"?>
<fontconfig>
<!-- Target dots per inch -->
        <match target="pattern">
                <edit name="dpi" mode="assign" >
                        <double>96</double>
                </edit>
        </match>

<!--Fonts rendering sequence-->
    <alias>
        <family>serif</family>
            <prefer>
                <family>Bitstream Vera Serif</family>
                <!--<family>DejaVu Serif</family>-->
                <family>AR PL ShanHeiSun Uni</family>
                <family>Song Ti</family>
		<family>WenQuanYi Bitmap Song</family>
                <family>AR PL ZenKai Uni</family>
                <family>Fangsong Ti</family>
            </prefer>
    </alias>
    <alias>
        <family>sans-serif</family>
            <prefer>
                <family>Bitstream Vera Sans</family>
                <!--<family>DejaVu Sans</family>-->
                <family>AR PL ShanHeiSun Uni</family>
                <family>Song Ti</family>
		<family>WenQuanYi Bitmap Song</family>
                <family>AR PL ZenKai Uni</family>
                <family>Fangsong Ti</family>
            </prefer>
    </alias>
    <alias>
        <family>monospace</family>
            <prefer>
                <family>Bitstream Vera Sans Mono</family>
                <!--<family>DejaVu Sans Mono</family>-->
                <family>AR PL ShanHeiSun Uni</family>
                <family>Song Ti</family>
		<family>WenQuanYi Bitmap Song</family>
                <family>AR PL ZenKai Uni</family>
                <family>Fangsong Ti</family>
            </prefer>
    </alias>

<!--Global settings for improving fonts rendering-->
    <match target="font">
        <test compare="more" name="pixelsize" qual="any">
            <double>12</double>
        </test>
        <edit name="autohint" mode="assign" >
            <bool>true</bool>
        </edit>
    </match> 
    <match target="font">
        <edit name="hinting">
            <bool>true</bool>
        </edit>
        <!--subpixel hinting for LCD ONLY-->
        <edit name="rgba" mode="assign">
            <const>rgb</const>
	</edit>
        <!--<edit name="hintstyle">-->
            <!--<const>hintslight</const>-->
        <!--</edit>-->
        <edit name="antialias">
            <bool>true</bool>
        </edit>
    </match>
 
<!--Make Chinese fonts bigger if it's smaller than 12 pixel-->
    <match target="font" >
        <test name="family" compare="contains" >
            <string>SimSun</string>
            <string>AR PL</string>
        </test>
        <test compare="less_eq" name="pixelsize">
            <int>12</int>
        </test>
        <edit mode="assign" name="pixelsize">
            <int>12</int>
        </edit>
    </match>

<!--Rendering settings for Chinese fonts-->
    <match target="font" >
        <test name="family" compare="contains" >
            <string>SimSun</string>
            <string>AR PL</string>
        </test>
        <edit name="globaladvance">
            <bool>false</bool>
        </edit>
        <edit name="spacing">
            <int>0</int>
        </edit>
        <test name="pixelsize" compare="less_eq">
            <int>18</int>
        </test>
        <edit name="antialias" mode="assign" >
            <bool>false</bool>
        </edit>
        </match>
 
</fontconfig>

发表于 : 2007-09-16 1:59
dr_spork
adding a ~/.fonts.conf didn't seem to affect anything.