物欲投げ捨てblog

ぅぉぉぉぉぉ( ‘д‘⊂彡☆))[物欲]

Chromebook の Linux環境(crostini) フォント変更

chrome.hatenablog.jp の続き。システムフォントをUDEV Gothicに変更してみた(´・ω・`)


  • フォントをダウンロード

    • github.com
    • ChromeOS側でダウンロードして、ファイルアプリの”Linux ファイル"に配置するのが楽
  • 解凍

unzip UDEVGothic_v1.0.0.zip
  • (必要なら)フォントviewerを入れる
# インストール
sudo apt install gnome-font-viewer
# フォント確認例
gnome-font-viewer UDEVGothic_v1.0.0/UDEVGothic-Regular.ttf
# UDEV Gothicの中でもいくつかタイプがあるが、とりあえずJPDOC版を入れた
# sudo mv UDEVGothic_v1.0.0 /usr/share/fonts/ のようにファイルを配置
# 以下配置結果
$ ls /usr/share/fonts/UDevGothicJPDOC/
UDEVGothicJPDOC-BoldItalic.ttf  UDEVGothicJPDOC-Italic.ttf
UDEVGothicJPDOC-Bold.ttf        UDEVGothicJPDOC-Regular.ttf
  • フォントキャッシュ更新
fc-cache -fv
  • フォント名確認

"UDEV Gothic JPDOC"がフォント名だと分かる

$ fc-list | grep JPDOC
/usr/share/fonts/UDevGothicJPDOC/UDEVGothicJPDOC-BoldItalic.ttf: UDEV Gothic JPDOC:style=Bold Italic
/usr/share/fonts/UDevGothicJPDOC/UDEVGothicJPDOC-Bold.ttf: UDEV Gothic JPDOC:style=Bold
/usr/share/fonts/UDevGothicJPDOC/UDEVGothicJPDOC-Italic.ttf: UDEV Gothic JPDOC:style=Italic
/usr/share/fonts/UDevGothicJPDOC/UDEVGothicJPDOC-Regular.ttf: UDEV Gothic JPDOC:style=Regular
  • システムフォント変更

~/.config/fontconfig/fonts.conf を編集。前回MotoyaLMaruと書いた部分をUDEV Gothic JPDOCに変更した。

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<!-- Default serif fonts -->
 <match target="pattern">
   <test qual="any" name="family"><string>serif</string></test>
   <edit name="family" mode="prepend" binding="same"><string>UDEV Gothic JPDOC</string> </edit>
 </match>
 <match target="pattern">
   <test qual="any" name="family"><string>sans-serif</string></test>
   <edit name="family" mode="prepend" binding="same"><string>UDEV Gothic JPDOC</string> </edit>
 </match>
 <match target="pattern">
   <test qual="any" name="family"><string>monospace</string></test>
   <edit name="family" mode="prepend" binding="same"><string>UDEV Gothic JPDOC</string> </edit>
 </match>
</fontconfig>
  • VSCodeを起動してフォントが更新されたのを確認
    • 全角空白を入力すると差がわかりやすい(UDEV Gothicだと点線の四角で表示される)

フォント変更完了。もし慣れなかったらMotoyaLMaruに戻せばOK(´・ω・`)