====== フォント ====== [[:open_source:fonts|フォント]] (オープンソース) も参照🤤\\ ===== Linux でのフォントのインストール ===== ここでは、[[open_source:fonts|HackGen]] をインストールする。\\ ==== フォントのダウンロード ====
$ curl -LO https://github.com/yuru7/HackGen/releases/download/v2.10.0/HackGen_NF_v2.10.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.9M  100 23.9M    0     0  2147k      0  0:00:11  0:00:11 --:--:-- 2812k
$ curl -LO https://github.com/yuru7/HackGen/releases/download/v2.10.0/HackGen_v2.10.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:00:01 --:--:--     0
100 38.5M  100 38.5M    0     0  1666k      0  0:00:23  0:00:23 --:--:-- 2248k
$ unzip HackGen_NF_v2.10.0.zip
Archive:  HackGen_NF_v2.10.0.zip
   creating: HackGen_NF_v2.10.0/
  inflating: HackGen_NF_v2.10.0/HackGen35ConsoleNF-Bold.ttf  
  inflating: HackGen_NF_v2.10.0/HackGen35ConsoleNF-Regular.ttf  
  inflating: HackGen_NF_v2.10.0/HackGenConsoleNF-Bold.ttf  
  inflating: HackGen_NF_v2.10.0/HackGenConsoleNF-Regular.ttf  
$ unzip HackGen_v2.10.0.zip
Archive:  HackGen_v2.10.0.zip
   creating: HackGen_v2.10.0/
  inflating: HackGen_v2.10.0/HackGen-Bold.ttf  
  inflating: HackGen_v2.10.0/HackGen-Regular.ttf  
  inflating: HackGen_v2.10.0/HackGen35-Bold.ttf  
  inflating: HackGen_v2.10.0/HackGen35-Regular.ttf  
  inflating: HackGen_v2.10.0/HackGen35Console-Bold.ttf  
  inflating: HackGen_v2.10.0/HackGen35Console-Regular.ttf  
  inflating: HackGen_v2.10.0/HackGenConsole-Bold.ttf  
  inflating: HackGen_v2.10.0/HackGenConsole-Regular.ttf
==== インストール先確認 (フォントパス) ==== 殆どの Linux ディストリビューションでは、Fontconfig が利用するフォントパスは /usr/share/fonts/~/.local/share/fonts です🤔\\ ^ フォントパス ^ 補足 ^ | /usr/share/fonts/ | OS のフォントインストール先 | | /usr/local/share/fonts | システム管理者のフォントインストール先 | | ~/.local/share/fonts | ユーザーのフォントインストール先 | | ~/.fonts | 非推奨 | [[https://wiki.archlinux.jp/index.php/%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88%E8%A8%AD%E5%AE%9A|フォント設定 - ArchWiki]]\\ **Fedora**\\
$ bat -p --pager no /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
Default configuration file /usr/share/fonts /usr/local/share/fonts fonts ~/.fonts mono monospace sans serif sans-serif sans sans-serif *.dpkg-tmp *.dpkg-new conf.d /var/cache/fontconfig fontconfig ~/.fontconfig 30
===== インストール =====
$ mkdir -p ~/.local/share/fonts
$ mv HackGen_NF_v2.10.0/*.ttf ~/.local/share/fonts/
$ mv HackGen_v2.10.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