secretbase.log

.NET/C#/Pythonなど

プログラミングに最適な Ricty フォントを生成してインストールする

だいぶ前に話題になったRictyを試してみようかとふと思ったのはいいが、いつのまにか、TrueType フォントの配布を中止し、生成スクリプトのみの配布になっていたようです。
そこで、最近使っている Cygwin上で Ricty を生成しいれてみました。


Ricty 公式サイト
http://save.sys.t.u-tokyo.ac.jp/~yusa/fonts/ricty.html
f:id:cointoss1973:20110908001441p:image

環境

Cygwin 1.7.9 on Windows 7 32-bit

1. FontForgecygwin にインストールする

FontForgeをインストールする
http://sourceforge.net/projects/fontforge/files/fontforge-executables/
からファイルをダウンロードする  fontforge_cygwin-20090914.tar.bz2

$ bunzip2 fontforge_cygwin-20090914.tar.bz2 

$ tar xvf fontforge_cygwin-20090914.tar


$ ./doinstall
....(メッセージが出てきます)....

$ which fontforge
/usr/local/bin/fontforge

2. ベースとなる font をインストールする

Inconsolata のインストール http://levien.com/type/myfonts/inconsolata.html
Inconsolata.otf を Windows上にインストールします。

Migu 1M のインストール http://mix-mplus-ipa.sourceforge.jp/
Migu-1M-20110825.zip をダウンロードする
otfファイルをダブルクリックし、インストールを実行します。

$ fc-cache -fv
/usr/share/fonts: caching, new cache contents: 0 fonts, 10 dirs
/usr/share/fonts/100dpi: caching, new cache contents: 398 fonts, 0 dirs
/usr/share/fonts/75dpi: caching, new cache contents: 398 fonts, 0 dirs
/usr/share/fonts/OTF: caching, new cache contents: 23 fonts, 0 dirs
/usr/share/fonts/Speedo: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts/TTF: caching, new cache contents: 23 fonts, 0 dirs
/usr/share/fonts/Type1: caching, new cache contents: 29 fonts, 0 dirs
/usr/share/fonts/cyrillic: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts/encodings: caching, new cache contents: 0 fonts, 1 dirs
/usr/share/fonts/encodings/large: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts/misc: caching, new cache contents: 59 fonts, 0 dirs
/usr/share/fonts/util: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/ghostscript/fonts: caching, new cache contents: 52 fonts, 0 dirs
/cygdrive/c/Windows/Fonts: caching, new cache contents: 931 fonts, 0 dirs
/cygdrive/c/WINNT/Fonts: skipping, no such directory
/home/tkondou/.fonts: skipping, no such directory
/var/cache/fontconfig: cleaning cache directory
/home/tkondou/.fontconfig: not cleaning non-existent cache directory
fc-cache: succeeded
$ fc-list | grep Inconso
Inconsolata:style=Medium
$ fc-list | grep Migu
Migu 1M:style=bold
Migu 1M:style=regular

でlistに追加されたことを念のため確認。



3. Cygwin上で、Ricty の生成

現在の最新版である Ricty-3.1.1.tar.gz をダウンロードします。

$ wget http://save.sys.t.u-tokyo.ac.jp/~yusa/fonts/ricty/Ricty-3.1.1.tar.gz
$ gzip -dc Ricty-3.1.1.tar.gz | tar xvf -
Ricty/ricty_discord_patch.pe
Ricty/ricty_generator.sh

ricty_generator.shファイルを開き、fonts_dirsに下記パスを追加します。
/cygdrive/c/Windows/Fonts

# set fonts directories used in auto flag
fonts_dirs=". ${HOME}/.fonts /usr/local/share/fonts /usr/share/fonts ${HOME}/Library/Fonts /Library/Fonts /cygdrive/c/Windows/Fonts"
$ ./ricty_generator.sh auto
Ricty Generator 3.1.1

Author: Yasunori Yusa <lastname at save dot sys.t.u-tokyo.ac.jp>

This script is for generating ``Ricty'' font from Inconsolata and Migu 1M.
It requires 2-5 minutes to generate Ricty. Owing to SIL Open Font License
Version 1.1 section 5, it is PROHIBITED to distribute the generated font.

Generate modified Inconsolata
Open /cygdrive/c/Windows/Fonts/Inconsolata.otf
Generated Modified-Inconsolata-Regular.sfd
While bold-facing Inconsolata, wait a bit, maybe a bit...
Generated Modified-Inconsolata-Bold.sfd
Generate modified Migu 1M
Open /cygdrive/c/Windows/Fonts/Migu-1M-regular.ttf
While scaling Migu-1M-regular.ttf, wait a little...
Generated Modified-Migu-1M-regular.sfd
Open /cygdrive/c/Windows/Fonts/Migu-1M-bold.ttf
While scaling Migu-1M-bold.ttf, wait a little...
Generated Modified-Migu-1M-bold.sfd
Generate Ricty
While merging Modified-Inconsolata-Regular.sfd and Modified-Migu-1M-regular.sfd, wait a little more...
Generated Ricty-Regular.ttf
While merging Modified-Inconsolata-Bold.sfd and Modified-Migu-1M-bold.sfd, wait a little more...
Generated Ricty-Bold.ttf
Remove temporary files
Generated RictyDiscord-Regular.ttf
Generated RictyDiscord-Bold.ttf
Succeeded to generate Ricty!
$ ls *ttf
Ricty-Bold.ttf*  RictyDiscord-Bold.ttf*  RictyDiscord-Regular.ttf*  Ricty-Regular.ttf*

待つこと数分、Ricty生成できました!


4. Rictyのインストール

Windows上にインストールします。
生成したfontファイルをダブルクリックし、インストールを実行してください。

その後また下記でCygwin上に取り込みます。

$ fc-cache -fv


mintty(Cygwinのおすすめターミナル)にて、フォントの設定をRictyにするといい感じです。
フォントサイズが小さいとかけてしまうようです。

5. Windowsのテキストレンダラーを変える(gdipp)

アンチエイリアスがかかっていないので
http://code.google.com/p/gdipp/ から gdipp 0.7.6 Stable for 32-bit Windows を入れてみました。
ベータ版もあるようですが、遅いらしい。
ので一回アンインストールしてもう一度Stableの方をいれてみた。体感できるほどの違いはわからないけど...



しかしフォントやテキストレンダラでで雰囲気が全般的にガらっと変わりますね。
WindowsじゃないみたいまるでMacOSLinuxのようですね(^^/
これでやる気がアップ!