Linux 安装字体库(附:中文字体包)

您所在的位置:网站首页 linux中文包安装 Linux 安装字体库(附:中文字体包)

Linux 安装字体库(附:中文字体包)

2023-11-16 00:12| 来源: 网络整理| 查看: 265

文章目录 前言一、安装相关包二、配置相关信息1.导入字体包2.修改配置文件3. 刷新配置并查看字体库

前言

由于JAVA画图时常用到Font 类对象,而这样的对象依赖于本地的字段。 新装的linux没有安装字段库,和相应的字体。 所以需要进行安装

一、安装相关包 [root@mankel ~] yum -y install fontconfig [root@mankel ~] yum -y install ttmkfdir 二、配置相关信息 1.导入字体包

中文字体包下载地址

将字体包上传到/root目录下 [root@mankel ~] cd /usr/share/fonts [root@mankel ~] mkdir chinese [root@mankel ~] cd chinese [root@mankel ~] cp /root/chinese.zip ./ [root@mankel ~] unzip chinese.zip [root@mankel ~] chmod -R 755 /usr/share/fonts/chinese 2.修改配置文件 [root@mankel ~] vi /etc/fonts/fonts.conf #以下是需增添内容(供复制) /usr/share/fonts/chinese

新增一行 (红框中内容):

在这里插入图片描述

3. 刷新配置并查看字体库 #刷新 [root@mankel ~] fc-cache #查看 [root@mankel ~] fc-list


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3