Yseen 2008-05-10
本文作者:dogfox
编辑人员:FireHare
适用版本:Ubuntu Dapper
测试环境:Ubuntu Dapper gnome 中文+英文
添加源
Ubuntu Dapper 用户只需加入下面两条到 sources.list
sudo nano /etc/apt/sources.list
# ClearType patches
deb http://www.elisanet.fi/mlind/ubuntu dapper fonts
deb-src http://www.elisanet.fi/mlind/ubuntu dapper fonts
或者
deb http://www.telemail.fi/mlind/ubuntu feisty fonts
deb-src http://www.telemail.fi/mlind/ubuntu feisty fonts
下载公钥
gpg --keyserver pgp.mit.edu --recv-key D0AFFF5E937215FF
gpg -a --export D0AFFF5E937215FF | sudo apt-key add -
或者
gpg --keyserver subkeys.pgp.net --recv-keys 937215FF
gpg --export --armor 937215FF | sudo apt-key add -
升级文件
sudo apt-get update && sudo apt-get install libxft2 libxft-dev libfreetype6 libfreetype6-dev libcairo2-dev
下载字体,修改字体权限
下载雅黑字体後将雅黑字体放到 /usr/share/fonts/yahei/下
(请自行在google或baidu上搜索并下载雅黑字体,其中/yahei为你新建立的雅黑字体文件夹)
修改字体权限使root以外的普通用户也可以正常使用雅黑
sudo chmod 555 /usr/share/fonts/yahei/*
建立字体缓存信息
cd /usr/share/fonts/yahei/
sudo mkfontscale
sudo mkfontdir
sudo fc-cache -fv
修改字体配置文件
下载 雅黑配置 解压并拷贝配置文件到 /etc/fonts/下
(配置文件仅作参考,视各自已安装字体具体情况为准。配置文件见附件。)
修改language-selector.conf (你的系统如没有此文件此步可忽略,此文件在安装文泉驿字体後才会有)
sudo gedit /etc/fonts/language-selector.conf
分别在
<family>Bitstream Vera Serif</family>
<family>Bitstream Vera Sans</family>
<family>Bitstream Vera Sans Mono</family>
下添加
<family>Microsoft YaHei</family>
示例:(说明:这只是language-selector.conf文件的部分内容,只作参考不要copy)
<fontconfig>
<alias>
<family>serif</family>
<prefer>
<family>Bitstream Vera Serif</family>
<family>Microsoft YaHei</family>
<family>DejaVu Serif</family>
<family>AR PL ShanHeiSun Uni</family>
<family>WenQuanYi Bitmap Song</family>
<family>AR PL ZenKai Uni</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Bitstream Vera Sans</family>
<family>Microsoft YaHei</family>
<family>DejaVu Sans</family>
<family>AR PL ShanHeiSun Uni</family>
<family>WenQuanYi Bitmap Song</family>
<family>AR PL ZenKai Uni</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Bitstream Vera Sans Mono</family>
<family>Microsoft YaHei</family>
<family>DejaVu Sans Mono</family>
<family>AR PL ShanHeiSun Uni</family>
<family>WenQuanYi Bitmap Song</family>
<family>AR PL ZenKai Uni</family>
</prefer>
</alias>