Linux批量安装Windows字体

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

Ubuntu先安装一款小软件。具体安装细节以下。服务器

sudo apt-get install font-manager

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

建立目录(文件夹名称可自定义其余名称):google

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

复制字体到刚刚建立目录。scala

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

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

逐项执行命令。code

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权限。ip

相关文章
相关标签/搜索