阿里云开发者社区

电脑版
提示:原网页已由神马搜索转码, 内容由developer.aliyun.com提供.

centos7安装字体和中文字体

2023-12-29240
版权
版权声明:
本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《 阿里云开发者社区用户服务协议》和 《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写 侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
本文涉及的产品
简介:centos7安装字体和中文字体


1.查看自己的操作系统

加粗样式[root@localhost ~]# cat /etc/redhat-release

CentOS Linux release 7.9.2009 (Core)

[root@localhost ~]# yum install fontconfig

Package fontconfig-2.13.0-4.3.el7.x86_64 already installed and latest version

Nothing to do

[root@localhost ~]# mkfontscale

-bash: mkfontscale: command not found

如果该命令没有需要安装

[root@localhost ~]# yum install mkfontscale

[root@localhost ~]# mkfontscale

[root@localhost ~]# fc-list :lang=zh

一般情况是没有的

5.新建目录

[root@localhost ~]# ls

anaconda-ks.cfg fonts.scalejdk-8u333-linux-x64.tar.gz node-v14.13.1-linux-x64 node-v14.13.1-linux-x64.tar test

[root@localhost ~]# fc-list

可以看到很多字体但是没有中文

[root@localhost ~]# cd usr/share/fonts

-bash: cd: usr/share/fonts: No such file or directory

[root@localhost ~]# cd /usr/share/fonts

[root@localhost fonts]# ls

dejavu liberation

[root@localhost fonts]# mkdir chinese

[root@localhost fonts]# ls

chinese dejavu liberation

[root@localhost fonts]# ls

chinese dejavu liberation

[root@localhost fonts]# pwd

/usr/share/fonts

[root@localhost fonts]# cd chinese/

6.拷贝 fonts.scale 和windows上的字体到chinese文件夹中.将字体文件放在chinese目录

[root@localhost chinese]# cd ~

[root@localhost ~]# cp fonts.scale /usr/share/fonts/chinese/

7.授权,该目录及其下所有文件需要有执行权限

[root@localhost chinese]# sudo chmod -R 755 /usr/share/fonts/chinese

8.重新建立字体索引、更新缓存

cd /usr/share/fonts/Chinese

[root@localhost chinese]# mkfontscale

[root@localhost chinese]# mkfontdir

[root@localhost chinese]# fc-cache

[root@localhost chinese]#

9.查看字体是否安装成功,列出所有成功安装的字体

[root@localhost chinese]# fc-list :lang=zh

fc-list :lang=zh 注意冒号前有空格!


大功告成

相关实践学习
基于函数计算一键部署掌上游戏机
本场景介绍如何使用阿里云计算服务命令快速搭建一个掌上游戏机。
建立 Serverless 思维
本课程包括: Serverless 应用引擎的概念, 为开发者带来的实际价值, 以及让您了解常见的 Serverless 架构模式
相关文章
|
8天前
|
关系型数据库MySQLLinux
通过虚拟机进行安装Centos7.0并且安装MySQL
通过虚拟机进行安装Centos7.0并且安装MySQL
2600
|
2天前
|
消息中间件Linux
Centos安装RabbitMQ
Centos安装RabbitMQ
1033
|
2天前
|
LinuxDocker容器
Centos8安装Docker
Centos8安装Docker
1511
|
2天前
|
Linux测试技术开发工具
CentOS Linux 8使用阿里源(安装jdk11、git测试)
CentOS Linux 8使用阿里源(安装jdk11、git测试)
1311
|
3天前
|
存储Linux数据安全/隐私保护
Centos安装
Centos安装
1322
|
6天前
|
Linuxvr&arC语言
Linux怎样更新Centos下Gcc版本支持C17?Centos7快速安装gcc8.3.1 可支持C++17(附gcc相关链接整理)
Linux怎样更新Centos下Gcc版本支持C17?Centos7快速安装gcc8.3.1 可支持C++17(附gcc相关链接整理)
2222
|
9天前
|
关系型数据库MySQLLinux
蓝易云 - CentOS7用二进制安装MySQL5.7
以上步骤即可完成在CentOS 7上通过二进制包安装MySQL 5.7。
2122
|
1天前
|
缓存LinuxDocker
CentOS 7 下安装 Docker 及配置阿里云加速服务
CentOS 7 下安装 Docker 及配置阿里云加速服务
2300
|
2天前
|
JavaLinux
Centos安装openjdk11并配置JAVA_HOME
Centos安装openjdk11并配置JAVA_HOME
600
|
2天前
|
Linux
centos如何安装libssl-dev libsdl-dev libavcodec-dev libavutil-dev ffmpeg
centos如何安装libssl-dev libsdl-dev libavcodec-dev libavutil-dev ffmpeg
600

热门文章

最新文章