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