Debian 7 Wheezy: install Chinese fonts








  1. Install Chinese fonts:
    sudo apt-get install fonts-arphic-bkai00mp fonts-arphic-bsmi00lp fonts-arphic-gbsn00lp ttf-arphic-bkai00mp ttf-arphic-bsmi00lp ttf-arphic-gbsn00lp
    sudo apt-get install fonts-droid ttf-droid 
    sudo apt-get install ttf-wqy-zenhei ttf-wqy-microhei xfonts-wqy
    sudo apt-get install fonts-arphic-ukai ttf-arphic-ukai fonts-arphic-uming ttf-arphic-uming
    
  2. Font config:
    vi ~/.fonts.conf
    <?xmlversion='1.0'encoding='utf-8'?>
    <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
    <fontconfig>
    <!-- prefered fonts -->
    <alias>
        <family>serif</family>
        <prefer>
            <family>DejaVu Serif</family>
            <family>Bitstream Vera Serif</family>
            <family>Evermore Song</family>
            <family>WenQuanYi Bitmap Song</family>
            <family>AR PL UMing CN</family>
            <family>AR PL ShanHeiSun Uni</family>
            <family>Droid Sans Fallback</family>
            <family>WenQuanYi Micro Hei</family>
            <family>WenQuanYi Zen Hei</family>
        </prefer>
    </alias>
    <alias>
        <family>sans-serif</family>
        <prefer>
            <family>DejaVu Sans</family>
            <family>Bitstream Vera Sans</family>
            <family>Evermore Song</family>
            <family>Droid Sans Fallback</family>
            <family>WenQuanYi Micro Hei</family>
            <family>WenQuanYi Bitmap Song</family>
            <family>WenQuanYi Zen Hei</family>
            <family>AR PL UMing CN</family>
            <family>AR PL ShanHeiSun Uni</family>
        </prefer>
    </alias>
    <alias>
        <family>monospace</family>
        <prefer>
            <family>DejaVu Sans Mono</family>
            <family>Bitstream Vera Sans Mono</family>
            <family>Evermore Song</family>
            <family>WenQuanYi Micro Hei Mono</family>
            <family>WenQuanYi Zen Hei Mono</family>
            <family>Droid Sans Fallback</family>
            <family>WenQuanYi Bitmap Song</family>
            <family>AR PL UMing CN</family>
            <family>AR PL ShanHeiSun Uni</family>
        </prefer>
    </alias>
    <!-- Default Alias -->
    <alias>
        <family>DejaVu Sans</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <!-- Generic font families -->
    <match target="pattern">
        <test name="family" qual="any">
            <string>serif</string>
        </test>
        <edit binding="strong" mode="prepend" name="family">
            <string>DejaVu Serif</string>
        </edit>
    </match>
    <match target="pattern">
        <test name="family" qual="any">
            <string>sans-serif</string>
        </test>
        <edit binding="strong" mode="prepend" name="family">
            <string>DejaVu Sans</string>
        </edit>
    </match>
    <match target="pattern">
        <test name="family" qual="any">
            <string>monospace</string>
        </test>
        <edit binding="strong" mode="prepend" name="family">
            <string>DejaVu Sans Mono</string>
        </edit>
    </match>
    <!-- Anti-alias -->
    <match target="font">
        <edit name="embeddedbitmap">
            <bool>false</bool>
        </edit>
    </match>
    <!-- WenQuanYi Bitmap Song -->
    <selectfont>
        <acceptfont>
            <pattern>
                <patelt name="family">
                    <string>WenQuanYi Bitmap Song</string>
                </patelt>
            </pattern>
        </acceptfont>
    </selectfont>
    <match target="pattern">
        <test name="family" qual="any">
        <string>WenQuanYi Bitmap Song</string>
        </test>
        <test compare="less" name="pixelsize" qual="any">
            <double>12</double>
        </test>
        <edit mode="assign" name="family">
            <string>WenQuanYi Micro Hei</string>
        </edit>
    </match>
    <match target="pattern">
        <test name="family" qual="any">
            <string>WenQuanYi Bitmap Song</string>
        </test>
        <test compare="more" name="pixelsize" qual="any">
            <double>16</double>
        </test>
        <edit mode="assign" name="family">
            <string>AR PL ShanHeiSun</string>
        </edit>
    </match>
    <!-- Alias -->
    <alias>
        <family>SimSun</family>
        <family>宋体</family>
        <accept>
            <family>LiHei Pro</family>
            <family>Evermore Song</family>
            <family>WenQuanYi Bitmap Song</family>
            <family>AR PL ShanHeiSun Uni</family>
        </accept>
        <default>
            <family>serif</family>
        </default>
    </alias>
    <alias>
        <family>SimHei</family>
        <family>黑体</family>
        <accept>
            <family>LiHei Pro</family>
            <family>WenQuanYi Micro Hei</family>
            <family>WenQuanYi Zen Hei</family>
        </accept>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>微软雅黑</family>
        <family>Microsoft YaHei</family>
        <accept>
            <family>LiHei Pro</family>
            <family>WenQuanYi Micro Hei</family>
            <family>WenQuanYi Zen Hei</family>
        </accept>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <!-- -->
    <match target="font">
        <edit mode="assign" name="rgba">
            <const>rgb</const>
        </edit>
    </match>
    <match target="font">
        <edit mode="assign" name="hinting">
            <bool>true</bool>
        </edit>
    </match>
    <match target="font">
        <edit mode="assign" name="hintstyle">
            <const>hintfull</const>
        </edit>
    </match>
    <match target="font">
        <edit mode="assign" name="antialias">
            <bool>true</bool>
        </edit>
    </match>
    </fontconfig>






If you just need basic chinese fonts. Just install the following:
sudo apt-get install fonts-arphic-bkai00mp fonts-arphic-bsmi00lp fonts-arphic-gbsn00lp ttf-arphic-bkai00mp ttf-arphic-bsmi00lp ttf-arphic-gbsn00lp



No comments:

Post a Comment