6
Go to list of users who liked
11
More than 3 years have passed since last update.
RictyフォントをWindowsで利用する
プログラミング用フォントRictyという素晴らしいフォントがあります。
Macではすんなり使えますが、Windowsだとなぜか文字間隔が広くなってしまいました。
また、Vimmerにとってきれいな環境を作ることは至上命題で、Powerlineフォントも入れたいので一緒に解決します。
なにがだめなのか
FontForgeで生成した日本語TrueTypeフォント文字幅広すぎ対策の方がすべて述べられてますが、fontforgeを通すと文字間隔が広がるようです。
Rictyフォントの作者の方もos2version_reviser.sh
という修正スクリプトを公開されていますが、自分の環境では効果がありませんでした。
環境を準備する
Linux, Mac, WSLなどで以下のプログラムを用意します
- fontforge
- fontforgeのpythonライブラリ
- fonttools
自分はWindowsなので、WSLでUbuntu 18.04を入れて以下のコマンドでサクッとインストールしました。
$ sudo apt install fontforge python-fontforge fonttools
また、Powerlineフォントを作成する方はfontpatcherをcloneしておきます。
$ git clone https://github.com/powerline/fontpatcher
修正手順
Rictyのサイトの生成方法に従ってファイルを配置します。
その後、以下のスクリプトを使い、フォントの生成と文字間隔を修正します。
# !/bin/bashrm-f Ricty*.ttf Ricty*.ttx Ricty*.ttx.baksh ricty_generator.sh autoif[-f"fontpatcher/scripts/powerline-fontpatcher"];then forRinRicty*.ttf;dopython fontpatcher/scripts/powerline-fontpatcher"$R"donefiforPinRicty*.ttf;dottx-t OS/2"$P"sed-i.bak-e's,xAvgCharWidth value="940",xAvgCharWidth value="500",'"${P%%.ttf}.ttx"mv"$P""${P%%.ttf}.orig.ttf" ttx-m"${P%%.ttf}.orig.ttf""${P%%.ttf}.ttx"done
完成
できあがったフォントをインストールして確認してみましょう。
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme