Ubuntu 7.10新安装具体细节配置(2)

但是KDE程序的字体在gnome环境下配置比较麻烦。据说用qt-qt3config和qt-qt4config可以分别配置qt3和qt4程序的字体,但是我从来没有成功过。变通的办法就是:KDE程序默认使用serif字体作为界面字体,所以可以将想要的字体作为serif字体的子集来达到这个效果。方法是:

sudo gedit /etc/fonts/language-selector.conf

这个文件在gutsy中似乎默认是不存在的,所以打开后是空白的。文件格式如下

<fontconfig>
<include ignore_missing=”yes”>CJK_aliases</include>

<alias>
<family>serif</family>
<prefer>
<family>Microsoft Yahei</family>
<family>AR PL UMing CN</family>
<family>AR PL ShanHeiSun Uni</family>
<family>WenQuanYi Bitmap Song</family>
<family>Bitstream Vera Serif</family>
<family>DejaVu Serif</family>
<family>AR PL UKai CN</family>
<family>AR PL ZenKai Uni</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Microsoft Yahei</family>
<family>AR PL UMing CN</family>
<family>AR PL ShanHeiSun Uni</family>
<family>WenQuanYi Bitmap Song</family>
<family>Bitstream Vera Sans</family>
<family>DejaVu Sans</family>
<family>AR PL UKai CN</family>
<family>AR PL ZenKai Uni</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Microsoft Yahei</family>
<family>AR PL UMing CN</family>
<family>AR PL ShanHeiSun Uni</family>
<family>WenQuanYi Bitmap Song</family>
<family>Bitstream Vera Sans Mono</family>
<family>DejaVu Sans Mono</family>
<family>AR PL UKai CN</family>
<family>AR PL ZenKai Uni</family>
</prefer>
</alias>

<match target=”font” >
<test name=”family” compare=”contains” >
<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>

<match target=”font” >
<test name=”family” compare=”contains” >
<string>Song</string>
<string>Sun</string>
<string>Ming</string>
</test>
<edit name=”globaladvance”>
<bool>false</bool>
</edit>
<edit name=”spacing”>
<int>0</int>
</edit>
<edit name=”hinting”>
<bool>true</bool>
</edit>
<edit name=”autohint”>
<bool>false</bool>
</edit>
<edit name=”antialias” mode=”assign”>
<bool>true</bool>
</edit>
<test compare=”more_eq” name=”pixelsize”>
<double>11</double>
</test>
<test compare=”less_eq” name=”pixelsize”>
<double>16</double>
</test>
<edit name=”antialias” mode=”assign” >
<bool>false</bool>
</edit>
</match>
</fontconfig>

其中红色为你希望添加的字体。注意要使用字体名,而不是字体文件名。双击字体用GNOME字体查看器打开,名称栏里面的就是字体名。该方法也可以解决一些变态的字体问题(比如Opera的菜单字体,怎么配置都不能配置得和其他地方一样,修改serif字体后完美解决。猜测其菜单也是默认调用serif字体的)

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/6f4f8dd4ba1ff0b2e2149b9d2a354a42.html