Centos7 安装中文字体

查看字体

[root@p0-web3]# fc-list
/usr/share/fonts/dejavu/DejaVuSansCondensed-Oblique.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Oblique,Oblique
/usr/share/fonts/dejavu/DejaVuSansCondensed-Bold.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Bold,Bold
/usr/share/fonts/dejavu/DejaVuSans.ttf: DejaVu Sans:style=Book
/usr/share/fonts/dejavu/DejaVuSans-Bold.ttf: DejaVu Sans:style=Bold
/usr/share/fonts/dejavu/DejaVuSansCondensed.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed,Book
/usr/share/fonts/dejavu/DejaVuSans-ExtraLight.ttf: DejaVu Sans,DejaVu Sans Light:style=ExtraLight
/usr/share/fonts/dejavu/DejaVuSansCondensed-BoldOblique.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Bold Oblique,Bold Oblique
/usr/share/fonts/dejavu/DejaVuSans-Oblique.ttf: DejaVu Sans:style=Oblique
/usr/share/fonts/chinese/simfang.ttf: FangSong:style=Regular,Normaali
/usr/share/fonts/dejavu/DejaVuSans-BoldOblique.ttf: DejaVu Sans:style=Bold Oblique
[root@p0-dabaojian-jcsszy-web33 TrueType]# 

安装工具

yum install -y fontconfig mkfontscale

apt-get -y install fontconfig xfonts-utils
将windows下的字体C:\WINDOWS\FONTS\simsun.ttc(也就是宋体,大小为10M)拿出来;
重命为simfang.ttf ,拷贝simfang.ttf 字体到 /usr/share/fonts/chinese/TrueType/ 下来
fc-cache -fv 刷新字体缓存

gan

[root@p0-bingo-jcsszy-web34 ~]# mkdir /usr/share/fonts/chinese/ && cd /usr/share/fonts/chinese/
[root@p0-bingo-jcsszy-web34 chinese]# wget https://mirrors.xxxhealthcare.com/update_files/SCxxxxxx/simfang.ttf
Saving to: ‘simfang.ttf’

100%[=============================================================================================================================>] 10,578,152  --.-K/s   in 0.1s    

2021-11-24 19:04:31 (70.8 MB/s) - ‘simfang.ttf’ saved [10578152/10578152]

[root@p0-bingo-jcssdabaojianzy-web34 chinese]# ls
simfang.ttf  simsun.ttf
[root@p0-bingo-jcsszy-web34 chinese]# mkfontscale
[root@p0-bingo-jcsszy-web34 chinese]# mkfontdir
[root@p0-bingo-jcsszy-web34 chinese]# fc-cache
[root@p0-bingo-jcsszy-web34 chinese]# fc-list
/usr/share/fonts/dejavu/DejaVuSansCondensed-Oblique.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Oblique,Oblique
/usr/share/fonts/dejavu/DejaVuSansCondensed-Bold.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Bold,Bold
/usr/share/fonts/chinese/simsun.ttf: SimSun,宋体:style=Regular,常规
/usr/share/fonts/dejavu/DejaVuSans.ttf: DejaVu Sans:style=Book
/usr/share/fonts/chinese/simsun.ttf: NSimSun,新宋体:style=Regular,常规
/usr/share/fonts/dejavu/DejaVuSans-Bold.ttf: DejaVu Sans:style=Bold
/usr/share/fonts/dejavu/DejaVuSansCondensed.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed,Book
/usr/share/fonts/dejavu/DejaVuSans-ExtraLight.ttf: DejaVu Sans,DejaVu Sans Light:style=ExtraLight
/usr/share/fonts/dejavu/DejaVuSansCondensed-BoldOblique.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Bold Oblique,Bold Oblique
/usr/share/fonts/dejavu/DejaVuSans-Oblique.ttf: DejaVu Sans:style=Oblique
/usr/share/fonts/chinese/simfang.ttf: FangSong:style=Regular,Normaali
/usr/share/fonts/dejavu/DejaVuSans-BoldOblique.ttf: DejaVu Sans:style=Bold Oblique

你可能感兴趣的:(linux)