华文黑体在ubuntu里的表现非常棒,它也是目前一款比较好的中文字体,当然还有微软的雅黑字体。
1、获得字体STheiti和Lucida.Grande
华文黑体(原本是stheiti.rar,为方便在ubuntu下解压就用gz包.stheiti.tar.gz)点击下载Lucida.Grande(原本是Lucida.Grande.rar,为方便在ubuntu下解压改用zip包.Lucida.Grande.zip) 点击下载
微软雅黑v6.0(原本是msyh6.rar,为方便在ubuntu下解压改用zip包.msyh6.zip) 点击下载
2、在/usr/share/fonts下新建一个目录,名字自拟,如usrfonts
3、将字体文件复制到刚建好的目录下,并设置字体权限为所有用户可读(选中字体点右键即可设置)
4、强制STHeiti不使用微调
sudo gedit /etc/fonts/fonts.conf
在
<fontconfig>
下面加入下面一段:
引用:
<match target="font">
<test name="family">
<string>STHeiti</string>
</test>
<edit name="hinting">
<bool>false</bool>
</edit>
</match>
5、修改字体配置文件
修改/etc/fonts/conf.d/69-language-selector-zh-cn.conf和/etc/fonts/conf.d/99-language-selector-zh.conf
如果 /etc/fonts/conf.d/下没有这两个文件可建立连接
sudo ln -s /etc/fonts/conf.avail/69-language-selector-zh-cn.conf /etc/fonts/conf.d/
sudo ln -s /etc/fonts/conf.avail/99-language-selector-zh.conf /etc/fonts/conf.d/
在两个文件中分别加入<string>STHeiti</string>如下:
/etc/fonts/conf.d/69-language-selector-zh-cn.conf
引用:
<fontconfig>
<match target="pattern">
<test qual="any" name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>STHeiti</string>
<string>AR PL UMing CN</string>
<string>AR PL ShanHeiSun Uni</string>
<string>WenQuanYi Bitmap Song</string>
<string>Bitstream Vera Serif</string>
<string>DejaVu Serif</string>
<string>AR PL UKai CN</string>
<string>AR PL ZenKai Uni</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Bitstream Vera Sans</string>
<string>DejaVu Sans</string>
<string>STHeiti</string>
<string>WenQuanYi Zen Hei</string>
<string>AR PL UMing CN</string>
<string>AR PL ShanHeiSun Uni</string>
<string>WenQuanYi Bitmap Song</string>
<string>AR PL UKai CN</string>
<string>AR PL ZenKai Uni</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>monospace</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Bitstream Vera Sans Mono</string>
<string>DejaVu Sans Mono</string>
<string>STHeiti</string>
<string>WenQuanYi Zen Hei</string>
<string>AR PL UMing CN</string>
<string>AR PL ShanHeiSun Uni</string>
<string>WenQuanYi Bitmap Song</string>
<string>AR PL UKai CN</string>
<string>AR PL ZenKai Uni</string>
</edit>
</match>
</fontconfig>
/etc/fonts/conf.d/99-language-selector-zh.conf
引用:
<fontconfig>
<match target="font" >
<test name="family" compare="contains" >
<string>STHeiti</string>
<string>Song</string>
<string>Sun</string>
<string>Kai</string>
<string>Ming</string>
</test>
<!-- check to see if the font is just regular -->
<test name="weight" compare="less_eq">
<int>100</int>
</test>
<test compare="more_eq" target="pattern" name="weight" >
<int>180</int>
</test>
<edit mode="assign" name="embolden" >
<bool>true</bool>
</edit>
</match>
</fontconfig>
6、设置字体和渲染方式
打开 “系统-首选项-外观-字体” 面板:
在字体选项里选择Lucida Grande
在 “字体渲染” 选项中选择 “次象素平滑” 或者 “最佳形状”(自己多搭配设置试试,显示器不同设置也不同)
7、firefox字体设置
把字体设置成Lucida Grande,最小字体大小设置成12
最后,使用Ctrl+Alt+BackSpace重启x看效果。
没有评论:
发表评论