ubuntuにArialフォントを導入する

Ubuntu にArialを入れて、matplotlibで使えるようにする方法をメモします。

ついでに、他のフォントも同時に入れてしまいます。

mkdir ~/ms-fonts/

cd ~/ms-fonts/

wget http://downloads.sourceforge.net/corefonts/arial32.exe
wget http://downloads.sourceforge.net/corefonts/arialb32.exe
***不要ならスキップ
wget http://downloads.sourceforge.net/corefonts/andale32.exe
wget http://downloads.sourceforge.net/corefonts/comic32.exe
wget http://downloads.sourceforge.net/corefonts/courie32.exe
wget http://downloads.sourceforge.net/corefonts/georgi32.exe
wget http://downloads.sourceforge.net/corefonts/impact32.exe
wget http://downloads.sourceforge.net/corefonts/times32.exe
wget http://downloads.sourceforge.net/corefonts/trebuc32.exe
wget http://downloads.sourceforge.net/corefonts/verdan32.exe
wget http://downloads.sourceforge.net/corefonts/webdin32.exe
***
sudo dpkg-reconfigure ttf-mscorefonts-installer
sudo fc-cache


キャッシュを削除します。(python - Matplotlib cannot find basic fonts - Stack Overflow)

rm ~/.cache/matplotlib/*

動作テスト

sudo fc-match Arial