CentOS 修改系统字体 - XiZi's Blog

CentOS 修改系统字体

Xizi posted @ 2013年4月07日 18:01 in 未分类 with tags font local.conf centos , 9777 阅读

1、添加字体

 

#创建新的字体存放文件夹
mkdir /usr/share/fonts/chinese
#拷贝新字体到新文件夹
cp newfont.ttf /usr/share/fonts/chinese
cd /usr/share/fonts/chinese
#修复字体字体权限(这里比较重要,否则可能字体访问出错)
chmod 644 *.ttf
#更新字体
mkfontscale
mkfontdir
fc-cache -fv

2、配置字体,下面是/etc/fonts/local.conf的一个示例,这里替换字体为微软雅黑

 

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
	<match target="pattern">
		<test qual="any" name="family">
			<string>serif</string>
		</test>
		<edit name="family" mode="prepend" binding="strong">
			<string>DejaVu Serif</string>
			<string>YaHei Consolas Hybrid</string>
			<string>AR PL UMing CN</string>
			<string>AR PL ShanHeiSun Uni</string>
			<string>WenQuanYi Bitmap Song</string>
			<string>Bitstream Vera 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>DejaVu Sans</string>
			<string>YaHei Consolas Hybrid</string>
			<string>Bitstream Vera Sans</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>DejaVu Sans Mono</string>
			<string>YaHei Consolas Hybrid</string>
			<string>Bitstream Vera Sans Mono</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>

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter
Host by is-Programmer.com | Power by Chito 1.3.3 beta | © 2007 LinuxGem | Design by Matthew "Agent Spork" McGee