CentOS安装中文字体

免费中文字体:https://github.com/zenozeng/Free-Chinese-Fonts

安装思源黑体

思源黑体 Github repo:https://github.com/adobe-fonts/source-han-sans/blob/master/README-CN.md

首先切换到CentOS中存放字体的文件目录 cd /usr/share/fonts/

下载压缩包:wget https://github.com/adobe-fonts/source-han-sans/releases/download/2.004R/SourceHanSansSC.zip

解压:unzip SourceHanSansSC.zip
重命名:mv OTF/ SourceHanSans/
切换到思源黑体的解压后目录里面 cd SourceHanSans
执行如下命令:

mkfontscale
mkfontdir
fc-cache -fv

验证:执行如下命令 fc-list :lang=zh, 控制台会输出如下:

[root@VM-centos ~]# fc-list :lang=zh
/usr/share/fonts/SourceHanSans/SimplifiedChinese/SourceHanSansSC-Heavy.otf: Source Han Sans SC,Source Han Sans SC Heavy:style=Heavy,Regular
/usr/share/fonts/SourceHanSans/SimplifiedChinese/SourceHanSansSC-Medium.otf: Source Han Sans SC,Source Han Sans SC Medium:style=Medium,Regular
/usr/share/fonts/SourceHanSans/SimplifiedChinese/SourceHanSansSC-Regular.otf: Source Han Sans SC:style=Regular
/usr/share/fonts/SourceHanSans/SimplifiedChinese/SourceHanSansSC-Normal.otf: Source Han Sans SC,Source Han Sans SC Normal:style=Normal,Regular
/usr/share/fonts/SourceHanSans/SimplifiedChinese/SourceHanSansSC-Light.otf: Source Han Sans SC,Source Han Sans SC Light:style=Light,Regular
/usr/share/fonts/SourceHanSans/SimplifiedChinese/SourceHanSansSC-ExtraLight.otf: Source Han Sans SC,Source Han Sans SC ExtraLight:style=ExtraLight,Regular
/usr/share/fonts/SourceHanSans/SimplifiedChinese/SourceHanSansSC-Bold.otf: Source Han Sans SC:style=Bold

安装文泉驿黑体

文泉驿黑体官方网址:http://wenq.org/wqy2/index.cgi?ZenHei
CentOS 官方软件仓库有资源
输入如下命令:yum search wqy
输出如下:

[root@VM-centos ~]# yum search wqy
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
================================== N/S matched: wqy ==================================
wqy-microhei-fonts.noarch : Compact Chinese fonts derived from Droid
wqy-unibit-fonts.noarch : WenQuanYi Unibit Bitmap Font
wqy-zenhei-fonts.noarch : WenQuanYi Zen Hei CJK Font

wqy-microhei-fonts 指代文泉驿微米黑
wqy-zenhei-fonts 指代文泉驿正黑体
安装指令 yum -y install wqy-zenhei-fonts
使用 fc-list :lang=zh | grep wqy 验证结果如下

[root@VM-centos ~]# fc-list :lang=zh | grep wqy
/usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc: WenQuanYi Zen Hei:style=Regular
/usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc: WenQuanYi Zen Hei Sharp,文泉驛點陣正黑:style=Regular
/usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc: WenQuanYi Zen Hei Mono:style=Regular
posted @ 2021-08-12 14:19  西河  阅读(370)  评论(0编辑  收藏  举报