標籤:style blog http io ar color os 使用 sp
Step 1:切換至字型下載目錄:
[[email protected] Downloads]$ ll | grep otf-rw-rw-r--. 1 Richard Richard 16676 7月 19 2011 RBNo2Light_a.otf-rw-rw-r--. 1 Richard Richard 17912 7月 19 2011 RBNo2Light.otf
Step 2:切換至root使用者:
[[email protected] Downloads]$ su密碼:[[email protected] Downloads]#
Step 3:建立/usr/share/fonts/default/TrueType目錄
[[email protected] Downloads]# mkdir /usr/share/fonts/default/TrueType
Step 4:把字型拷貝到建立的目錄下
[[email protected] Downloads]# cp RBNo2Light*.otf /usr/share/fonts/default/TrueType/
Step 5:切換至字型所在目錄
[[email protected] Downloads]# cd /usr/share/fonts/default/TrueType/
Step 6:建立fonts.scale
[[email protected] TrueType]# ll總用量 40-rw-r--r--. 1 root root 16676 12月 1 20:59 RBNo2Light_a.otf-rw-r--r--. 1 root root 17912 12月 1 20:59 RBNo2Light.otf[[email protected] TrueType]# ttmkfdir [[email protected] TrueType]# ll總用量 44-rw-r--r--. 1 root root 2 12月 1 21:00 fonts.scale-rw-r--r--. 1 root root 16676 12月 1 20:59 RBNo2Light_a.otf-rw-r--r--. 1 root root 17912 12月 1 20:59 RBNo2Light.otf
Step 7:建立fonts.dir
[[email protected] TrueType]# mkfontdir [[email protected] TrueType]# ll總用量 48-rw-r--r--. 1 root root 2 12月 1 21:00 fonts.dir-rw-r--r--. 1 root root 2 12月 1 21:00 fonts.scale-rw-r--r--. 1 root root 16676 12月 1 20:59 RBNo2Light_a.otf-rw-r--r--. 1 root root 17912 12月 1 20:59 RBNo2Light.otf
Step 8: 將字型路徑添加到X Font serve 路徑(或者[[email protected] Downloads]# /usr/sbin/chkfontpath --add /usr/share/fonts/default/TrueType):
[[email protected] TrueType]# chkfontpath --add /usr/share/fonts/default/TrueType
Step 9:更新字型資訊cache
[[email protected] TrueType]# fc-cache
Step 10:查看字型
[[email protected] Downloads]$ fc-list :lang=en | grep RB/usr/share/fonts/default/TrueType/RBNo2Light.otf: RBNo2 Light:style=Regular/usr/share/fonts/default/TrueType/RBNo2Light_a.otf: RBNo2 Light Alternative :style=Regular
備忘:如果沒有chkfontpath,則安裝chkfontpath(chkfontpath依賴xfs),安裝方法如下:
Step 1: http://rpm.pbone.net/index.php3/stat/4/idpl/13943722/dir/centos_5/com/chkfontpath-1.10.1-1.1.x86_64.rpm.html下載chkfontpath-1.10.1-1.1.x86_64.rpm,然後安裝。
Step 2:rpm安裝chkfontpath(可能缺少依賴)
[[email protected] Downloads]$ chmod +x chkfontpath-1.10.1-1.1.x86_64.rpm [[email protected] Downloads]$ sudo rpm -ivh chkfontpath-1.10.1-1.1.x86_64.rpm [sudo] password for Richard: 警告:chkfontpath-1.10.1-1.1.x86_64.rpm: 頭V3 DSA/SHA1 Signature, 金鑰識別碼 e8562897: NOKEY錯誤:依賴檢測失敗: xfs 被 chkfontpath-1.10.1-1.1.x86_64 需要
Step 3:安裝xfs依賴
[[email protected] Downloads]$ sudo yum install xfs已載入外掛程式:fastestmirror, langpacks, refresh-packagekitRepository updates is listed more than once in the configurationRepository updates-debuginfo is listed more than once in the configurationRepository updates-source is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository updates-debuginfo is listed more than once in the configurationRepository updates-source is listed more than once in the configurationRepository fedora is listed more than once in the configurationRepository fedora-debuginfo is listed more than once in the configurationRepository fedora-source is listed more than once in the configurationRepository fedora is listed more than once in the configurationRepository fedora-debuginfo is listed more than once in the configurationRepository fedora-source is listed more than once in the configurationLoading mirror speeds from cached hostfile * fedora: mirrors.163.com * rpmfusion-free-rawhide: ftp.sjtu.edu.cn * rpmfusion-nonfree-rawhide: mirrors.163.com * updates: mirrors.163.com正在解決依賴關係--> 正在檢查事務---> 軟體包 xorg-x11-xfs.x86_64.1.1.1.2-4.fc20 將被 安裝--> 解決依賴關係完成依賴關係解決================================================================================ Package 架構 版本 源 大小================================================================================正在安裝: xorg-x11-xfs x86_64 1:1.1.2-4.fc20 fedora 75 k事務概要================================================================================安裝 1 軟體包總下載量:75 k安裝大小:136 kIs this ok [y/d/N]: yDownloading packages:xorg-x11-xfs-1.1.2-4.fc20.x86_64.rpm | 75 kB 00:00 Running transaction checkRunning transaction testTransaction test succeededRunning transaction (shutdown inhibited) 正在安裝 : 1:xorg-x11-xfs-1.1.2-4.fc20.x86_64 1/1 驗證中 : 1:xorg-x11-xfs-1.1.2-4.fc20.x86_64 1/1 已安裝: xorg-x11-xfs.x86_64 1:1.1.2-4.fc20 完畢!
Step 4:使用RPM安裝chkfontpath:
[[email protected] Downloads]$ sudo rpm -ivh chkfontpath-1.10.1-1.1.x86_64.rpm 警告:chkfontpath-1.10.1-1.1.x86_64.rpm: 頭V3 DSA/SHA1 Signature, 金鑰識別碼 e8562897: NOKEY準備中... ################################# [100%]正在升級/安裝... 1:chkfontpath-1.10.1-1.1 ################################# [100%][[email protected] Downloads]$
參考:http://vijayk.blogspot.jp/2005/05/how-to-install-ttfotf-fonts-in-linux.html
Fedora、CentOS install TTF/otf fonts