centos下使用win中文字体解决方案,centos中文字体
centos下使用win中文字体解决方案,centos中文字体
在linux下添加支持中文字体,中文字体的获取可以从windows平台的字体库中找到,windows下的C:windowsfonts下面有你想要的字体,比如simsun.ttc<简体中文>等字体。
centos下的字体库存放位置:/usr/share/fonts
具体操作步骤:
================================
1.在/usr/share/fonts/chinese文件夹下创建一个文件夹(windows)
[root@localhost~]#mkdir/usr/share/fonts/chinese/windows
2.把从windows中找出的字体复制到windows文件夹中,再为windows文件夹更改权限
[root@localhost~]#chmod-R755/usr/share/fonts/chinese/windows
3.在字体目录<windows>中执行ttmkfdir命令
[root@localhostwindows]#ttmkfdir-e/usr/share/X11/fonts/encodings/encodings.dir
4.更改fonts.conf文件
[root@localhost~]#vi/etc/fonts/fonts.conf
然后添加如下一行;
/usr/share/fonts/chinese/windows
添加位置如下:
<!--Fontdirectorylist-->
<dir>/usr/share/fonts/chinese/windows</dir>#新加内容
<dir>/usr/share/fonts</dir>
5.重启xfs服务器
[root@localhost~]#servicexfsrestart
6.查看字体有没有添加成功
[root@localhost~]#fc-list:lang=zh-cn
新宋体,NSimSun:Regular
宋体,SimSun:Regular#字体添加成功
文鼎PL中楷Uni,ARPLZenKaiUni:Medium
文鼎PL细上海宋Uni,ARPLShanHeiSunUni,文鼎PL細上海宋Uni:Regular
至此,在linux添加支持中文字体成功
评论暂时关闭