使用fontforge就能將otf轉ttf. openoffice 還是以ttf 字型為主.
所以還是轉成ttf字型較方便.
fontforge 要寫一個script比較好轉.
$ cat otf2ttf.sh
-------------------------------------
#!/usr/bin/fontforge
# Quick and dirty hack: converts a font to truetype (.ttf)
Print("Opening "+$1);
Open($1);
Print("Saving "+$1:r+".ttf");
Generate($1:r+".ttf");
Quit(0);
-----------------------
單檔轉換:
fontforge -script otf2ttf.sh FONTNAME.otf
多檔轉換:
for i in *.otf; do fontforge -script otf2ttf.sh $i; done
===================================
安裝新字型
[root@nana ~]# cd /usr/share/fonts
[root@nana fonts]# mkdir radiospace
[root@nana fonts]# cd radiospace/
[root@nana radiospace]# mv /home/vincent/ttf_font/*.ttf .
[root@nana radiospace]# ll
總計 204
-rw-rw-rw- 1 vincent vincent 29532 9月 2 2002 Radiofbi.ttf
-rw-rw-rw- 1 vincent vincent 33428 9月 2 2002 Radiofb.ttf
-rw-rw-rw- 1 vincent vincent 34528 9月 2 2002 Radiofc.ttf
-rw-rw-rw- 1 vincent vincent 29808 9月 2 2002 Radiofi.ttf
-rw-rw-rw- 1 vincent vincent 45632 9月 2 2002 Radiof.ttf
[root@nana radiospace]# pwd
/usr/share/fonts/radiospace
[root@nana radiospace]# fc-cache -v /usr/share/fonts/radiospace
/usr/share/fonts/radiospace: caching, 5 fonts, 0 dirs
/var/cache/fontconfig: cleaning cache directory
/var/cache/fontconfig: 3830d5c3ddfd5cd38a049b759396e72e-x86.cache-2: cache outdated: /usr/share/fonts
/root/.fontconfig: not cleaning unwritable cache directory
fc-cache: succeeded
安裝完成,列出字型
[root@nana radiospace]# fc-list
沒有留言:
張貼留言