centos存放中文字体
时间: 2024-06-06 20:04:15 浏览: 13
CentOS 默认情况下可能没有预装中文字体,但可以通过以下步骤安装和配置:
1. 安装中文字体包:
```
sudo yum install -y fontconfig mkfontscale
sudo yum install -y https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
```
2. 配置字体文件路径:
在 /etc/fonts/conf.d/ 目录下创建一个名为 65-wqy.conf 的文件,并添加以下内容:
```
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<dir>/usr/share/fonts/wenquanyi/wqy-microhei</dir>
<dir>/usr/share/fonts/wenquanyi/wqy-zenhei</dir>
</fontconfig>
```
3. 更新字体缓存:
```
sudo fc-cache -fv
```
这样就可以在 CentOS 中使用中文字体了。若要查看已安装的中文字体,可使用以下命令:
```
fc-list :lang=zh
```
相关问题
centos安装中文字体
在 CentOS 中安装中文字体可以按照以下步骤进行:
1. 安装中文字体包:
```bash
sudo yum install -y fontconfig fontconfig-devel
sudo yum install -y libXft libXft-devel
sudo yum install -y wqy-zenhei-fonts
```
2. 配置字体:
```bash
sudo vim /etc/fonts/local.conf
```
在文件中添加以下内容:
```xml
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<dir>/usr/share/fonts/wqy-zenhei</dir>
<match target="font">
<test name="family">
<string>wqy-zenhei</string>
</test>
<edit name="fontconfig:spacing" mode="assign">
<int>0</int>
</edit>
</match>
</fontconfig>
```
3. 更新字体缓存:
```bash
sudo fc-cache -fv
```
安装完成后,您就可以在 CentOS 中使用中文字符了。如果您需要进一步的帮助,请随时提问。
centos7安装中文字体
在CentOS 7中安装中文字体可以按照以下步骤进行操作:
1. 首先确保你具有root权限或者sudo权限,以便执行以下操作。
2. 使用以下命令安装字体库:
```
sudo yum install fontconfig
```
3. 接下来,下载中文字体包,可以从官方网站或其他可靠来源获取。假设你已经下载了一个名为"chinese-fonts.tar.gz"的压缩包。
4. 解压缩下载的字体包:
```
tar -zxvf chinese-fonts.tar.gz
```
5. 进入解压后的文件夹:
```
cd chinese-fonts
```
6. 安装字体:
```
sudo bash install.sh
```
7. 安装完成后,你可以在系统的字体列表中查看到新安装的中文字体。
相关推荐
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)