2009年10月27日火曜日

毛筆フォントのインストール

要約

年賀状のシーズンが近づいているので、フリーの毛筆フォントをインストールしてみた。

参考文献

http://park15.wakwak.com/~unixlife/linux/de-font2.html

必要なパッケージ

http://musashi.or.tv/ からリンクをたどり、http://musashi.or.tv/kouzanmouhitufont.htm の「ダウンロード」の箇所から、Windows TrueTypeフォントのダウンロードをクリックし、KouzanMouhituFont.zip をダウンロードする。

作業内容

このパッケージに入っているフォントのファイル名は shift-jis になっている。そこで gnome-terminal を起動し、「端末(T)」、「文字コードの設定(C)」、「ユーザー定義(SHIFT-JIS)」を選択する。そうしておいてから、以下のようにパッケージを展開する。

$ cd work
$ mkdir aoyagi-kozan
$ cd aoyagi-kozan
$ cp ~/ダウンロード/KouzanMouhituFont.zip .
$ unzip KouzanMouhituFont.zip
$ mv 衡山毛筆フォント.ttf KozanMohituFont.ttf
そして、フォントファイル名を日本語から ascii コードのファイル名に変えておく。こうすれば、通常の utf8 の端末でも扱える。

それから文字コードを utf8 にした端末で、以下のようにインストールする。

$ su
# cd /usr/share/fonts/truetype/
# mkdir kozan
# cd kozan
# cp /home/fumi/work/aoyagi-kozan/KozanMohituFont.ttf .
# cd /etc/defoma/hints/
# defoma-hints truetype \
/usr/share/fonts/truetype/kozan/KozanMohituFont.ttf > KozanMohituFont.hints
# defoma-font -vt register-all KozanMohituFont.hints 
# fc-cache -f -v

0 件のコメント:

コメントを投稿