LoginSignup
8
8

More than 3 years have passed since last update.

Nerd Fonts Patcherを使って非Nerd-Fontにパッチを当てる方法。

Last updated at Posted at 2019-09-06

Vim Deviconsで使えるフォントにするためにnerd-fontsのパッチを当てる。があまりにも読みにくいので、実行するコマンドだけを抜き出してシンプルにします。

その0.確認じゃ!

使いたいfontがすでにpatched-fontsにあるかを確認する。

https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts

ない場合は次へ。

その1.FontForgeをインストールする。

Menuから「Software Manager」を開いて検索欄に「fontforge」と打ち込み検索するとグレーの「ff」が左右ひっくり返ったようなアイコンの「Fontforge」と言うのが出てくるのでこれをインストールする。

「Software Manager」がない場合。
「Synaptic Package Manager」でもインストールできるの「Software Manager」がない場合(Ubuntuなど?)は、「Synaptic Pacage Manager」でインストールする。

その2.Nerd Fonts Patcherをダウンロードする。

> git clone https://github.com/ryanoasis/nerd-fonts.git 

もしくは「https://github.com/ryanoasis/nerd-fonts 」からダウンロードしてHome dirctoryに置く。

その3.パッチを当てる。

font-patcher~/nerd-fonts/font-patcher
パッチを当てたいフォントが/.fonts/Menlo-Regular.ttf
とする。(font-patcherはpythonファイルです。)

> fontforge -script ~/nerd-fonts/font-patcher ~/.fonts/Menlo-Regular.ttf -c

で色々

Adding 53 Glyphs from Seti-UI + Custom Set 
╢████████████████████████████████████████╟ 100%
Adding 198 Glyphs from Devicons Set 
╢████████████████████████████████████████╟ 100%
Adding 3 Glyphs from Powerline Symbols Set 
╢████████████████████████████████████████╟ 100%
Adding 4 Glyphs from Powerline Symbols Set 
╢████████████████████████████████████████╟ 100%
Adding 1 Glyphs from Powerline Extra Symbols Set 
╢████████████████████████████████████████╟ 100%
Adding 21 Glyphs from Powerline Extra Symbols Set 
╢████████████████████████████████████████╟ 100%
Adding 1 Glyphs from Powerline Extra Symbols Set 
╢████████████████████████████████████████╟ 100%
Adding 8 Glyphs from Powerline Extra Symbols Set 
╢████████████████████████████████████████╟ 100%
Adding 11 Glyphs from Pomicons Set 
╢████████████████████████████████████████╟ 100%
〜〜〜〜〜〜〜〜〜〜いろいろ〜〜〜〜〜〜〜〜〜〜
Generated: Menlo Regular Nerd Font Complete

上のようなのが出てきて、
Generated: Menlo Regular Nerd Font Completeで完了。~/nerd-font/Menlo Regular Nerd Font Complete.ttfがパッチを当てたフォントです。

ちなみに、-cは、
https://github.com/ryanoasis/nerd-fonts/blob/master/images/sankey-glyphs-combined-diagram.svg
に書かれてあるicon全てを入れるということです。
-cをつけないと例えば、powerlineのiconが使えなかったりするのでまあとにかく、-cをつけて実行しましょ。

誤字あったらコメントください。

8
8
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
8