linux服务器上安装windows字体的解决方案

年金Report服务器打印报表提要字体支持,请帮忙安装下字体,字体已上传至服务器 ,路径:/home/app/chinese。

解决方案

一、上传字体

将需要安装的字体上传到服务器上,本次变更已经有同事上传到了服务器,因此跳过此步骤。

二、创建字体目录

将已上传的字体文件夹移动到/usr/share/fonts/目录下。若是单个字体文件,建议在fonts目录下创建文件夹。

[root@yunweixia.com ~]# mv /home/app/chinese/ /usr/share/fonts/

三、安装字体

刷新系统字体库:(依次执行下列命令)

[root@yunweixia.com ~]# mkfontscale
[root@yunweixia.com ~]# mkfontdir
[root@yunweixia.com ~]# fc-cache -fv
/usr/share/fonts: caching, new cache contents: 0 fonts, 5 dirs
/usr/share/fonts/chinese: caching, new cache contents: 5 fonts, 0 dirs
/usr/share/fonts/cjkuni-ukai: caching, new cache contents: 4 fonts, 0 dirs
/usr/share/fonts/cjkuni-uming: caching, new cache contents: 4 fonts, 0 dirs
/usr/share/fonts/google-noto: caching, new cache contents: 28 fonts, 0 dirs
/usr/share/fonts/google-noto-cjk: caching, new cache contents: 36 fonts, 0 dirs
/usr/share/X11/fonts/Type1: caching, new cache contents: 13 fonts, 0 dirs
/usr/share/X11/fonts/TTF: skipping, no such directory
/usr/local/share/fonts: skipping, no such directory
/root/.local/share/fonts: skipping, no such directory
/root/.fonts: skipping, no such directory
/usr/share/fonts: caching, new cache contents: 0 fonts, 5 dirs
/usr/share/X11/fonts/Type1: caching, new cache contents: 13 fonts, 0 dirs
/usr/share/X11/fonts/TTF: skipping, no such directory
/usr/local/share/fonts: skipping, no such directory
/root/.local/share/fonts: skipping, no such directory
/root/.fonts: skipping, no such directory
/var/cache/fontconfig: cleaning cache directory
/root/.cache/fontconfig: not cleaning non-existent cache directory
/root/.fontconfig: not cleaning non-existent cache directory
fc-cache: succeeded

四、扩展阅读

如果上述命令不存在,请执行如下命令安装:

[root@yunweixia.com ~]# yum install mkfontscale
[root@yunweixia.com ~]# yum install mkfontdir
[root@yunweixia.com ~]# yum install fontconfig

原创文章,作者:运维侠,如若转载,请注明出处:https://www.yunweixia.com/solutions/linux-server-install-windows-fonts-solution.html

(0)
运维侠的头像运维侠共建用户
上一篇 2025年7月18日 18:11
下一篇 2025年7月20日 18:11

相关推荐

发表回复

登录后才能评论