linux安装windows字体

安装字体
第一步:
sudo yum install fontconfig
sudo yum install mkfontscale

安装完命令,会自动生成出/usr/share/fonts目录

第二步:
mkdir /usr/share/fonts/chinese

第三步:
rz 字体包


[test@test chinese]$ll
total 64656
-rw-r--r-- 1 test test 16443212 Jul 25 13:02 Dengb.ttf
-rw-r--r-- 1 test test 15430284 Jul 25 13:02 Dengl.ttf
-rw-r--r-- 1 test test 16316468 Jul 25 13:02 Deng.ttf
-rw-r--r-- 1 test test 18008680 Jul 25 13:02 simsun.ttc

#第四步:
#进入刚刚上传完字体的目录,加载字体。
#下边的报错没有关系,主要看第二行,咱们得这个目录的字体加载上没有。加载的同时会扫描/etc/fonts/fonts.conf里的配置的目录,那个配置的目录下没有字体或者么有目录就会报错
[test@test chinese]$sudo fc-cache -fv
/usr/share/fonts: caching, new cache contents: 0 fonts, 2 dirs
/usr/share/fonts/chinese: caching, new cache contents: 5 fonts, 0 dirs
/usr/share/fonts/dejavu: caching, new cache contents: 9 fonts, 0 dirs
/usr/share/X11/fonts/Type1: skipping, no such directory
/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/chinese: skipping, looped directory detected
/usr/share/fonts/dejavu: skipping, looped directory detected
/usr/lib/fontconfig/cache: cleaning cache directory
/root/.cache/fontconfig: not cleaning non-existent cache directory
/root/.fontconfig: not cleaning non-existent cache directory
/usr/bin/fc-cache-64: succeeded

#第五步:
#查看中文的字体
[test@test chinese]$fc-list :lang=zh 
/usr/share/fonts/chinese/simsun.ttc: SimSun,宋体:style=Regular,常规
/usr/share/fonts/chinese/Dengl.ttf: DengXian,DengXian Light:style=Light,Regular
/usr/share/fonts/chinese/Deng.ttf: DengXian:style=Regular
/usr/share/fonts/chinese/Dengb.ttf: DengXian:style=Bold
/usr/share/fonts/chinese/simsun.ttc: NSimSun,新宋体:style=Regular,常规
posted @ 2024-07-26 15:42  wh459086748  阅读(527)  评论(0)    收藏  举报