Linux批量安装Windows字体

Ubuntu安装中文字体还是有些小麻烦,尤其是字体数量比较多,挨个点击安装实在是过于麻烦,网上找到解决方法,这里记录一下安装过程。

Ubuntu先安装一款小软件。具体安装细节如下。

sudo apt-get install font-manager

复制Windows 字体到Linux,Windows 字体默认位于C:\Windows\Fonts,也可以通过其他方法复制到Linux机器上面。比如WinSCP复制,或搭建FTP服务器将字体压缩后下载。

创建目录(文件夹名称可自定义其他名称):

[root@localhost ~]# mkdir /usr/share/fonts/WindowsFonts

复制字体到刚刚创建目录。

cp /home/cucer/Fonts/* /usr/share/fonts/windowsfonts/

[root@localhost ~]# cp Fonts/* /usr/share/fonts/WindowsFonts/

逐项执行命令。

mkfontscale
mkfontdir
fc-cache -fv
[root@localhost ~]# fc-cache -fv
/usr/share/fonts: caching, new cache contents: 0 fonts, 42 dirs
/usr/share/fonts/WindowsFonts: caching, new cache contents: 1188 fonts, 0 dirs
/usr/share/fonts/abattis-cantarell: caching, new cache contents: 2 fonts, 0 dirs
/usr/share/fonts/cjkuni-uming: caching, new cache contents: 4 fonts, 0 dirs
/usr/share/fonts/culmus: caching, new cache contents: 55 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/opensymbol: caching, new cache contents: 1 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, 42 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@localhost ~]#

注意:部分命令需要root权限。

转载于:https://my.oschina.net/u/1011130/blog/793024

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值