本文書では、Windows Subsystem for Linux でインストールを行ったUbuntu 18.0.4でのフォントのインストールとアンインストール方法について確認します。

fontconfigのインストール

フォントの確認を行うために、fontconfigパッケージのインストールを行います。


$ sudo apt install fontconfig

fontconfigパッケージのインストールが完了するとfc-listコマンドが実行できるようになるので、fc-listコマンドを実行します。


$ fc-list
/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf: DejaVu Sans:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf: DejaVu Sans:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf: DejaVu Sans Mono:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf: DejaVu Serif:style=Book

IPAフォントのインストール/アンインストール

IPAフォントのインストール

aptコマンドを利用してIPAフォントのインストールを行うことができます。


$ sudo apt install -y fonts-ipafont

インストール後にfc-listコマンドを実行するとインストールしたIPAフォントが表示されることが確認できます。


$ fc-list
/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf: DejaVu Sans:style=Book
/usr/share/fonts/opentype/ipafont-mincho/ipam.ttf: IPA明朝,IPAMincho:style=Regular
/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf: DejaVu Sans:style=Bold
/usr/share/fonts/opentype/ipafont-gothic/ipagp.ttf: IPA Pゴシック,IPAPGothic:style=Regular
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf: DejaVu Sans Mono:style=Bold
/usr/share/fonts/opentype/ipafont-mincho/ipamp.ttf: IPA P明朝,IPAPMincho:style=Regular
/usr/share/fonts/opentype/ipafont-gothic/ipag.ttf: IPAゴシック,IPAGothic:style=Regular
/usr/share/fonts/truetype/fonts-japanese-mincho.ttf: IPA明朝,IPAMincho:style=Regular
/usr/share/fonts/truetype/fonts-japanese-gothic.ttf: IPAゴシック,IPAGothic:style=Regular
/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf: DejaVu Serif:style=Book

フォントは、/usr/share/fonts/truetype/か/usr/share/fonts/opentype/の下に保存されることがわかります。

IPAフォントのアンインストール

インストールしたIPAフォントをアンインストールすることも可能です。


$ sudo apt remove fonts-ipafont

fonts-ipafont-gothic fonts-ipafont-minchoをアンインストールするために下記のコマンドも実行します。


$ sudo apt autoremove

/usr/share/fontsディレクトリ下からIPAフォントのファイルは削除されます。