linux服务器添加字体(宋体)

1、检查是否安装字体库,

[root@yuliu fonts]# fc-list
/usr/share/fonts/ucs-miscfixed/6x12.bdf: Fixed:style=SemiCondensed
/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/default/Type1/c059016l.pfb: Century Schoolbook L:style=Bold
/usr/share/fonts/ucs-miscfixed/6x13.bdf: Fixed:style=SemiCondensed
/usr/share/fonts/liberation/LiberationSerif-Italic.ttf: Liberation Serif:style=Italic
/usr/share/fonts/open-sans/OpenSans-Semibold.ttf: Open Sans,Open Sans Semibold:style=Semibold,Regular
/usr/share/fonts/dejavu/DejaVuSerif-Italic.ttf: DejaVu Serif:style=Italic
/usr/share/fonts/open-sans/OpenSans-LightItalic.ttf: Open Sans,Open Sans Light:style=Light Italic,Italic
/usr/share/fonts/default/Type1/c059033l.pfb: Century Schoolbook L:style=Italic
/usr/share/fonts/ucs-miscfixed/10x20.bdf: Fixed:style=Regular
/usr/share/fonts/nhn-nanum/NanumGothic.ttf: NanumGothic,나눔고딕:style=Regular
/usr/share/fonts/default/Type1/p052024l.pfb: URW Palladio L:style=Bold Italic
/usr/share/fonts/default/Type1/d050000l.pfb: Dingbats:style=Regular
/usr/share/fonts/madan/madan.ttf: Madan:style=Regular
/usr/share/fonts/ucs-miscfixed/8x13.bdf: Fixed:style=Regular
/usr/share/fonts/paktype-naskh-basic/PakTypeNaskhBasic.ttf: PakType Naskh Basic:style=Regular
/usr/share/fonts/default/Type1/s050000l.pfb: Standard Symbols L:style=Regular
[root@yuliu fonts]# 
[root@yuliu fonts]#

2、如果提示命令不存在,说明还没有安装体字体库,使用yum源进行安装

yum -y install fontconfig

3、从windows的C:\Windows\Fonts下获取相应字体
在这里插入图片描述
4、将字体文件上传到服务器

[root@yuliu fonts]# ls -l /usr/share/fonts/chinese/
total 17788
-rw-r--r-- 1 root root 18214352 Sep 29  2017 simsun.ttc

5、安装

[root@yuliu chinese]# fc-cache -fv
/usr/share/fonts: caching, new cache contents: 0 fonts, 40 dirs
/usr/share/fonts/abattis-cantarell: caching, new cache contents: 4 fonts, 0 dirs
/usr/share/fonts/chinese: caching, new cache contents: 2 fonts, 0 dirs
/usr/share/fonts/cjkuni-uming: caching, new cache contents: 4 fonts, 0 dirs
/usr/share/fonts/default: caching, new cache contents: 0 fonts, 2 dirs
/usr/share/fonts/default/Type1: caching, new cache contents: 35 fonts, 0 dirs
/usr/share/fonts/default/ghostscript: caching, new cache contents: 4 fonts, 0 dirs
/usr/share/fonts/dejavu: caching, new cache contents: 21 fonts, 0 dirs
/usr/share/fonts/gnu-free: caching, new cache contents: 12 fonts, 0 dirs
/usr/share/fonts/google-crosextra-caladea: caching, new cache contents: 4 fonts, 0 dirs
/usr/share/fonts/google-crosextra-carlito: caching, new cache contents: 4 fonts, 0 dirs
/usr/share/fonts/jomolhari: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/khmeros: caching, new cache contents: 3 fonts, 0 dirs
/usr/share/fonts/liberation: caching, new cache contents: 12 fonts, 0 dirs
/usr/share/fonts/lklug: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-assamese: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-bengali: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-devanagari: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-gujarati: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-kannada: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-malayalam: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-marathi: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-nepali: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-oriya: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-punjabi: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-tamil: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-telugu: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/madan: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/nhn-nanum: caching, new cache contents: 3 fonts, 0 dirs
/usr/share/fonts/open-sans: caching, new cache contents: 10 fonts, 0 dirs
/usr/share/fonts/overpass: caching, new cache contents: 8 fonts, 0 dirs
/usr/share/fonts/paktype-naskh-basic: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/paratype-pt-sans: caching, new cache contents: 6 fonts, 0 dirs
/usr/share/fonts/sil-abyssinica: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/sil-nuosu: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/sil-padauk: caching, new cache contents: 2 fonts, 0 dirs
/usr/share/fonts/smc: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/stix: caching, new cache contents: 4 fonts, 0 dirs
/usr/share/fonts/thai-scalable: caching, new cache contents: 4 fonts, 0 dirs
/usr/share/fonts/ucs-miscfixed: caching, new cache contents: 23 fonts, 0 dirs
/usr/share/fonts/vlgothic: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/wqy-microhei: caching, new cache contents: 2 fonts, 0 dirs
/usr/share/fonts/wqy-zenhei: caching, new cache contents: 3 fonts, 0 dirs
/usr/share/X11/fonts/Type1: caching, new cache contents: 13 fonts, 0 dirs
/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: caching, new cache contents: 0 fonts, 40 dirs
/usr/share/X11/fonts/Type1: caching, new cache contents: 13 fonts, 0 dirs
/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
/var/cache/fontconfig: cleaning cache directory
/root/.cache/fontconfig: not cleaning non-existent cache directory
/root/.fontconfig: not cleaning non-existent cache directory
fc-cache: succeeded
[root@yuliu chinese]#

6、刷新内存,如果不行就需要重启服务器

[root@yuliu chinese]# fc-cache

7、查看是否安装完成

[root@yuliu chinese]# fc-list 
/usr/share/fonts/ucs-miscfixed/6x12.bdf: Fixed:style=SemiCondensed
/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/default/Type1/c059016l.pfb: Century Schoolbook L:style=Bold
/usr/share/fonts/ucs-miscfixed/6x13.bdf: Fixed:style=SemiCondensed
/usr/share/fonts/liberation/LiberationSerif-Italic.ttf: Liberation Serif:style=Italic
/usr/share/fonts/open-sans/OpenSans-Semibold.ttf: Open Sans,Open Sans Semibold:style=Semibold,Regular
/usr/share/fonts/dejavu/DejaVuSerif-Italic.ttf: DejaVu Serif:style=Italic
/usr/share/fonts/open-sans/OpenSans-LightItalic.ttf: Open Sans,Open Sans Light:style=Light Italic,Italic
/usr/share/fonts/default/Type1/c059033l.pfb: Century Schoolbook L:style=Italic
/usr/share/fonts/ucs-miscfixed/10x20.bdf: Fixed:style=Regular
/usr/share/fonts/nhn-nanum/NanumGothic.ttf: NanumGothic,나눔고딕:style=Regular
/usr/share/fonts/default/Type1/p052024l.pfb: URW Palladio L:style=Bold Italic
/usr/share/fonts/default/Type1/d050000l.pfb: Dingbats:style=Regular
/usr/share/fonts/madan/madan.ttf: Madan:style=Regular
/usr/share/fonts/ucs-miscfixed/8x13.bdf: Fixed:style=Regular
/usr/share/fonts/paktype-naskh-basic/PakTypeNaskhBasic.ttf: PakType Naskh Basic:style=Regular
/usr/share/fonts/default/Type1/s050000l.pfb: Standard Symbols L:style=Regular
/usr/share/fonts/liberation/LiberationSans-Bold.ttf: Liberation Sans:style=Bold
/usr/share/fonts/liberation/LiberationMono-Bold.ttf: Liberation Mono:style=Bold
/usr/share/fonts/default/Type1/n021003l.pfb: Nimbus Roman No9 L:style=Regular
/usr/share/fonts/gnu-free/FreeMonoBold.ttf: FreeMono:style=Bold,получерен,negreta,tučné,fed,Fett,Έντονα,Negrita,Lihavoitu,Gras,Félkövér,Grassetto,Vet,Halvfet,Pogrubiony,Negrito,gros,Полужирный,Fet,Kalın,huruf tebal,жирний,polkrepko,treknraksts,pusjuodis,đậm,Lodia,धृष्ट
/usr/share/fonts/wqy-microhei/wqy-microhei.ttc: WenQuanYi Micro Hei Mono,文泉驛等寬微米黑,文泉驿等宽微米黑:style=Regular
/usr/share/fonts/paratype-pt-sans/PTS75F.ttf: PT Sans:style=Bold
/usr/share/fonts/default/Type1/a010013l.pfb: URW Gothic L:style=Book
/usr/share/fonts/default/Type1/n019003l.pfb: Nimbus Sans L:style=Regular
/usr/share/fonts/stix/STIX-Regular.otf: STIX:style=Regular
/usr/share/fonts/ucs-miscfixed/8x13O.bdf: Fixed:style=Oblique
/usr/share/fonts/dejavu/DejaVuSansMono-BoldOblique.ttf: DejaVu Sans Mono:style=Bold Oblique
/usr/share/fonts/sil-padauk/Padauk.ttf: Padauk:style=Regular
/usr/share/fonts/paratype-pt-sans/PTN57F.ttf: PT Sans Narrow:style=Regular
/usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc: WenQuanYi Zen Hei Sharp,文泉驛點陣正黑,文泉驿点阵正黑:style=Regular
/usr/share/fonts/dejavu/DejaVuSansCondensed-Oblique.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Oblique,Oblique
/usr/share/fonts/open-sans/OpenSans-ExtraBoldItalic.ttf: Open Sans,Open Sans Extrabold:style=Extrabold Italic,Italic
/usr/share/fonts/dejavu/DejaVuSansCondensed-Bold.ttf: DejaVu Sans,DejaVu Sans Condensed:style=Condensed Bold,Bold
/usr/share/fonts/dejavu/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
/usr/share/fonts/default/Type1/a010033l.pfb: URW Gothic L:style=Book Oblique
/usr/share/fonts/lohit-gujarati/Lohit-Gujarati.ttf: Lohit Gujarati:style=Regular
/usr/share/fonts/liberation/LiberationSerif-BoldItalic.ttf: Liberation Serif:style=Bold Italic
/usr/share/fonts/thai-scalable/Waree-Bold.ttf: Waree:style=Bold
/usr/share/fonts/open-sans/OpenSans-Bold.ttf: Open Sans:style=Bold
/usr/share/fonts/thai-scalable/Waree-BoldOblique.ttf: Waree:style=BoldOblique
/usr/share/fonts/lohit-punjabi/Lohit-Punjabi.ttf: Lohit Punjabi:style=Regular
/usr/share/fonts/khmeros/KhmerOS_sys.ttf: Khmer OS System:style=Regular
/usr/share/fonts/chinese/simsun.ttc: SimSun,宋体:style=Regular,常规
要在Linux服务器上安装宋体字体,可以按照以下步骤进行操作: 1. 首先,需要确认是否已经安装了字体支持库。通过运行命令`yum -y install fontconfig`安装字体支持库。如果提示命令不存在,说明字体支持库尚未安装。需要通过yum源来安装。 2. 接下来,需要获取宋体字体文件。在Windows系统中,宋体字体文件通常位于C:\Windows\Fonts目录下。将该字体文件(simsun.ttc)复制到Linux服务器的桌面上,以便进行配置。 3. 然后,登录到Linux服务器,打开终端。 4. 在终端中,导航到桌面目录,找到复制的宋体字体文件。 5. 将宋体字体文件移动到字体目录中,可以使用以下命令: `sudo mv /path/to/simsun.ttc /usr/share/fonts` 这将把宋体字体文件移动到/usr/share/fonts目录下。 6. 完成移动后,需要更新字体缓存。可以使用以下命令: `sudo fc-cache -f -v` 这将刷新字体缓存,并使新安装的字体生效。 7. 安装完成后,可以在Linux服务器上使用宋体字体了。 请注意,以上步骤假设您已经具备sudo权限或者以root用户身份登录到Linux服务器。另外,如果您的Linux发行版不是基于yum包管理系统,请相应地调整安装字体支持库的方式。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [Linux安装宋体](https://blog.csdn.net/fenfenguai/article/details/123135380)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [linux服务器添加字体(宋体)](https://blog.csdn.net/bjywxc/article/details/107908130)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值