フォント
フォント (オープンソース) も参照🤤
Linux でのフォントのインストール
ここでは、HackGen をインストールする。
フォントのダウンロード
$ curl -LO https://github.com/yuru7/HackGen/releases/download/v2.9.0/HackGen_NF_v2.9.0.zip
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 23.0M 100 23.0M 0 0 2776k 0 0:00:08 0:00:08 --:--:-- 3416k
$ curl -LO https://github.com/yuru7/HackGen/releases/download/v2.9.0/HackGen_v2.9.0.zip
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 38.5M 100 38.5M 0 0 3173k 0 0:00:12 0:00:12 --:--:-- 4180k
$ unzip HackGen_NF_v2.9.0.zip
Archive: HackGen_NF_v2.9.0.zip creating: HackGen_NF_v2.9.0/ inflating: HackGen_NF_v2.9.0/HackGen35ConsoleNF-Bold.ttf inflating: HackGen_NF_v2.9.0/HackGen35ConsoleNF-Regular.ttf inflating: HackGen_NF_v2.9.0/HackGenConsoleNF-Bold.ttf inflating: HackGen_NF_v2.9.0/HackGenConsoleNF-Regular.ttf
$ unzip HackGen_v2.9.0.zip
Archive: HackGen_v2.9.0.zip creating: HackGen_v2.9.0/ inflating: HackGen_v2.9.0/HackGen-Bold.ttf inflating: HackGen_v2.9.0/HackGen-Regular.ttf inflating: HackGen_v2.9.0/HackGen35-Bold.ttf inflating: HackGen_v2.9.0/HackGen35-Regular.ttf inflating: HackGen_v2.9.0/HackGen35Console-Bold.ttf inflating: HackGen_v2.9.0/HackGen35Console-Regular.ttf inflating: HackGen_v2.9.0/HackGenConsole-Bold.ttf inflating: HackGen_v2.9.0/HackGenConsole-Regular.ttf
インストール先確認 (フォントパス)
殆どの Linux ディストリビューションでは、Fontconfig が利用するフォントパスは /usr/share/fonts/
や ~/.local/share/fonts
です🤔
フォントパス | 補足 |
---|---|
/usr/share/fonts/ | OS のフォントインストール先 |
/usr/local/share/fonts | システム管理者のフォントインストール先 |
~/.local/share/fonts | ユーザーのフォントインストール先 |
~/.fonts | 非推奨 |
Fedora
$ cat /etc/fonts/fonts.conf
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> <!-- /etc/fonts/fonts.conf file to configure system font access --> <fontconfig> <description>Default configuration file</description> <!-- DO NOT EDIT THIS FILE. IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED. LOCAL CHANGES BELONG IN 'local.conf'. The intent of this standard configuration file is to be adequate for most environments. If you have a reasonably normal environment and have found problems with this configuration, they are probably things that others will also want fixed. Please submit any problems to the fontconfig issue tracking system located at fontconfig.org Note that the normal 'make install' procedure for fontconfig is to replace any existing fonts.conf file with the new version. Place any local customizations in local.conf which this file references. Keith Packard --> <!-- Font directory list --> <dir>/usr/share/fonts</dir> <dir>/usr/share/X11/fonts/Type1</dir> <dir>/usr/share/X11/fonts/TTF</dir> <dir>/usr/local/share/fonts</dir> <dir prefix="xdg">fonts</dir> <!-- the following element will be removed in the future --> <dir>~/.fonts</dir> <!-- Accept deprecated 'mono' alias, replacing it with 'monospace' --> <match target="pattern"> <test qual="any" name="family"> <string>mono</string> </test> <edit name="family" mode="assign" binding="same"> <string>monospace</string> </edit> </match> <!-- Accept alternate 'sans serif' spelling, replacing it with 'sans-serif' --> <match target="pattern"> <test qual="any" name="family"> <string>sans serif</string> </test> <edit name="family" mode="assign" binding="same"> <string>sans-serif</string> </edit> </match> <!-- Accept deprecated 'sans' alias, replacing it with 'sans-serif' --> <match target="pattern"> <test qual="any" name="family"> <string>sans</string> </test> <edit name="family" mode="assign" binding="same"> <string>sans-serif</string> </edit> </match> <!-- Accept alternate 'system ui' spelling, replacing it with 'system-ui' --> <match target="pattern"> <test qual="any" name="family"> <string>system ui</string> </test> <edit name="family" mode="assign" binding="same"> <string>system-ui</string> </edit> </match> <!-- Load local system customization file --> <include ignore_missing="yes">conf.d</include> <!-- Font cache directory list --> <cachedir>/usr/lib/fontconfig/cache</cachedir> <cachedir prefix="xdg">fontconfig</cachedir> <!-- the following element will be removed in the future --> <cachedir>~/.fontconfig</cachedir> <config> <!-- Rescan configuration every 30 seconds when FcFontSetList is called --> <rescan> <int>30</int> </rescan> </config> </fontconfig>
DietPi
$ cat /etc/fonts/fonts.conf
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <!-- /etc/fonts/fonts.conf file to configure system font access --> <fontconfig> <its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0"> <its:translateRule translate="no" selector="/fontconfig/*[not(self::description)]"/> </its:rules> <description>Default configuration file</description> <!-- DO NOT EDIT THIS FILE. IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED. LOCAL CHANGES BELONG IN 'local.conf'. The intent of this standard configuration file is to be adequate for most environments. If you have a reasonably normal environment and have found problems with this configuration, they are probably things that others will also want fixed. Please submit any problems to the fontconfig bugzilla system located at fontconfig.org Note that the normal 'make install' procedure for fontconfig is to replace any existing fonts.conf file with the new version. Place any local customizations in local.conf which this file references. Keith Packard --> <!-- Font directory list --> <dir>/usr/share/fonts</dir> <dir>/usr/local/share/fonts</dir> <dir prefix="xdg">fonts</dir> <!-- the following element will be removed in the future --> <dir>~/.fonts</dir> <!-- Accept deprecated 'mono' alias, replacing it with 'monospace' --> <match target="pattern"> <test qual="any" name="family"> <string>mono</string> </test> <edit name="family" mode="assign" binding="same"> <string>monospace</string> </edit> </match> <!-- Accept alternate 'sans serif' spelling, replacing it with 'sans-serif' --> <match target="pattern"> <test qual="any" name="family"> <string>sans serif</string> </test> <edit name="family" mode="assign" binding="same"> <string>sans-serif</string> </edit> </match> <!-- Accept deprecated 'sans' alias, replacing it with 'sans-serif' --> <match target="pattern"> <test qual="any" name="family"> <string>sans</string> </test> <edit name="family" mode="assign" binding="same"> <string>sans-serif</string> </edit> </match> <!-- Ignore dpkg temporary files created in fonts directories --> <selectfont> <rejectfont> <glob>*.dpkg-tmp</glob> </rejectfont> </selectfont> <selectfont> <rejectfont> <glob>*.dpkg-new</glob> </rejectfont> </selectfont> <!-- Load local system customization file --> <include ignore_missing="yes">conf.d</include> <!-- Font cache directory list --> <cachedir>/var/cache/fontconfig</cachedir> <cachedir prefix="xdg">fontconfig</cachedir> <!-- the following element will be removed in the future --> <cachedir>~/.fontconfig</cachedir> <config> <!-- Rescan configuration every 30 seconds when FcFontSetList is called --> <rescan> <int>30</int> </rescan> </config> </fontconfig>
インストール
$ mkdir ~/.local/share/fonts $ mv HackGen_NF_v2.9.0/*.ttf ~/.local/share/fonts/ $ mv HackGen_v2.9.0/*.ttf ~/.local/share/fonts/ $ fc-list | grep HackGen
/home/tomoyan/.local/share/fonts/HackGenConsole-Bold.ttf: HackGen Console:style=Bold /home/tomoyan/.local/share/fonts/HackGenConsoleNF-Regular.ttf: HackGen Console NF:style=Regular /home/tomoyan/.local/share/fonts/HackGen35ConsoleNF-Regular.ttf: HackGen35 Console NF:style=Regular /home/tomoyan/.local/share/fonts/HackGen35ConsoleNFJ-Regular.ttf: HackGen35 Console NFJ:style=Regular /home/tomoyan/.local/share/fonts/HackGen-Bold.ttf: HackGen:style=Bold /home/tomoyan/.local/share/fonts/HackGen35-Bold.ttf: HackGen35:style=Bold /home/tomoyan/.local/share/fonts/HackGenConsole-Regular.ttf: HackGen Console:style=Regular /home/tomoyan/.local/share/fonts/HackGen35ConsoleNF-Bold.ttf: HackGen35 Console NF:style=Bold /home/tomoyan/.local/share/fonts/HackGenConsoleNFJ-Regular.ttf: HackGen Console NFJ:style=Regular /home/tomoyan/.local/share/fonts/HackGen35Console-Bold.ttf: HackGen35 Console:style=Bold /home/tomoyan/.local/share/fonts/HackGen35Console-Regular.ttf: HackGen35 Console:style=Regular /home/tomoyan/.local/share/fonts/HackGen-Regular.ttf: HackGen:style=Regular /home/tomoyan/.local/share/fonts/HackGen35-Regular.ttf: HackGen35:style=Regular /home/tomoyan/.local/share/fonts/HackGen35ConsoleNFJ-Bold.ttf: HackGen35 Console NFJ:style=Bold /home/tomoyan/.local/share/fonts/HackGenConsoleNF-Bold.ttf: HackGen Console NF:style=Bold /home/tomoyan/.local/share/fonts/HackGenConsoleNFJ-Bold.ttf: HackGen Console NFJ:style=Bold
※fc-list は fontconfig パッケージに含まれている🤔
$ sudo apt install fontconfig