Fontconfig (12日目) - emojiとmath ================================= .. post:: Dec 12, 2022 :tags: fontconfig Fontconfig付属の設定ファイルにはあと2つ、総称ファミリー名といいますか分類のための仮想のファミリー名が登場します。 `/etc/fonts/conf.d/45-generic.conf`_ とそのペアの `/etc/fonts/conf.d/60-generic.conf`_ にあるemojiとmathです。 .. _`/etc/fonts/conf.d/45-generic.conf`: https://gitlab.freedesktop.org/fontconfig/fontconfig/-/raw/main/conf.d/45-generic.conf .. _`/etc/fonts/conf.d/60-generic.conf`: https://gitlab.freedesktop.org/fontconfig/fontconfig/-/raw/main/conf.d/60-generic.conf 文字通り、絵文字用フォントと数式用フォントが分類されています。 ついでですのでこれらの扱い方も見ていきましょう。 emoji ----- 今はどのフォントに設定されているのでしょうか。 :: $ fc-match emoji NotoColorEmoji.ttf: "Noto Color Emoji" "Regular" Noto Color Emojiですね。 パターンはどういったものになってますでしょうか。 :: $ fc-pattern -c 'emoji' Pattern has 7 elts (size 16) family: "Noto Color Emoji"(s) "Apple Color Emoji"(s) "Segoe UI Emoji"(s) "Twitter Color Emoji"(s) "EmojiOne Mozilla"(s) "Emoji Two"(s) "Emoji One"(s) "Noto Emoji"(s) "Android Emoji"(s) "emoji"(s) "Ubuntu"(w) "Arimo"(w) "Noto Sans"(w) "Noto Sans CJK SC"(w) "Noto Sans Arabic"(w) "Noto Sans Thai"(w) "Noto Sans Devanagari"(w) "Noto Sans Tamil"(w) "Noto Sans Hebrew"(w) "Noto Sans Bengali"(w) "Noto Sans Telugu"(w) "Noto Sans Kannada"(w) "Noto Sans Malayalam"(w) "Noto Sans Gurmukhi"(w) "Noto Sans Gujarati"(w) "Noto Sans Oriya"(w) "Noto Sans Armenian"(w) "Noto Sans Georgian"(w) "Noto Sans Khmer"(w) "Noto Sans Lao"(w) "Noto Sans Ethiopic"(w) "Noto Sans Myanmar"(w) "Noto Sans Sinhala"(w) "Jomolhari"(w) "Noto Sans Coptic"(w) "Noto Sans Deseret"(w) "Noto Sans TaiTham"(w) "Noto Sans CanadianAboriginal"(w) "Noto Sans Yi"(w) "Noto Sans Tifinagh"(w) "Noto Sans Adlam"(w) "Noto Sans Cherokee"(w) "Noto Sans Chakma"(w) "Noto Sans Osage"(w) "Noto Color Emoji"(w) "Noto Sans Symbols"(w) "Noto Sans Symbols2"(w) "DejaVu Sans"(w) "DejaVu LGC Sans"(w) "Noto Sans CJK JP"(s) "DejaVu LGC Sans"(w) "DejaVu Sans"(w) "Bitstream Vera Sans"(w) "Verdana"(w) "Arial"(w) "Albany AMT"(w) "Luxi Sans"(w) "Nimbus Sans L"(w) "Nimbus Sans"(w) "Nimbus Sans"(w) "Helvetica"(w) "Nimbus Sans"(w) "Nimbus Sans L"(w) "Lucida Sans Unicode"(w) "BPG Glaho International"(w) "Tahoma"(w) "URW Gothic"(w) "Nimbus Sans"(w) "Nimbus Sans Narrow"(w) "Droid Sans Fallback"(w) "IPA Pゴシック"(w) "Nachlieli"(w) "Lucida Sans Unicode"(w) "Yudit Unicode"(w) "Kerkis"(w) "ArmNet Helvetica"(w) "Artsounk"(w) "BPG UTF8 M"(w) "Waree"(w) "Loma"(w) "Garuda"(w) "Umpush"(w) "Saysettha Unicode"(w) "JG Lao Old Arial"(w) "GF Zemen Unicode"(w) "Pigiarniq"(w) "B Davat"(w) "B Compset"(w) "Kacst-Qr"(w) "Urdu Nastaliq Unicode"(w) "Raghindi"(w) "Mukti Narrow"(w) "padmaa"(w) "Hapax Berbère"(w) "MS Gothic"(w) "UmePlus P Gothic"(w) "Microsoft YaHei"(w) "Microsoft JhengHei"(w) "WenQuanYi Zen Hei"(w) "WenQuanYi Bitmap Song"(w) "AR PL ShanHeiSun Uni"(w) "AR PL New Sung"(w) "MgOpen Moderna"(w) "MgOpen Modata"(w) "MgOpen Cosmetica"(w) "VL Gothic"(w) "IPAMonaGothic"(w) "IPAGothic"(w) "Sazanami Gothic"(w) "Kochi Gothic"(w) "AR PL KaitiM GB"(w) "AR PL KaitiM Big5"(w) "AR PL ShanHeiSun Uni"(w) "AR PL SungtiL GB"(w) "AR PL Mingti2L Big5"(w) "MS ゴシック"(w) "ZYSong18030"(w) "NanumGothic"(w) "UnDotum"(w) "Baekmuk Dotum"(w) "Baekmuk Gulim"(w) "KacstQura"(w) "Lohit Bengali"(w) "Lohit Gujarati"(w) "Lohit Hindi"(w) "Lohit Marathi"(w) "Lohit Maithili"(w) "Lohit Kashmiri"(w) "Lohit Konkani"(w) "Lohit Nepali"(w) "Lohit Sindhi"(w) "Lohit Punjabi"(w) "Lohit Tamil"(w) "Meera"(w) "Lohit Malayalam"(w) "Lohit Kannada"(w) "Lohit Telugu"(w) "Lohit Oriya"(w) "LKLUG"(w) "FreeSans"(w) "Arial Unicode MS"(w) "Arial Unicode"(w) "Code2000"(w) "Code2001"(w) "Noto Sans CJK JP"(w) "sans-serif"(w) "Roya"(w) "Koodak"(w) "Terafik"(w) "SimHei"(w) "Noto Sans CJK SC"(w) "黑体"(w) "Noto Sans CJK SC"(w) "sans-serif"(w) "sans-serif"(w) "ITC Avant Garde Gothic"(w) "URW Gothic"(w) "sans-serif"(w) "sans-serif"(w) "Helvetica"(w) "Helvetica Narrow"(w) "Nimbus Sans Narrow"(w) antialias: True(w) hintstyle: 1(i)(w) lang: "und-zsye"(w) "ja"(w) lcdfilter: 1(i)(w) prgname: "fc-pattern"(s) color: True(w) 有名な絵文字フォントが並んでいます。 (実際にインストールされているのはNoto Color Emojiのみです。) 途中からはsans-serifの内容になっていますが、これはemojiはserifでもmonospaceでもありませんので例によって `/etc/fonts/conf.d/49-sansserif.conf`_ がsans-serifを追加しているからです。 .. _`/etc/fonts/conf.d/49-sansserif.conf`: https://gitlab.freedesktop.org/fontconfig/fontconfig/-/raw/main/conf.d/49-sansserif.conf ですのでserifかmonospace(または間接的にserifかmonospaceを追加するフォント名)を含めてやるとそちらに切り替わります。 :: $ fc-pattern -c 'emoji,serif' Pattern has 7 elts (size 16) family: "Noto Color Emoji"(s) "Apple Color Emoji"(s) "Segoe UI Emoji"(s) "Twitter Color Emoji"(s) "EmojiOne Mozilla"(s) "Emoji Two"(s) "Emoji One"(s) "Noto Emoji"(s) "Android Emoji"(s) "emoji"(s) "Tinos"(w) "Noto Serif"(w) "Noto Serif CJK SC"(w) "Noto Naskh Arabic"(w) "Noto Serif Thai"(w) "Noto Serif Armenian"(w) "Noto Serif Georgian"(w) "Noto Serif Devanagari"(w) "Noto Serif Hebrew"(w) "Noto Serif Bangali"(w) "Noto Serif Gujarati"(w) "Noto Serif Kannada"(w) "Noto Serif Malayalam"(w) "Noto Serif Tamil"(w) "Noto Serif Telugu"(w) "Lohit Punjabi"(w) "Lohit Oriya"(w) "Noto Serif Khmer"(w) "Noto Serif Lao"(w) "Noto Serif Ethiopic"(w) "Noto Serif Myanmar"(w) "Noto Serif Sinhala"(w) "Jomolhari"(w) "Noto Color Emoji"(w) "Noto Sans Symbols"(w) "Noto Sans Symbols2"(w) "DejaVu Serif"(w) "DejaVu LGC Serif"(w) "Noto Serif CJK JP"(s) "DejaVu LGC Serif"(w) "DejaVu Serif"(w) "Bitstream Vera Serif"(w) "Times New Roman"(w) "Thorndale AMT"(w) "Luxi Serif"(w) "Nimbus Roman No9 L"(w) "Nimbus Roman"(w) "Nimbus Roman"(w) "Times"(w) "Nimbus Roman"(w) "Nimbus Roman No9 L"(w) "URW Bookman"(w) "C059"(w) "Nimbus Roman"(w) "P052"(w) "Standard Symbols PS"(w) "IPA P明朝"(w) "Artsounk"(w) "BPG UTF8 M"(w) "Kinnari"(w) "Norasi"(w) "Frank Ruehl"(w) "Dror"(w) "JG LaoTimes"(w) "Saysettha Unicode"(w) "Pigiarniq"(w) "B Davat"(w) "B Compset"(w) "Kacst-Qr"(w) "Urdu Nastaliq Unicode"(w) "Raghindi"(w) "Mukti Narrow"(w) "padmaa"(w) "Hapax Berbère"(w) "MS Mincho"(w) "SimSun"(w) "PMingLiu"(w) "WenQuanYi Zen Hei"(w) "WenQuanYi Bitmap Song"(w) "AR PL ShanHeiSun Uni"(w) "AR PL New Sung"(w) "ZYSong18030"(w) "HanyiSong"(w) "MgOpen Canonica"(w) "Sazanami Mincho"(w) "IPAMonaMincho"(w) "IPAMincho"(w) "Kochi Mincho"(w) "AR PL SungtiL GB"(w) "AR PL Mingti2L Big5"(w) "AR PL Zenkai Uni"(w) "MS 明朝"(w) "ZYSong18030"(w) "NanumMyeongjo"(w) "UnBatang"(w) "Baekmuk Batang"(w) "KacstQura"(w) "Frank Ruehl CLM"(w) "Lohit Bengali"(w) "Lohit Gujarati"(w) "Lohit Hindi"(w) "Lohit Marathi"(w) "Lohit Maithili"(w) "Lohit Kashmiri"(w) "Lohit Konkani"(w) "Lohit Nepali"(w) "Lohit Sindhi"(w) "Lohit Punjabi"(w) "Lohit Tamil"(w) "Rachana"(w) "Lohit Malayalam"(w) "Lohit Kannada"(w) "Lohit Telugu"(w) "Lohit Oriya"(w) "LKLUG"(w) "FreeSerif"(w) "Code2000"(w) "Code2001"(w) "Noto Serif CJK JP"(w) "serif"(s) "Nazli"(w) "Lotoos"(w) "Mitra"(w) "Ferdosi"(w) "Badr"(w) "Zar"(w) "Simsun"(w) "Noto Serif CJK SC"(w) "宋体"(w) "Noto Serif CJK SC"(w) "NSimsun"(w) "Noto Serif CJK SC"(w) "新宋体"(w) "Noto Serif CJK SC"(w) "serif"(w) "serif"(w) "ITC Bookman"(w) "Bookman URW"(w) "URW Bookman L"(w) "URW Bookman"(w) "serif"(w) "New Century Schoolbook"(w) "Century Schoolbook L"(w) "Century SchoolBook URW"(w) "C059"(w) "serif"(w) "Times"(w) "serif"(w) "Palatino"(w) "P052"(w) "serif"(w) "Symbol"(w) "Standard Symbols PS"(w) antialias: True(w) hintstyle: 1(i)(w) lang: "und-zsye"(w) "ja"(w) lcdfilter: 1(i)(w) prgname: "fc-pattern"(s) color: True(w) それから ``color`` 属性がtrueになっているのにも注目。 モノクロのNoto Emojiフォントもリリースされましたが絵文字と言えばカラーですから。 math ---- 今はどのフォントに設定されているのでしょうか。 :: $ fc-match math NotoSansCJK-Regular.ttc: "Noto Sans CJK JP" "Regular" おっとmathフォントはインストールされてないようです。 どういうのがmathフォントなのでしょうか。 :: $ fc-pattern -c math Pattern has 6 elts (size 16) family: "XITS Math"(s) "STIX Two Math"(s) "Cambria Math"(s) "Latin Modern Math"(s) "Minion Math"(s) "Lucida Math"(s) "Asana Math"(s) "math"(s) "Ubuntu"(w) "Arimo"(w) "Noto Sans"(w) "Noto Sans CJK SC"(w) "Noto Sans Arabic"(w) "Noto Sans Thai"(w) "Noto Sans Devanagari"(w) "Noto Sans Tamil"(w) "Noto Sans Hebrew"(w) "Noto Sans Bengali"(w) "Noto Sans Telugu"(w) "Noto Sans Kannada"(w) "Noto Sans Malayalam"(w) "Noto Sans Gurmukhi"(w) "Noto Sans Gujarati"(w) "Noto Sans Oriya"(w) "Noto Sans Armenian"(w) "Noto Sans Georgian"(w) "Noto Sans Khmer"(w) "Noto Sans Lao"(w) "Noto Sans Ethiopic"(w) "Noto Sans Myanmar"(w) "Noto Sans Sinhala"(w) "Jomolhari"(w) "Noto Sans Coptic"(w) "Noto Sans Deseret"(w) "Noto Sans TaiTham"(w) "Noto Sans CanadianAboriginal"(w) "Noto Sans Yi"(w) "Noto Sans Tifinagh"(w) "Noto Sans Adlam"(w) "Noto Sans Cherokee"(w) "Noto Sans Chakma"(w) "Noto Sans Osage"(w) "Noto Color Emoji"(w) "Noto Sans Symbols"(w) "Noto Sans Symbols2"(w) "DejaVu Sans"(w) "DejaVu LGC Sans"(w) "Noto Sans CJK JP"(s) "DejaVu LGC Sans"(w) "DejaVu Sans"(w) "Bitstream Vera Sans"(w) "Verdana"(w) "Arial"(w) "Albany AMT"(w) "Luxi Sans"(w) "Nimbus Sans L"(w) "Nimbus Sans"(w) "Nimbus Sans"(w) "Helvetica"(w) "Nimbus Sans"(w) "Nimbus Sans L"(w) "Lucida Sans Unicode"(w) "BPG Glaho International"(w) "Tahoma"(w) "URW Gothic"(w) "Nimbus Sans"(w) "Nimbus Sans Narrow"(w) "Droid Sans Fallback"(w) "IPA Pゴシック"(w) "Nachlieli"(w) "Lucida Sans Unicode"(w) "Yudit Unicode"(w) "Kerkis"(w) "ArmNet Helvetica"(w) "Artsounk"(w) "BPG UTF8 M"(w) "Waree"(w) "Loma"(w) "Garuda"(w) "Umpush"(w) "Saysettha Unicode"(w) "JG Lao Old Arial"(w) "GF Zemen Unicode"(w) "Pigiarniq"(w) "B Davat"(w) "B Compset"(w) "Kacst-Qr"(w) "Urdu Nastaliq Unicode"(w) "Raghindi"(w) "Mukti Narrow"(w) "padmaa"(w) "Hapax Berbère"(w) "MS Gothic"(w) "UmePlus P Gothic"(w) "Microsoft YaHei"(w) "Microsoft JhengHei"(w) "WenQuanYi Zen Hei"(w) "WenQuanYi Bitmap Song"(w) "AR PL ShanHeiSun Uni"(w) "AR PL New Sung"(w) "MgOpen Moderna"(w) "MgOpen Modata"(w) "MgOpen Cosmetica"(w) "VL Gothic"(w) "IPAMonaGothic"(w) "IPAGothic"(w) "Sazanami Gothic"(w) "Kochi Gothic"(w) "AR PL KaitiM GB"(w) "AR PL KaitiM Big5"(w) "AR PL ShanHeiSun Uni"(w) "AR PL SungtiL GB"(w) "AR PL Mingti2L Big5"(w) "MS ゴシック"(w) "ZYSong18030"(w) "NanumGothic"(w) "UnDotum"(w) "Baekmuk Dotum"(w) "Baekmuk Gulim"(w) "KacstQura"(w) "Lohit Bengali"(w) "Lohit Gujarati"(w) "Lohit Hindi"(w) "Lohit Marathi"(w) "Lohit Maithili"(w) "Lohit Kashmiri"(w) "Lohit Konkani"(w) "Lohit Nepali"(w) "Lohit Sindhi"(w) "Lohit Punjabi"(w) "Lohit Tamil"(w) "Meera"(w) "Lohit Malayalam"(w) "Lohit Kannada"(w) "Lohit Telugu"(w) "Lohit Oriya"(w) "LKLUG"(w) "FreeSans"(w) "Arial Unicode MS"(w) "Arial Unicode"(w) "Code2000"(w) "Code2001"(w) "Noto Sans CJK JP"(w) "sans-serif"(w) "Roya"(w) "Koodak"(w) "Terafik"(w) "SimHei"(w) "Noto Sans CJK SC"(w) "黑体"(w) "Noto Sans CJK SC"(w) "sans-serif"(w) "sans-serif"(w) "ITC Avant Garde Gothic"(w) "URW Gothic"(w) "sans-serif"(w) "sans-serif"(w) "Helvetica"(w) "Helvetica Narrow"(w) "Nimbus Sans Narrow"(w) antialias: True(w) hintstyle: 1(i)(w) lang: "und-zmth"(w) "ja"(w) lcdfilter: 1(i)(w) prgname: "fc-pattern"(s) XITS Math、STIX Two Math、Cambria Math、Latin Modern Math、Minion Math、Lucida Math、Asana Mathですか。 ``apt search`` してみましたがDebian/Ubuntuには無いフォントが多いですね。 辛うじてAsana Mathがありましたので入れてみます。 (パッケージ名はfonts-oflb-asana-mathです。) :: $ fc-match math Asana-Math.otf: "Asana Math" "Regular" Asana Mathになりました。 ちなみにNoto Sans Mathもインストールされていましたがmathフォント扱いされていないようです。 パターンの置き換え過程 ---------------------- emojiとmathは次のような流れで置き換えられていきます。 *45-generic.conf* でパターンに有名な絵文字や数式フォント名が含まれていた場合にemojiやmathがリストの最後に追加されます。 これはserifの時にNoto SerifやIPA P明朝でやったことと同じです。 .. code-block:: xml :caption: ~/.config/fontconfig/conf.d/40-serif.conf (再掲) Noto Serif serif IPA P明朝 serif *60-generic.conf* は逆にパターンにemojiやmathが含まれていた場合に有名な絵文字や数式フォント名をemojiやmathの手前に追加します。 このファイルでは ``color`` 属性をtrueにすることも行われています。 これはUbuntuフォントをsans-serifのデフォルトフォントにした時にやったことと同じです。 .. code-block:: xml :caption: ~/.config/fontconfig/conf.d/50-generic.conf (再掲) sans-serif Ubuntu こうすることで、インストールされていないフォントが要求されてもインストールされている同種のフォントにフォールバックできるようになっています。 :: $ fc-match 'Apple Color Emoji' NotoColorEmoji.ttf: "Noto Color Emoji" "Regular" mathの方も……。 :: $ fc-match 'XITS Math' NotoSansCJK-Regular.ttc: "Noto Sans CJK JP" "Regular" Noto Sans CJK JPがstrongでリストに入ってくるの邪魔ですよね……。 あれ? ではどうしてemojiのほうはNoto Color EmojiがNoto Sans CJK JPを抑えてるのでしょうか? ``color`` がtrueを満たすフォントがNoto Color Emojiしかないから? うーん? :: $ fc-match -s 'XITS Math' | head NotoSansCJK-Regular.ttc: "Noto Sans CJK JP" "Regular" FreeSerif.ttf: "FreeSerif" "Regular" Asana-Math.otf: "Asana Math" "Regular" Ubuntu-R.ttf: "Ubuntu" "Regular" Ubuntu-Th.ttf: "Ubuntu" "Thin" NotoSans-Regular.ttf: "Noto Sans" "Regular" NotoSansArabic-Regular.ttf: "Noto Sans Arabic" "Regular" NotoSansDevanagari-Regular.ttf: "Noto Sans Devanagari" "Regular" NotoSansTamil-Regular.ttf: "Noto Sans Tamil" "Regular" NotoSansBengali-Regular.ttf: "Noto Sans Bengali" "Regular" まあともかくAsana MathがNoto Sans CJK JPの次には来てますので……って、FreeSerifが何故こんなところに!? 優先順位の高さもそうですがserifは指定してないのでそもそも混じってちゃ駄目でしょう。 ``fc-pattern -c 'XITS Math' | grep -i FreeSerif`` で確認してもFreeSerifは混じってませんので設定ファイルのせいではないようです。 FreeSansはリストの後ろの方にあります。 謎です……。 FreeSerifの謎 +++++++++++++ .. container:: inserted FreeSerifが選ばれる理由の、あくまで仮説ですけれども、FreeSerifの収録している言語の中にund-zmthが含まれるのですよね。 :: $ fc-query /usr/share/fonts/truetype/freefont/FreeSerif.ttf | grep und-zmth lang: aa|ab|af|am|ar|as|ast|av|ay|az-az|az-ir|ba|bm|be|bg|bh|bho|bi|bin|bn|br|bs|bua|ca|ce|ch|chm|chr|co|cs|cu|cv|cy|da|de|el|en|eo|es|et|eu|fa|fi|fj|fo|fr|ff|fur|fy|ga|gd|gez|gl|gn|gu|gv|ha|haw|he|hi|ho|hr|hu|hy|ia|ig|id|ie|ik|io|is|it|ka|kaa|ki|kk|kl|kok|ks|ku-am|ku-ir|kum|kv|kw|ky|la|lb|lez|ln|lt|lv|mg|mh|mi|mk|ml|mo|mr|mt|nb|nds|ne|nl|nn|no|nr|nso|ny|oc|om|or|os|pa|pl|ps-af|ps-pk|pt|rm|ro|ru|sa|sah|sco|se|sel|sh|shs|si|sk|sl|sm|sma|smj|smn|sms|so|sq|sr|ss|st|sv|sw|ta|tg|th|ti-er|ti-et|tig|tk|tl|tn|to|tr|ts|tt|tw|tyv|ug|uk|ur|uz|ve|vi|vo|vot|wa|wen|wo|xh|yap|yi|yo|zu|ak|an|ber-dz|byn|crh|csb|dv|ee|fat|fil|hne|hsb|ht|hz|jv|kab|kj|kr|ku-iq|ku-tr|kwm|lg|li|mai|mn-mn|ms|na|ng|nv|ota|pa-pk|pap-an|pap-aw|qu|quz|rn|rw|sc|sd|sg|sid|sn|su|ty|wal|za|lah|brx|sat|doi|mni|und-zmth(s) *45-generic.conf* では ``family`` 属性にmathが含まれる場合は ``lang`` 属性にund-zmthを追加しています。 .. code-block:: xml :caption: 45-generic.conf より抜粋 math und-zmth 一方のAsana Mathはund-zmthを収録していませんでした。 :: $ fc-query /usr/share/fonts/opentype/asana-math/Asana-Math.otf | grep und-math und-zmthを収録しているフォントがFreeSerifしか存在していませんのでAsana Mathよりも優先されてしまっているのではないか、と想像します。 なおNoto Sans Mathもund-zmthを収録していません。 DejaVu Math TeX Gyreでしたらund-zmthを収録していることになっていますのでインストールして試してみましょうか。 (Debian/Ubuntu系であればパッケージはfonts-dejavu-extraです。) :: $ fc-match -s 'XITS Math' | head NotoSansCJK-Regular.ttc: "Noto Sans CJK JP" "Regular" FreeSerif.ttf: "FreeSerif" "Regular" Asana-Math.otf: "Asana Math" "Regular" Ubuntu-R.ttf: "Ubuntu" "Regular" Ubuntu-Th.ttf: "Ubuntu" "Thin" NotoSans-Regular.ttf: "Noto Sans" "Regular" NotoSansArabic-Regular.ttf: "Noto Sans Arabic" "Regular" NotoSansDevanagari-Regular.ttf: "Noto Sans Devanagari" "Regular" NotoSansTamil-Regular.ttf: "Noto Sans Tamil" "Regular" NotoSansBengali-Regular.ttf: "Noto Sans Bengali" "Regular" 変わりませんね……。 FreeSerifを消してみましょう。 (Debian/Ubuntu系であればパッケージはfonts-freefont-ttfです。) .. container:: gray-and-small fonts-freefont-ttfはvlc-plugin-skins2が依存していますのでアンインストールするとvlc-plugin-skins2ごと消すことになってVLCのスキンに影響がある恐れがあります。 ……でも試しに消してみたところぱっと見では違いがわかりません? :: $ fc-match -s 'XITS Math' | head NotoSansCJK-Regular.ttc: "Noto Sans CJK JP" "Regular" DejaVuMathTeXGyre.ttf: "DejaVu Math TeX Gyre" "Regular" Asana-Math.otf: "Asana Math" "Regular" Ubuntu-R.ttf: "Ubuntu" "Regular" Ubuntu-Th.ttf: "Ubuntu" "Thin" NotoSans-Regular.ttf: "Noto Sans" "Regular" NotoSansArabic-Regular.ttf: "Noto Sans Arabic" "Regular" NotoSansThai-Regular.ttf: "Noto Sans Thai" "Regular" NotoSansDevanagari-Regular.ttf: "Noto Sans Devanagari" "Regular" NotoSansTamil-Regular.ttf: "Noto Sans Tamil" "Regular" FreeSerifがあった位置にDejaVu Math TeX Gyreが出てきました。 ``lang`` 属性にはリストに含まれていないフォントでも使えるものは優先する性質があり ``family`` 属性のstrongよりは弱くweakよりは強い、ということで良さそう……かな。 絵文字の方にも同様にund-zsyeという「言語名」が存在しています。 Noto Color Emojiはund-zsyeを収録していました。 Noto Sans Mathを追加する ++++++++++++++++++++++++ おさらいとしてNoto Sans Mathもmath扱いさせておきましょうか。 Noto Sans Mathの名前で要求された時に他のmathフォントもフォールバック先に追加するには .. code-block:: xml :caption: ~/.config/fontconfig/conf.d/40-math.conf Noto Sans Math math で、他のmathフォントのフォールバック先にNoto Sans Mathを追加するには .. code-block:: xml :caption: ~/.config/fontconfig/conf.d/50-generic-math.conf math Noto Sans Math ですよね。 順番はNoto Sans Mathひとつでしたらどうでも良いですが複数のフォントになりますと、まず実在するフォント名から総称ファミリー名、次に総称ファミリー名から実在するフォント名の順になる必要があります。 Asana Mathはserifの数式フォントでNoto Sans Mathはsans-serifの数式フォントですので、要求されているのがserifかsans-serifかで分岐して適切な方を優先させるのも良さそうです。 .. container:: inserted (FreeSerifやDejaVu Math TeX Gyreより優先させるには ``binding`` アトリビュートをstrongにするか ``lang`` 属性からund-zmthを取り除く必要があるかも。) 他のフォントからemojiにフォールバック ------------------------------------- これらの仮想のファミリー名の使い方ですけれども絵文字フォント同士や数式フォント同士でフォールバックさせ合う以外にも、とりあえずリストの最後に追加しておく、という考え方もあります。 .. code-block:: xml :caption: ~/.config/fontconfig/conf.d/70-last.conf emoji こうしておけばどのフォントでもとりあえず何らかの絵文字フォントにフォールバックされます。 でも不特定多数の環境に向けてならともかく、この環境のためだけでしたら直接Noto Color Emojiって書いちゃえば済む話ではあります。 絵文字フォントを沢山インストールしていて全部をフォールバック先にしたいなら役に立つかも?