作者: whooyun发表于: 2018-03-24 17:15
Centos微软雅黑字体安装分以下几步:
1、安装fontconfig(不分先后)
2、上传windows下面的微软雅黑字体(不分先后)
3、配置微软雅黑字体
4、重启Centos服务器
下面直接贴代码,大家照着操作就可以了
[root@iZwz98n7wtqozoko9hfz2rZ ~]# fc-list [root@iZwz98n7wtqozoko9hfz2rZ ~]# cd /usr/local/ [root@iZwz98n7wtqozoko9hfz2rZ local]# ls 20170606jdk-8u131-linux-x64.rpm apache-tomcat-8.5.15 etc include lib64 MySQL-client-5.6.21-1.linux_glibc2.5.x86_64.rpm nginx-1.8.0 sbin src aegis bin games lib libexec MySQL-server-5.6.21-1.linux_glibc2.5.x86_64.rpm nginx-1.8.0 (1).tar.gz share [root@iZwz98n7wtqozoko9hfz2rZ /]# [root@iZwz98n7wtqozoko9hfz2rZ /]# yum -y install fontconfig Loaded plugins: security base | 3.7 kB 00:00 epel | 4.7 kB 00:00 epel/primary_db | 6.0 MB 00:00 extras | 3.4 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 7.0 MB 00:00 Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package fontconfig.x86_64 0:2.8.0-3.el6 will be updated ---> Package fontconfig.x86_64 0:2.8.0-5.el6 will be an update --> Finished Dependency Resolution Dependencies Resolved ==================================================================================================================================================================================== Package Arch Version Repository Size ==================================================================================================================================================================================== Updating: fontconfig x86_64 2.8.0-5.el6 base 186 k Transaction Summary ==================================================================================================================================================================================== Upgrade 1 Package(s) Total download size: 186 k Downloading Packages: fontconfig-2.8.0-5.el6.x86_64.rpm | 186 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Updating : fontconfig-2.8.0-5.el6.x86_64 1/2 Cleanup : fontconfig-2.8.0-3.el6.x86_64 2/2 Verifying : fontconfig-2.8.0-5.el6.x86_64 1/2 Verifying : fontconfig-2.8.0-3.el6.x86_64 2/2 Updated: fontconfig.x86_64 0:2.8.0-5.el6 Complete! [root@iZwz98n7wtqozoko9hfz2rZ /]# cd /usr/share/ [root@iZwz98n7wtqozoko9hfz2rZ fonts]# mkdir chinese [root@iZwz98n7wtqozoko9hfz2rZ fonts]# ls chinese [root@iZwz98n7wtqozoko9hfz2rZ fonts]# cd chinese/
配置字体
[root@iZwz98n7wtqozoko9hfz2rZ chinese]# ls MSYHBD.TTC MSYH.TTC [root@iZwz98n7wtqozoko9hfz2rZ chinese]# chmod -R 755 /usr/share/fonts/chinese [root@iZwz98n7wtqozoko9hfz2rZ chinese]# yum -y install ttmkfdir Loaded plugins: security Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package ttmkfdir.x86_64 0:3.0.9-32.1.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ==================================================================================================================================================================================== Package Arch Version Repository Size ==================================================================================================================================================================================== Installing: ttmkfdir x86_64 3.0.9-32.1.el6 base 43 k Transaction Summary ==================================================================================================================================================================================== Install 1 Package(s) Total download size: 43 k Installed size: 99 k Downloading Packages: ttmkfdir-3.0.9-32.1.el6.x86_64.rpm | 43 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : ttmkfdir-3.0.9-32.1.el6.x86_64 1/1 Verifying : ttmkfdir-3.0.9-32.1.el6.x86_64 1/1 Installed: ttmkfdir.x86_64 0:3.0.9-32.1.el6 Complete! [root@iZwz98n7wtqozoko9hfz2rZ chinese]# ttmkfdir -e /usr/share/X11/fonts/encodings/encodings.dir [root@iZwz98n7wtqozoko9hfz2rZ chinese]# vi /etc/fonts/fonts.conf [root@iZwz98n7wtqozoko9hfz2rZ chinese]#