LoginSignup
31
18

More than 3 years have passed since last update.

iTerm2のフォントを見やすく変更してみた

Last updated at Posted at 2019-11-23

iTerm2のフォントを見やすく変更してみた

macOSにはデフォルトでTerminal.appが入っていますが、画面の設定やHotkey機能などがあるiTerm2が代わりによく使われています。

今回はインストールからフォントの設定などをまとめました。

iTerm2とは

iTerm2コマンドを入力するためのコマンドラインツールの一つで、Windowsでいうコマンドプロンプトと同じ役割を担います。

インストール方法

インストールはこちらからdownloadでソフトウェアを導入します。

スクリーンショット 2019-11-17 15.49.52.png

または、Homebrewでもインストールできます。

bash
$ brew cask install iterm2

 
インストール直後のウィンドウはこのような状態です。

スクリーンショット 2019-11-17 15.36.42.png

このままでは文字サイズが小さいですし、
自分流にアレンジしたいですよね。

早速iTerm2の各種設定についてみていきましょう!

文字サイズ・フォントの設定

今回はプログラミング用フォントのRictyに設定するため、Homebrewを用いてフォントをインストールしていきます。

Rictyは以下の特徴があります。

以下公式から引用

  • ラテン文字には Raph Levien 氏の Inconsolata が適用されます。
  • それ以外の文字には Migu 1M が適用されます。美しい M+ とロバストな IPA、そして、itouhiro 氏が改良>された視認性の高い日本語文字 (半濁音など) が使用できます。
  • 半角文字と全角文字の横幅の比が 1:2 に調整されています。
  • 全角スペースが可視化されます。
  • いくつかの全角グリフが対応する半角グリフと差別化されています。
  • en ダッシュ、em ダッシュが破断線のようになります (LaTeX での入力ミス防止のため)。

iTerm2のデフォルトはMonacoでサイズは12ptに設定されています。
スクリーンショット 2019-11-20 23.28.37.png

Rictyの導入の流れ

1.GitHubにあるパッケージを導入
brew tapはGitHubのレポジトリに存在するパッケージをインストールするコマンドです。
ここではsanematのリポジトリからfontというパッケージをインストールしています。

bash
$ brew tap sanemat/font

2.Rictyをインストール

bash
$ brew install ricty

上記のコマンドが正常にすると、次のように表示されます。

bash
$ brew install ricty
==> Installing ricty from sanemat/font
==> Installing dependencies for sanemat/font/ricty: glib, libspiro, libtool, libuninameslist, pango and fontforge
...
==> Summary
🍺  /usr/local/Cellar/ricty/4.1.1: 10 files, 26MB, built in 2 minutes 39 seconds
==> Caveats
==> glib
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> libtool
In order to prevent conflicts with Apple's own libtool we have prepended a "g"
so, you have instead: glibtool and glibtoolize.
==> fontforge
This formula only installs the command line utilities.

FontForge.app can be downloaded directly from the website:
  https://fontforge.github.io

Alternatively, install with Homebrew Cask:
  brew cask install fontforge
==> ricty
***************************************************
Generated files:
  /usr/local/opt/ricty/share/fonts/RictyDiscord-Regular.ttf
    /usr/local/opt/ricty/share/fonts/Ricty-Oblique.ttf
    /usr/local/opt/ricty/share/fonts/Ricty-Bold.ttf
    /usr/local/opt/ricty/share/fonts/RictyDiscord-Oblique.ttf
    /usr/local/opt/ricty/share/fonts/Ricty-Regular.ttf
    /usr/local/opt/ricty/share/fonts/Ricty-BoldOblique.ttf
    /usr/local/opt/ricty/share/fonts/RictyDiscord-Bold.ttf
    /usr/local/opt/ricty/share/fonts/RictyDiscord-BoldOblique.ttf
***************************************************
To install Ricty:
  $ cp -f /usr/local/opt/ricty/share/fonts/Ricty*.ttf ~/Library/Fonts/
  $ fc-cache -vf
***************************************************

最後に表示されたコマンドを、順に実行していきましょう。

3.Rictyをfontsにコピー

bash
$ cp -f /usr/local/Cellar/ricty/4.1.1/share/fonts/Ricty*.ttf ~/Library/Fonts/

cp -fに関してはこちらを参考にしてください。

4.1.1のところはインストールしたバージョンに変更してください。

またはダウンロードしたフォントはmacOSで開くとFont Book.appが開くので、そこからインストールすることもできます。
スクリーンショット 2019-11-23 12.23.55.png

4.フォントのキャッシュファイルを更新

bash
fc-cache -vf

5.iTerm2のpreference(⌘ + ,)→Profiles→Textを選択
FontからRictyに変更

スクリーンショット 2019-11-20 23.13.14.png

rictyと打つと早いです。

スクリーンショット 2019-11-20 23.13.55.png

Textではフォントサイズも変更できます。
デフォルトは12ptと小さいので18ptに変更してみます。

スクリーンショット 2019-11-20 23.40.21.png

デフォルトとの比較

出来上がった設定とデフォルトを比較してみましょう。
全角の空白が表示されフォントも大きくなり、見やすく設定されたことがわかります。

Monaco 12pt
スクリーンショット 2019-11-20 23.28.37.png

ricty 18pt
スクリーンショット 2019-11-20 23.31.35.png


コマンドラインは利用頻度がかなり高いのでこだわりの設定を模索していきたいと思いました。
今後はさらに細かい設定について投稿していきます!

31
18
0

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
31
18