当前位置:首页 > linux基础 > 正文内容

centos-7 添加字库

4年前 (2021-04-14)linux基础1969




安装 字体库

yum groupinstall "fonts"

yum -y install fontconfig mkfontscale ttmkfdir



安装 source-code-pro 字体

下载ZIP包:sudo wget https://github.com/downloads/adobe-fonts/source-code-pro/SourceCodePro_FontsOnly-1.013.zip

解压:sudo unzip SourceCodePro_FontsOnly-1.013.zip

创建目录:sudo mkdir ~/.fonts

拷贝字体:sudo cp ./SourceCodePro_FontsOnly-1.013/OTF/* ~/.fonts/

生成新的字体缓存:fc-cache -f -v



添加windows 字库


1、先从你本机 C:\Windows\Fonts 拷贝或者网络上下载你想要安装的字体文件(*.ttf文件)到 /usr/share/fonts/windows


2、修改字体文件的权限,使root用户以外的用户也可以使用


cd /usr/share/fonts/windows

chmod 755 *.ttf


 

搜索目录中所有的字体信息,并汇总生成 fonts.scale 文件

ttmkfdir -e /usr/share/X11/fonts/encodings/encodings.dir




在 Font directory list 的部分,添加 1 行,内容为 <dir>/usr/share/fonts/windows/</dir>

vim /etc/fonts/fonts.conf

<!-- Font directory list -->

 <dir>/usr/share/fonts</dir>

 <dir>/usr/share/X11/fonts/Type1</dir> <dir>/usr/share/X11/fonts/TTF</dir> <dir>/usr/local/share/fonts</dir>

 <dir>/usr/share/fonts/windows/</dir>

 <dir prefix="xdg">fonts</dir>

 <!-- the following element will be removed in the future -->

 <dir>~/.fonts</dir>


3、建立字体缓存


mkfontscale #(如果提示 mkfontscale: command not found,需自行安装 # yum install mkfontscale )

mkfontdir 

fc-cache

fc-cache -fv 


“centos-7 添加字库” 的相关文章

CentOS7系统服务

1:Linux运行级别1.1.运行级别就是操作系统当前正在运行的功能级别System V init运行级别systemd目标名称作用0runlevel0.target, poweroff.target关机1runlevel1.target, rescue.target单用户模式2runlevel2....

sersync实时同步

sersync实时同步

实时同步概述实时同步是一种只要当前目录发生变化则会触发一个事件,事件触发后会将变化的目录同步至远程服务器。保证数据的连续性, 减少人力维护成本,解决nfs单点故障实时同步工具选择sersync+rsync(√)、inotify+rsyncInotify是一个通知接口,用来监控文件系统的各种变化,如果...

Shell介绍(三)if判断,case控制,for循环,while循环,流程控制语句

if判断单分支if [你有房] then     我就嫁给你 fi多分支if [ 你有房 ] then     我就嫁给你 else   &nbs...

Shell介绍(四)条件表达式,字符串比对

条件表达式[ ]======test   []常用[ -f file ] 文件是否存在 且为普通文件 重点[ -e file ] 文件存在则为真[ -d file ] 目录存在则为真 重点[ -x file ] 文件有执行权限则为真[ -w file ] 文件可写则为真[...

自动化运维(一)Ansible安装及模块的使用

自动化运维(一)Ansible安装及模块的使用

1:Ansible安装1.什么是AnsibleAnsible是python 中的一套模块,系统中的一套自动化工具,只需要使用ssh协议连接及可用来系统管理、自动化执行命令等任务。2.Ansible优势1、ansible不需要单独安装客户端,也不需要启动任何服务2、ansible是python中的一套...

自动化运维(四)Ansible Playbook Roles的使用

自动化运维(四)Ansible Playbook Roles的使用

ansible roles 角色适合大规模使用playbook如果文件较多的情况,不清楚哪些主机执行了哪些状态的yml文件roles能清楚哪些主机应用哪些角色1.roles官方目录的结构[root@m01 roles]# mkdir {nfs,rsync,web}/{v...