Linux下安装阿里巴巴普惠字体

OS:RHEL8
首先下载需要安装的字体,我这边下载的是阿里巴巴的字体。打开https://alibabafont.taobao.com/,按照要求下载自己需要的字体。
首先安装 :fontconfig mkfontscale

yum install -y fontconfig mkfontscale

安装完毕就可以使用fc-list 命令查看系统中已经安装的字体.

fc-list
/usr/share/fonts/dejavu/DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
/usr/share/fonts/paratype-pt-sans/PTS76F.ttf: PT Sans:style=Bold Italic
/usr/share/fonts/google-droid/DroidSansHebrew-Regular.ttf: Droid Sans:style=Regular
/usr/share/fonts/julietaula-montserrat/MontserratAlternates-Bold.ttf: Montserrat Alternates:style=Bold
/usr/share/fonts/urw-base35/NimbusMonoPS-Italic.otf: Nimbus Mono PS:style=Italic
/usr/share/fonts/dejavu/DejaVuSerif-Italic.ttf: DejaVu Serif:style=Italic
/usr/share/fonts/AlibabaSans-Italic.otf: Alibaba Sans:style=Italic
/usr/share/fonts/urw-base35/D050000L.t1: D050000L:style=Regular
/usr/share/fonts/urw-base35/NimbusSansNarrow-Regular.t1: Nimbus Sans Narrow:style=Regular
/usr/share/fonts/urw-base35/NimbusSansNarrow-BoldOblique.t1: Nimbus Sans Narrow:style=Bold Oblique
/usr/share/fonts/sil-padauk/Padauk-Regular.ttf: Padauk:style=Regular
/usr/share/fonts/paktype-naskh-basic/PakTypeNaskhBasic.ttf: PakType Naskh Basic:style=Regular
/usr/share/fonts/urw-base35/NimbusMonoPS-Bold.otf: Nimbus Mono PS:style=Bold
/usr/share/fonts/liberation/LiberationSans-Bold.ttf: Liberation Sans:style=Bold
......

查看系统中已经安装的中文字体 fc-list :lang=zh

fc-list :lang=zh
/usr/share/fonts/google-noto-cjk/NotoSerifCJK-Bold.ttc: Noto Serif CJK TC:style=Bold
/usr/share/fonts/google-noto-cjk/NotoSerifCJK-Bold.ttc: Noto Serif CJK SC:style=Bold
/usr/share/fonts/google-noto-cjk/NotoSerifCJK-Bold.ttc: Noto Serif CJK JP:style=Bold
/usr/share/fonts/google-noto-cjk/NotoSerifCJK-Bold.ttc: Noto Serif CJK KR:style=Bold
/usr/share/fonts/google-droid/DroidSansFallback.ttf: Droid Sans:style=Regular
......

以上可以看到字体都放在/usr/share/fonts/这个目录下,我们将下载的字体上传到这个目录下。
进入到/usr/share/fonts/ 目录下:依次运行以下命令 建立字体索引信息,更新字体缓存。

cd /usr/share/fonts
mkfontscale
mkfontdir
fc-cache -fv

至此,字体安装完毕。可以通过fc-list :lang=zh来查看安装的字体:

fc-list :lang=zh
/usr/share/fonts/Alibaba-PuHuiTi-Bold.otf: Alibaba PuHuiTi,阿里巴巴普惠体,Alibaba PuHuiTi B,阿里巴巴普惠体 B:style=Bold
/usr/share/fonts/google-noto-cjk/NotoSerifCJK-Bold.ttc: Noto Serif CJK TC:style=Bold
/usr/share/fonts/google-noto-cjk/NotoSerifCJK-Bold.ttc: Noto Serif CJK SC:style=Bold
/usr/share/fonts/google-noto-cjk/NotoSerifCJK-Bold.ttc: Noto Serif CJK JP:style=Bold
/usr/share/fonts/google-noto-cjk/NotoSerifCJK-Bold.ttc: Noto Serif CJK KR:style=Bold
/usr/share/fonts/google-droid/DroidSansFallback.ttf: Droid Sans:style=Regular
/usr/share/fonts/Alibaba-PuHuiTi-Medium.otf: Alibaba PuHuiTi,阿里巴巴普惠体,Alibaba PuHuiTi M,阿里巴巴普惠体 M:style=Medium,Regular
/usr/share/fonts/Alibaba-PuHuiTi-Light.otf: Alibaba PuHuiTi,阿里巴巴普惠体,Alibaba PuHuiTi L,阿里巴巴普惠体 L:style=Light,Regular
/usr/share/fonts/Alibaba-PuHuiTi-Heavy.otf: Alibaba PuHuiTi,阿里巴巴普惠体,Alibaba PuHuiTi H,阿里巴巴普惠体 H:style=Heavy,Regular
/usr/share/fonts/Alibaba-PuHuiTi-Regular.otf: Alibaba PuHuiTi,阿里巴巴普惠体,Alibaba PuHuiTi R,阿里巴巴普惠体 R:style=Regular
/usr/share/fonts/google-noto-cjk/NotoSerifCJK-Regular.ttc: Noto Serif CJK TC:style=Regular
/usr/share/fonts/google-noto-cjk/NotoSerifCJK-Regular.ttc: Noto Serif CJK SC:style=Regular
/usr/share/fonts/google-noto-cjk/NotoSerifCJK-Regular.ttc: Noto Serif CJK JP:style=Regular
/usr/share/fonts/google-noto-cjk/NotoSerifCJK-Regular.ttc: Noto Serif CJK KR:style=Regular
......
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章