「フォント設定/サンプル」の版間の差分
(→参照: リンクを追加) |
(他言語へのリンクを追加) |
||
(同じ利用者による、間の1版が非表示) | |||
2行目: | 2行目: | ||
[[en:Font configuration/Examples]] |
[[en:Font configuration/Examples]] |
||
[[ru:Font configuration/Examples]] |
[[ru:Font configuration/Examples]] |
||
+ | [[zh-hans:字体配置/示例]] |
||
{{Related articles start}} |
{{Related articles start}} |
||
{{Related|メトリック互換フォント#設定例}} |
{{Related|メトリック互換フォント#設定例}} |
||
172行目: | 173行目: | ||
{{Note|Firefox バージョン 114 以降、{{ic|fontfeatures}} などの fontconfig 設定は [https://hg.mozilla.org/mozilla-central/rev/7a4fe637c12a サポート] になります。}} |
{{Note|Firefox バージョン 114 以降、{{ic|fontfeatures}} などの fontconfig 設定は [https://hg.mozilla.org/mozilla-central/rev/7a4fe637c12a サポート] になります。}} |
||
− | == |
+ | == デフォルトのフォント == |
+ | |||
+ | フォントの一貫性を保つために、すべてのアプリケーションは、fontconfig によって特定のフォントにマップされるセリフ、サンセリフ、およびモノスペースのエイリアスを使用するように設定する必要があります。オプションと例については、[[メトリック互換フォント]] を参照してください。 |
||
+ | |||
+ | === アラビア語 === |
||
+ | |||
+ | fonts.conf の例では、アラビア語のデフォルトフォントを指定し、ラテン文字の欧文フォントを保持します。以下を機能させるには、{{aur|ttf-arabeyes-fonts}} または {{pkg|noto-fonts}} のいずれかが必要です。他のアラビア語フォントをインストールすることを選択し、それに応じて好みに応じて以下のフォント名を変更することもできます。 |
||
+ | |||
+ | {{bc|<nowiki> |
||
+ | <?xml version="1.0"?> |
||
+ | <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> |
||
+ | <fontconfig> |
||
+ | <!-- Default font for the Arabic language (no fc-match pattern) --> |
||
+ | <match> |
||
+ | <test compare="contains" name="lang"> |
||
+ | <string>ar</string> |
||
+ | </test> |
||
+ | <edit mode="prepend" name="family"> |
||
+ | <string>Tholoth</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | </fontconfig> |
||
+ | </nowiki>}} |
||
+ | |||
+ | 上記はほとんどのアプリケーションで機能するはずですが、Chromium などの一部のアプリケーションでは言語一致テストが機能しません。選択したフォントを使用していないアプリケーションが見つかった場合は、以下のエイリアスを使用し、機能すると思われるタグを優先してください。 |
||
+ | |||
+ | {{bc|<nowiki> |
||
+ | <?xml version="1.0"?> |
||
+ | <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> |
||
+ | <fontconfig> |
||
+ | <!-- Fallback fonts preference order --> |
||
+ | <alias> |
||
+ | <family>sans-serif</family> |
||
+ | <prefer> |
||
+ | <family>Noto Sans</family> |
||
+ | <family>Open Sans</family> |
||
+ | <family>Droid Sans</family> |
||
+ | <family>Roboto</family> |
||
+ | <family>Tholoth</family> |
||
+ | <family>Noto Sans Arabic</family> |
||
+ | </prefer> |
||
+ | </alias> |
||
+ | <alias> |
||
+ | <family>serif</family> |
||
+ | <prefer> |
||
+ | <family>Noto Serif</family> |
||
+ | <family>Droid Serif</family> |
||
+ | <family>Roboto Slab</family> |
||
+ | <family>Tholoth</family> |
||
+ | <family>Noto Sans Arabic</family> |
||
+ | </prefer> |
||
+ | </alias> |
||
+ | <alias> |
||
+ | <family>monospace</family> |
||
+ | <prefer> |
||
+ | <family>Noto Sans Mono</family> |
||
+ | <family>Inconsolata</family> |
||
+ | <family>Droid Sans Mono</family> |
||
+ | <family>Roboto Mono</family> |
||
+ | </prefer> |
||
+ | </alias> |
||
+ | </fontconfig> |
||
+ | </nowiki>}} |
||
+ | |||
+ | === 日本語 === |
||
日本語ロケール (ja_JP) のデフォルトフォントを指定する {{ic|fonts.conf}} の例: |
日本語ロケール (ja_JP) のデフォルトフォントを指定する {{ic|fonts.conf}} の例: |
||
257行目: | 322行目: | ||
<dir>~/.fonts</dir> |
<dir>~/.fonts</dir> |
||
+ | </fontconfig> |
||
+ | </nowiki>}} |
||
+ | |||
+ | === 中国語 === |
||
+ | |||
+ | {{hc|~/.config/fontconfig/fonts.conf |
||
+ | or |
||
+ | /etc/fonts/local.conf|<nowiki> |
||
+ | <?xml version="1.0"?> |
||
+ | <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> |
||
+ | <fontconfig> |
||
+ | <match target="font"> |
||
+ | <edit name="embeddedbitmap" mode="assign"> |
||
+ | <bool>false</bool> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match> |
||
+ | <test qual="any" name="family"> |
||
+ | <string>serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="prepend" binding="strong"> |
||
+ | <string>Noto Serif</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match target="pattern"> |
||
+ | <test qual="any" name="family"> |
||
+ | <string>sans-serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="prepend" binding="strong"> |
||
+ | <string>Roboto</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match target="pattern"> |
||
+ | <test qual="any" name="family"> |
||
+ | <string>monospace</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="prepend" binding="strong"> |
||
+ | <string>DejaVu Sans Mono</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="prepend"> |
||
+ | <string>Source Han Serif CN</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>sans-serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="prepend"> |
||
+ | <string>Source Han Sans CN</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>monospace</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="prepend"> |
||
+ | <string>Noto Sans Mono CJK SC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!--Windows & Linux Chinese fonts. --> |
||
+ | <match target="pattern"> |
||
+ | <test qual="any" name="family"> |
||
+ | <string>WenQuanYi Zen Hei</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="assign" binding="same"> |
||
+ | <string>Source Han Sans CN</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match target="pattern"> |
||
+ | <test qual="any" name="family"> |
||
+ | <string>WenQuanYi Micro Hei</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="assign" binding="same"> |
||
+ | <string>Source Han Sans CN</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match target="pattern"> |
||
+ | <test qual="any" name="family"> |
||
+ | <string>WenQuanYi Micro Hei Light</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="assign" binding="same"> |
||
+ | <string>Source Han Sans CN</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match target="pattern"> |
||
+ | <test qual="any" name="family"> |
||
+ | <string>Microsoft YaHei</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="assign" binding="same"> |
||
+ | <string>Source Han Sans CN</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match target="pattern"> |
||
+ | <test qual="any" name="family"> |
||
+ | <string>SimHei</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="assign" binding="same"> |
||
+ | <string>Source Han Sans CN</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match target="pattern"> |
||
+ | <test qual="any" name="family"> |
||
+ | <string>SimSun</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="assign" binding="same"> |
||
+ | <string>Source Han Serif CN</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match target="pattern"> |
||
+ | <test qual="any" name="family"> |
||
+ | <string>SimSun-18030</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="assign" binding="same"> |
||
+ | <string>Source Han Serif CN</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | </fontconfig> |
||
+ | </nowiki>}} |
||
+ | |||
+ | === Noto フォントの中国語 === |
||
+ | |||
+ | Microsoft フォントを WenQuanYi Micro Hei に置き換えながら Noto フォントを適用する |
||
+ | |||
+ | {{hc|~/.config/fontconfig/fonts.conf |
||
+ | or |
||
+ | /etc/fonts/local.conf|<nowiki> |
||
+ | <?xml version="1.0"?> |
||
+ | <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> |
||
+ | <fontconfig> |
||
+ | <match target="font"> |
||
+ | <edit name="embeddedbitmap" mode="assign"> |
||
+ | <bool>false</bool> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match> |
||
+ | <test qual="any" name="family"> |
||
+ | <string>serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="prepend" binding="strong"> |
||
+ | <string>Noto Serif</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match target="pattern"> |
||
+ | <test qual="any" name="family"> |
||
+ | <string>sans-serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="prepend" binding="strong"> |
||
+ | <string>Noto Sans</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match target="pattern"> |
||
+ | <test qual="any" name="family"> |
||
+ | <string>monospace</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="prepend" binding="strong"> |
||
+ | <string>Noto Sans Mono</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="prepend"> |
||
+ | <string>Noto Serif CJK SC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>sans-serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="prepend"> |
||
+ | <string>Noto Sans CJK SC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>monospace</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="prepend"> |
||
+ | <string>Noto Sans Mono CJK SC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!--WenQuanYi Zen Hei -> WenQuanYi Micro Hei --> |
||
+ | <match target="pattern"> |
||
+ | <test qual="any" name="family"> |
||
+ | <string>WenQuanYi Zen Hei</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="assign" binding="same"> |
||
+ | <string>WenQuanYi Micro Hei</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match target="pattern"> |
||
+ | <test qual="any" name="family"> |
||
+ | <string>WenQuanYi Zen Hei Lite</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="assign" binding="same"> |
||
+ | <string>WenQuanYi Micro Hei Lite</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match target="pattern"> |
||
+ | <test qual="any" name="family"> |
||
+ | <string>WenQuanYi Zen Hei Mono</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="assign" binding="same"> |
||
+ | <string>WenQuanYi Micro Hei Mono</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!--Microsoft YaHei, SimHei, SimSun -> WenQuanYi Micro Hei --> |
||
+ | <match target="pattern"> |
||
+ | <test qual="any" name="family"> |
||
+ | <string>Microsoft YaHei</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="assign" binding="same"> |
||
+ | <string>WenQuanYi Micro Hei</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match target="pattern"> |
||
+ | <test qual="any" name="family"> |
||
+ | <string>SimHei</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="assign" binding="same"> |
||
+ | <string>WenQuanYi Micro Hei</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match target="pattern"> |
||
+ | <test qual="any" name="family"> |
||
+ | <string>SimSun</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="assign" binding="same"> |
||
+ | <string>WenQuanYi Micro Hei</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <match target="pattern"> |
||
+ | <test qual="any" name="family"> |
||
+ | <string>SimSun-18030</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="assign" binding="same"> |
||
+ | <string>WenQuanYi Micro Hei</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | </fontconfig> |
||
+ | </nowiki>}} |
||
+ | |||
+ | === CJK、ただし他のラテン語フォントを望む場合 === |
||
+ | |||
+ | {{Pkg|noto-fonts-cjk}} が必要です。 |
||
+ | |||
+ | {{ic|PT Serif}}/{{ic|Roboto}}/{{ic|Cascadia Code PL}} をお気に入りの {{ic|serif}}/{{ic|sans-serif}}/{{ic|monospace}} フォントに置き換えることが可能です |
||
+ | |||
+ | {{hc|~/.config/fontconfig/fonts.conf|<nowiki> |
||
+ | <?xml version="1.0"?> |
||
+ | <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> |
||
+ | <fontconfig> |
||
+ | <!-- Default serif font --> |
||
+ | <alias binding="strong"> |
||
+ | <family>serif</family> |
||
+ | <prefer> |
||
+ | <family>PT Serif</family> |
||
+ | </prefer> |
||
+ | </alias> |
||
+ | <!-- Default sans-serif font --> |
||
+ | <alias binding="strong"> |
||
+ | <family>sans-serif</family> |
||
+ | <prefer> |
||
+ | <family>Roboto</family> |
||
+ | </prefer> |
||
+ | </alias> |
||
+ | <!-- Default monospace font --> |
||
+ | <alias binding="strong"> |
||
+ | <family>monospace</family> |
||
+ | <prefer> |
||
+ | <family>Cascadia Code PL</family> |
||
+ | </prefer> |
||
+ | </alias> |
||
+ | <!-- Default system-ui font --> |
||
+ | <alias binding="strong"> |
||
+ | <family>system-ui</family> |
||
+ | <prefer> |
||
+ | <family>Roboto</family> |
||
+ | </prefer> |
||
+ | </alias> |
||
+ | <!-- Serif CJK --> |
||
+ | <!-- Default serif when the "lang" attribute is not given --> |
||
+ | <!-- You can change this font to the language variant you want --> |
||
+ | <match target="pattern"> |
||
+ | <test name="family"> |
||
+ | <string>serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Serif CJK SC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- Japanese --> |
||
+ | <!-- "lang=ja" or "lang=ja-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>ja</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Serif CJK JP</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- Korean --> |
||
+ | <!-- "lang=ko" or "lang=ko-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>ko</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Serif CJK KR</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- Chinese --> |
||
+ | <!-- "lang=zh" or "lang=zh-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Serif CJK SC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- "lang=zh-hans" or "lang=zh-hans-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-hans</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Serif CJK SC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- "lang=zh-hant" or "lang=zh-hant-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-hant</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Serif CJK TC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- Compatible --> |
||
+ | <!-- "lang=zh-cn" or "lang=zh-cn-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-cn</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Serif CJK SC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- "lang=zh-tw" or "lang=zh-tw-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-tw</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Serif CJK TC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- Sans CJK --> |
||
+ | <!-- Default sans-serif when the "lang" attribute is not given --> |
||
+ | <!-- You can change this font to the language variant you want --> |
||
+ | <match target="pattern"> |
||
+ | <test name="family"> |
||
+ | <string>sans-serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans CJK SC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- Japanese --> |
||
+ | <!-- "lang=ja" or "lang=ja-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>ja</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>sans-serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans CJK JP</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- Korean --> |
||
+ | <!-- "lang=ko" or "lang=ko-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>ko</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>sans-serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans CJK KR</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- Chinese --> |
||
+ | <!-- "lang=zh" or "lang=zh-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>sans-serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans CJK SC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- "lang=zh-hans" or "lang=zh-hans-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-hans</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>sans-serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans CJK SC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- "lang=zh-hant" or "lang=zh-hant-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-hant</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>sans-serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans CJK TC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- "lang=zh-hant-hk" or "lang=zh-hant-hk-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-hant-hk</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>sans-serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans CJK HK</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- Compatible --> |
||
+ | <!-- "lang=zh-cn" or "lang=zh-cn-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-cn</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>sans-serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans CJK SC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- "lang=zh-tw" or "lang=zh-tw-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-tw</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>sans-serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans CJK TC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- "lang=zh-hk" or "lang=zh-hk-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-hk</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>sans-serif</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans CJK HK</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- Mono CJK --> |
||
+ | <!-- Default monospace when the "lang" attribute is not given --> |
||
+ | <!-- You can change this font to the language variant you want --> |
||
+ | <match target="pattern"> |
||
+ | <test name="family"> |
||
+ | <string>monospace</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans Mono CJK SC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- Japanese --> |
||
+ | <!-- "lang=ja" or "lang=ja-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>ja</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>monospace</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans Mono CJK JP</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- Korean --> |
||
+ | <!-- "lang=ko" or "lang=ko-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>ko</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>monospace</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans Mono CJK KR</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- Chinese --> |
||
+ | <!-- "lang=zh" or "lang=zh-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>monospace</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans Mono CJK SC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- "lang=zh-hans" or "lang=zh-hans-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-hans</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>monospace</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans Mono CJK SC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- "lang=zh-hant" or "lang=zh-hant-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-hant</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>monospace</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans Mono CJK TC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- "lang=zh-hant-hk" or "lang=zh-hant-hk-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-hant-hk</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>monospace</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans Mono CJK HK</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- Compatible --> |
||
+ | <!-- "lang=zh-cn" or "lang=zh-cn-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-cn</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>monospace</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans Mono CJK SC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- "lang=zh-tw" or "lang=zh-tw-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-tw</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>monospace</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans Mono CJK TC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- "lang=zh-hk" or "lang=zh-hk-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-hk</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>monospace</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans Mono CJK HK</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- System UI CJK --> |
||
+ | <!-- Default system-ui when the "lang" attribute is not given --> |
||
+ | <!-- You can change this font to the language variant you want --> |
||
+ | <match target="pattern"> |
||
+ | <test name="family"> |
||
+ | <string>system-ui</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans CJK SC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- Japanese --> |
||
+ | <!-- "lang=ja" or "lang=ja-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>ja</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>system-ui</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans CJK JP</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- Korean --> |
||
+ | <!-- "lang=ko" or "lang=ko-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>ko</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>system-ui</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans CJK KR</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- Chinese --> |
||
+ | <!-- "lang=zh" or "lang=zh-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>system-ui</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans CJK SC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- "lang=zh-hans" or "lang=zh-hans-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-hans</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>system-ui</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans CJK SC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- "lang=zh-hant" or "lang=zh-hant-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-hant</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>system-ui</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans CJK TC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- "lang=zh-hant-hk" or "lang=zh-hant-hk-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-hant-hk</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>system-ui</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans CJK HK</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- Compatible --> |
||
+ | <!-- "lang=zh-cn" or "lang=zh-cn-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-cn</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>system-ui</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans CJK SC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- "lang=zh-tw" or "lang=zh-tw-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-tw</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>system-ui</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans CJK TC</string> |
||
+ | </edit> |
||
+ | </match> |
||
+ | <!-- "lang=zh-hk" or "lang=zh-hk-*" --> |
||
+ | <match target="pattern"> |
||
+ | <test name="lang" compare="contains"> |
||
+ | <string>zh-hk</string> |
||
+ | </test> |
||
+ | <test name="family"> |
||
+ | <string>system-ui</string> |
||
+ | </test> |
||
+ | <edit name="family" mode="append" binding="strong"> |
||
+ | <string>Noto Sans CJK HK</string> |
||
+ | </edit> |
||
+ | </match> |
||
</fontconfig> |
</fontconfig> |
||
</nowiki>}} |
</nowiki>}} |
2023年6月4日 (日) 22:56時点における最新版
関連記事
メインの記事はフォント設定を見て下さい。
設定はユーザーによって大きく変わります。Fontconfig の設定を投稿するときは理由の説明も加えて下さい。
目次
フォントのヒンティング
~/.config/fontconfig/fonts.conf
<?xml version='1.0'?> <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> <fontconfig> <match target="font"> <edit mode="assign" name="antialias"> <bool>true</bool> </edit> <edit mode="assign" name="embeddedbitmap"> <bool>false</bool> </edit> <edit mode="assign" name="hinting"> <bool>true</bool> </edit> <edit mode="assign" name="hintstyle"> <const>hintslight</const> </edit> <edit mode="assign" name="lcdfilter"> <const>lcddefault</const> </edit> <edit mode="assign" name="rgba"> <const>rgb</const> </edit> </match> </fontconfig>
斜体や太字でヒンティングを無効化
<?xml version='1.0'?> <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> <fontconfig> <match target="font" > <edit mode="assign" name="autohint"> <bool>true</bool></edit> <edit mode="assign" name="hinting"> <bool>false</bool></edit> <edit mode="assign" name="lcdfilter"> <const>lcddefault</const></edit> <edit mode="assign" name="hintstyle"> <const>hintslight</const></edit> <edit mode="assign" name="antialias"> <bool>true</bool></edit> <edit mode="assign" name="rgba"> <const>rgb</const></edit> </match> <match target="font"> <test name="pixelsize" qual="any" compare="more"><double>15</double></test> <edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit> <edit mode="assign" name="hintstyle"><const>hintnone</const></edit> </match> <match target="font"> <test name="weight" compare="more"><const>medium</const></test> <edit mode="assign" name="hintstyle"><const>hintnone</const></edit> <edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit> </match> <match target="font"> <test name="slant" compare="not_eq"><double>0</double></test> <edit mode="assign" name="hintstyle"><const>hintnone</const></edit> <edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit> </match> </fontconfig>
鮮明なフォント
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <match target="font"> <edit name="antialias" mode="assign"><bool>true</bool></edit> <edit name="hinting" mode="assign"><bool>true</bool></edit> <edit name="hintstyle" mode="assign"><const>hintfull</const></edit> <edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit> <edit name="rgba" mode="assign"><const>rgb</const></edit> </match> </fontconfig>
大きめのフォントでだけアンチエイリアスを有効化
場合によってはアンチエイリアスを適用しないで、はっきりとしたレンダリングの方が好ましいこともあります:
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <match target="font"> <edit name="antialias" mode="assign"> <bool>false</bool> </edit> </match> <match target="font" > <test name="size" qual="any" compare="more"> <double>12</double> </test> <edit name="antialias" mode="assign"> <bool>true</bool> </edit> </match> <match target="font" > <test name="pixelsize" qual="any" compare="more"> <double>16</double> </test> <edit name="antialias" mode="assign"> <bool>true</bool> </edit> </match> </fontconfig>
太字フォントを無効化
太字でうまく表示されず、アプリケーションで太字フォントを無効にできない場合(たとえば、st)
... <match target="pattern"> <test qual="any" name="family"> <string>Envy Code R</string> </test> <test name="weight" compare="more"> <const>medium</const> </test> <edit name="weight" mode="assign" binding="same"> <const>medium</const> </edit> </match> ...
等幅フォントの合字を無効にする
これにより、一部の等幅フォントで ffi などの文字の組み合わせが単一幅の文字に押しつぶされるのを防ぎます。追加のフォントを含めるには、<match>
ブロック全体を複製する必要があります。
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> <fontconfig> <description>Disable ligatures for monospaced fonts to avoid ff, fi, ffi, etc. becoming only one character wide</description> <match target="font"> <test name="family" compare="eq" ignore-blanks="true"> <string>Nimbus Mono PS</string> </test> <edit name="fontfeatures" mode="append"> <string>liga off</string> <string>dlig off</string> </edit> </match> </fontconfig>
calt
や clig
などの他のフォントでも、features を無効にする必要がある場合があります。
次のコマンドを使用して、この効果をテストできます。
$ echo -e "| worksheet |\n| buffering |\n| difficult |\n| finishing |\n| different |\n| efficient |" | pango-view --font="Nimbus Mono PS" /dev/stdin
一部のプログラム (Firefox など) は fontfeatures
タグをサポートしていないため、フォントを別のフォントに置き換えることが唯一の選択肢です。詳細については、フォント設定#デフォルトまたは代替フォントを設定する を参照してください。
デフォルトのフォント
フォントの一貫性を保つために、すべてのアプリケーションは、fontconfig によって特定のフォントにマップされるセリフ、サンセリフ、およびモノスペースのエイリアスを使用するように設定する必要があります。オプションと例については、メトリック互換フォント を参照してください。
アラビア語
fonts.conf の例では、アラビア語のデフォルトフォントを指定し、ラテン文字の欧文フォントを保持します。以下を機能させるには、ttf-arabeyes-fontsAUR または noto-fonts のいずれかが必要です。他のアラビア語フォントをインストールすることを選択し、それに応じて好みに応じて以下のフォント名を変更することもできます。
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> <fontconfig> <!-- Default font for the Arabic language (no fc-match pattern) --> <match> <test compare="contains" name="lang"> <string>ar</string> </test> <edit mode="prepend" name="family"> <string>Tholoth</string> </edit> </match> </fontconfig>
上記はほとんどのアプリケーションで機能するはずですが、Chromium などの一部のアプリケーションでは言語一致テストが機能しません。選択したフォントを使用していないアプリケーションが見つかった場合は、以下のエイリアスを使用し、機能すると思われるタグを優先してください。
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> <fontconfig> <!-- Fallback fonts preference order --> <alias> <family>sans-serif</family> <prefer> <family>Noto Sans</family> <family>Open Sans</family> <family>Droid Sans</family> <family>Roboto</family> <family>Tholoth</family> <family>Noto Sans Arabic</family> </prefer> </alias> <alias> <family>serif</family> <prefer> <family>Noto Serif</family> <family>Droid Serif</family> <family>Roboto Slab</family> <family>Tholoth</family> <family>Noto Sans Arabic</family> </prefer> </alias> <alias> <family>monospace</family> <prefer> <family>Noto Sans Mono</family> <family>Inconsolata</family> <family>Droid Sans Mono</family> <family>Roboto Mono</family> </prefer> </alias> </fontconfig>
日本語
日本語ロケール (ja_JP) のデフォルトフォントを指定する fonts.conf
の例:
<?xml version='1.0'?> <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> <fontconfig> <!-- Default font (no fc-match pattern) --> <match> <edit mode="prepend" name="family"> <string>Noto Sans</string> </edit> </match> <!-- Default font for the ja_JP locale (no fc-match pattern) --> <match> <test compare="contains" name="lang"> <string>ja</string> </test> <edit mode="prepend" name="family"> <string>Noto Sans CJK JP</string> </edit> </match> <!-- Default sans-serif font --> <match target="pattern"> <test qual="any" name="family"><string>sans-serif</string></test> <!--<test qual="any" name="lang"><string>ja</string></test>--> <edit name="family" mode="prepend" binding="same"><string>Noto Sans</string> </edit> </match> <!-- Default serif fonts --> <match target="pattern"> <test qual="any" name="family"><string>serif</string></test> <edit name="family" mode="prepend" binding="same"><string>Noto Serif</string> </edit> <edit name="family" mode="append" binding="same"><string>IPAPMincho</string> </edit> <edit name="family" mode="append" binding="same"><string>HanaMinA</string> </edit> </match> <!-- Default monospace fonts --> <match target="pattern"> <test qual="any" name="family"><string>monospace</string></test> <edit name="family" mode="prepend" binding="same"><string>Inconsolatazi4</string></edit> <edit name="family" mode="append" binding="same"><string>IPAGothic</string></edit> </match> <!-- Fallback fonts preference order --> <alias> <family>sans-serif</family> <prefer> <family>Noto Sans</family> <family>Open Sans</family> <family>Droid Sans</family> <family>Ubuntu</family> <family>Roboto</family> <family>NotoSansCJK</family> <family>Source Han Sans JP</family> <family>IPAPGothic</family> <family>VL PGothic</family> <family>Koruri</family> </prefer> </alias> <alias> <family>serif</family> <prefer> <family>Noto Serif</family> <family>Droid Serif</family> <family>Roboto Slab</family> <family>IPAPMincho</family> </prefer> </alias> <alias> <family>monospace</family> <prefer> <family>Inconsolatazi4</family> <family>Ubuntu Mono</family> <family>Droid Sans Mono</family> <family>Roboto Mono</family> <family>IPAGothic</family> </prefer> </alias> <dir>~/.fonts</dir> </fontconfig>
中国語
~/.config/fontconfig/fonts.conf or /etc/fonts/local.conf
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> <fontconfig> <match target="font"> <edit name="embeddedbitmap" mode="assign"> <bool>false</bool> </edit> </match> <match> <test qual="any" name="family"> <string>serif</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Noto Serif</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>sans-serif</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Roboto</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>monospace</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>DejaVu Sans Mono</string> </edit> </match> <match> <test name="lang" compare="contains"> <string>zh</string> </test> <test name="family"> <string>serif</string> </test> <edit name="family" mode="prepend"> <string>Source Han Serif CN</string> </edit> </match> <match> <test name="lang" compare="contains"> <string>zh</string> </test> <test name="family"> <string>sans-serif</string> </test> <edit name="family" mode="prepend"> <string>Source Han Sans CN</string> </edit> </match> <match> <test name="lang" compare="contains"> <string>zh</string> </test> <test name="family"> <string>monospace</string> </test> <edit name="family" mode="prepend"> <string>Noto Sans Mono CJK SC</string> </edit> </match> <!--Windows & Linux Chinese fonts. --> <match target="pattern"> <test qual="any" name="family"> <string>WenQuanYi Zen Hei</string> </test> <edit name="family" mode="assign" binding="same"> <string>Source Han Sans CN</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>WenQuanYi Micro Hei</string> </test> <edit name="family" mode="assign" binding="same"> <string>Source Han Sans CN</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>WenQuanYi Micro Hei Light</string> </test> <edit name="family" mode="assign" binding="same"> <string>Source Han Sans CN</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>Microsoft YaHei</string> </test> <edit name="family" mode="assign" binding="same"> <string>Source Han Sans CN</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>SimHei</string> </test> <edit name="family" mode="assign" binding="same"> <string>Source Han Sans CN</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>SimSun</string> </test> <edit name="family" mode="assign" binding="same"> <string>Source Han Serif CN</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>SimSun-18030</string> </test> <edit name="family" mode="assign" binding="same"> <string>Source Han Serif CN</string> </edit> </match> </fontconfig>
Noto フォントの中国語
Microsoft フォントを WenQuanYi Micro Hei に置き換えながら Noto フォントを適用する
~/.config/fontconfig/fonts.conf or /etc/fonts/local.conf
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> <fontconfig> <match target="font"> <edit name="embeddedbitmap" mode="assign"> <bool>false</bool> </edit> </match> <match> <test qual="any" name="family"> <string>serif</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Noto Serif</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>sans-serif</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Noto Sans</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>monospace</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Noto Sans Mono</string> </edit> </match> <match> <test name="lang" compare="contains"> <string>zh</string> </test> <test name="family"> <string>serif</string> </test> <edit name="family" mode="prepend"> <string>Noto Serif CJK SC</string> </edit> </match> <match> <test name="lang" compare="contains"> <string>zh</string> </test> <test name="family"> <string>sans-serif</string> </test> <edit name="family" mode="prepend"> <string>Noto Sans CJK SC</string> </edit> </match> <match> <test name="lang" compare="contains"> <string>zh</string> </test> <test name="family"> <string>monospace</string> </test> <edit name="family" mode="prepend"> <string>Noto Sans Mono CJK SC</string> </edit> </match> <!--WenQuanYi Zen Hei -> WenQuanYi Micro Hei --> <match target="pattern"> <test qual="any" name="family"> <string>WenQuanYi Zen Hei</string> </test> <edit name="family" mode="assign" binding="same"> <string>WenQuanYi Micro Hei</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>WenQuanYi Zen Hei Lite</string> </test> <edit name="family" mode="assign" binding="same"> <string>WenQuanYi Micro Hei Lite</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>WenQuanYi Zen Hei Mono</string> </test> <edit name="family" mode="assign" binding="same"> <string>WenQuanYi Micro Hei Mono</string> </edit> </match> <!--Microsoft YaHei, SimHei, SimSun -> WenQuanYi Micro Hei --> <match target="pattern"> <test qual="any" name="family"> <string>Microsoft YaHei</string> </test> <edit name="family" mode="assign" binding="same"> <string>WenQuanYi Micro Hei</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>SimHei</string> </test> <edit name="family" mode="assign" binding="same"> <string>WenQuanYi Micro Hei</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>SimSun</string> </test> <edit name="family" mode="assign" binding="same"> <string>WenQuanYi Micro Hei</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>SimSun-18030</string> </test> <edit name="family" mode="assign" binding="same"> <string>WenQuanYi Micro Hei</string> </edit> </match> </fontconfig>
CJK、ただし他のラテン語フォントを望む場合
noto-fonts-cjk が必要です。
PT Serif
/Roboto
/Cascadia Code PL
をお気に入りの serif
/sans-serif
/monospace
フォントに置き換えることが可能です
~/.config/fontconfig/fonts.conf
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> <fontconfig> <!-- Default serif font --> <alias binding="strong"> <family>serif</family> <prefer> <family>PT Serif</family> </prefer> </alias> <!-- Default sans-serif font --> <alias binding="strong"> <family>sans-serif</family> <prefer> <family>Roboto</family> </prefer> </alias> <!-- Default monospace font --> <alias binding="strong"> <family>monospace</family> <prefer> <family>Cascadia Code PL</family> </prefer> </alias> <!-- Default system-ui font --> <alias binding="strong"> <family>system-ui</family> <prefer> <family>Roboto</family> </prefer> </alias> <!-- Serif CJK --> <!-- Default serif when the "lang" attribute is not given --> <!-- You can change this font to the language variant you want --> <match target="pattern"> <test name="family"> <string>serif</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Serif CJK SC</string> </edit> </match> <!-- Japanese --> <!-- "lang=ja" or "lang=ja-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>ja</string> </test> <test name="family"> <string>serif</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Serif CJK JP</string> </edit> </match> <!-- Korean --> <!-- "lang=ko" or "lang=ko-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>ko</string> </test> <test name="family"> <string>serif</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Serif CJK KR</string> </edit> </match> <!-- Chinese --> <!-- "lang=zh" or "lang=zh-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh</string> </test> <test name="family"> <string>serif</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Serif CJK SC</string> </edit> </match> <!-- "lang=zh-hans" or "lang=zh-hans-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-hans</string> </test> <test name="family"> <string>serif</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Serif CJK SC</string> </edit> </match> <!-- "lang=zh-hant" or "lang=zh-hant-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-hant</string> </test> <test name="family"> <string>serif</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Serif CJK TC</string> </edit> </match> <!-- Compatible --> <!-- "lang=zh-cn" or "lang=zh-cn-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-cn</string> </test> <test name="family"> <string>serif</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Serif CJK SC</string> </edit> </match> <!-- "lang=zh-tw" or "lang=zh-tw-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-tw</string> </test> <test name="family"> <string>serif</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Serif CJK TC</string> </edit> </match> <!-- Sans CJK --> <!-- Default sans-serif when the "lang" attribute is not given --> <!-- You can change this font to the language variant you want --> <match target="pattern"> <test name="family"> <string>sans-serif</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans CJK SC</string> </edit> </match> <!-- Japanese --> <!-- "lang=ja" or "lang=ja-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>ja</string> </test> <test name="family"> <string>sans-serif</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans CJK JP</string> </edit> </match> <!-- Korean --> <!-- "lang=ko" or "lang=ko-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>ko</string> </test> <test name="family"> <string>sans-serif</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans CJK KR</string> </edit> </match> <!-- Chinese --> <!-- "lang=zh" or "lang=zh-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh</string> </test> <test name="family"> <string>sans-serif</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans CJK SC</string> </edit> </match> <!-- "lang=zh-hans" or "lang=zh-hans-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-hans</string> </test> <test name="family"> <string>sans-serif</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans CJK SC</string> </edit> </match> <!-- "lang=zh-hant" or "lang=zh-hant-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-hant</string> </test> <test name="family"> <string>sans-serif</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans CJK TC</string> </edit> </match> <!-- "lang=zh-hant-hk" or "lang=zh-hant-hk-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-hant-hk</string> </test> <test name="family"> <string>sans-serif</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans CJK HK</string> </edit> </match> <!-- Compatible --> <!-- "lang=zh-cn" or "lang=zh-cn-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-cn</string> </test> <test name="family"> <string>sans-serif</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans CJK SC</string> </edit> </match> <!-- "lang=zh-tw" or "lang=zh-tw-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-tw</string> </test> <test name="family"> <string>sans-serif</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans CJK TC</string> </edit> </match> <!-- "lang=zh-hk" or "lang=zh-hk-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-hk</string> </test> <test name="family"> <string>sans-serif</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans CJK HK</string> </edit> </match> <!-- Mono CJK --> <!-- Default monospace when the "lang" attribute is not given --> <!-- You can change this font to the language variant you want --> <match target="pattern"> <test name="family"> <string>monospace</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans Mono CJK SC</string> </edit> </match> <!-- Japanese --> <!-- "lang=ja" or "lang=ja-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>ja</string> </test> <test name="family"> <string>monospace</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans Mono CJK JP</string> </edit> </match> <!-- Korean --> <!-- "lang=ko" or "lang=ko-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>ko</string> </test> <test name="family"> <string>monospace</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans Mono CJK KR</string> </edit> </match> <!-- Chinese --> <!-- "lang=zh" or "lang=zh-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh</string> </test> <test name="family"> <string>monospace</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans Mono CJK SC</string> </edit> </match> <!-- "lang=zh-hans" or "lang=zh-hans-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-hans</string> </test> <test name="family"> <string>monospace</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans Mono CJK SC</string> </edit> </match> <!-- "lang=zh-hant" or "lang=zh-hant-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-hant</string> </test> <test name="family"> <string>monospace</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans Mono CJK TC</string> </edit> </match> <!-- "lang=zh-hant-hk" or "lang=zh-hant-hk-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-hant-hk</string> </test> <test name="family"> <string>monospace</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans Mono CJK HK</string> </edit> </match> <!-- Compatible --> <!-- "lang=zh-cn" or "lang=zh-cn-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-cn</string> </test> <test name="family"> <string>monospace</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans Mono CJK SC</string> </edit> </match> <!-- "lang=zh-tw" or "lang=zh-tw-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-tw</string> </test> <test name="family"> <string>monospace</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans Mono CJK TC</string> </edit> </match> <!-- "lang=zh-hk" or "lang=zh-hk-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-hk</string> </test> <test name="family"> <string>monospace</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans Mono CJK HK</string> </edit> </match> <!-- System UI CJK --> <!-- Default system-ui when the "lang" attribute is not given --> <!-- You can change this font to the language variant you want --> <match target="pattern"> <test name="family"> <string>system-ui</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans CJK SC</string> </edit> </match> <!-- Japanese --> <!-- "lang=ja" or "lang=ja-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>ja</string> </test> <test name="family"> <string>system-ui</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans CJK JP</string> </edit> </match> <!-- Korean --> <!-- "lang=ko" or "lang=ko-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>ko</string> </test> <test name="family"> <string>system-ui</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans CJK KR</string> </edit> </match> <!-- Chinese --> <!-- "lang=zh" or "lang=zh-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh</string> </test> <test name="family"> <string>system-ui</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans CJK SC</string> </edit> </match> <!-- "lang=zh-hans" or "lang=zh-hans-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-hans</string> </test> <test name="family"> <string>system-ui</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans CJK SC</string> </edit> </match> <!-- "lang=zh-hant" or "lang=zh-hant-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-hant</string> </test> <test name="family"> <string>system-ui</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans CJK TC</string> </edit> </match> <!-- "lang=zh-hant-hk" or "lang=zh-hant-hk-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-hant-hk</string> </test> <test name="family"> <string>system-ui</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans CJK HK</string> </edit> </match> <!-- Compatible --> <!-- "lang=zh-cn" or "lang=zh-cn-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-cn</string> </test> <test name="family"> <string>system-ui</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans CJK SC</string> </edit> </match> <!-- "lang=zh-tw" or "lang=zh-tw-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-tw</string> </test> <test name="family"> <string>system-ui</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans CJK TC</string> </edit> </match> <!-- "lang=zh-hk" or "lang=zh-hk-*" --> <match target="pattern"> <test name="lang" compare="contains"> <string>zh-hk</string> </test> <test name="family"> <string>system-ui</string> </test> <edit name="family" mode="append" binding="strong"> <string>Noto Sans CJK HK</string> </edit> </match> </fontconfig>
フォントの代替スタイルセット
特定のフォントには、OpenType 機能を通じて文字の代替スタイルセットが付属しています。
通常これらのスタイルセットは ss0x
という名前が付けられ、個々の文字に対する小さな変更が含まれています。
これは、等幅バージョンの ttf-ibm-plex のデフォルトのドット付きゼロをスラッシュ付きゼロに変更する方法を示しています。
~/.config/fontconfig/fonts.conf
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> <fontconfig> <match target="font"> <test name="fontformat" compare="not_eq"> <string /> </test> <test name="family"> <string>IBM Plex Mono</string> </test> <edit name="fontfeatures" mode="assign_replace"> <string>ss03</string> </edit> </match> </fontconfig>
詳細については、What are "Stylistic Sets?" を参照してください。