You are not logged in.
Instead of continuing to revive this post I'm starting a new one...
Recap:Due to Unicode Han unification, Noto Fonts CJK contains many font faces for characters in different languages with the same code points.
❯ fc-match charset=76F4
NotoSans-Regular.ttf: "Noto Sans" "Regular"
❯ fc-match sans:charset=76F4
NotoSansCJK-Regular.ttc: "Noto Sans CJK KR" "Regular"
❯ fc-match mono:charset=76F4
NotoSansCJK-Regular.ttc: "Noto Sans Mono CJK KR" "Regular"Huh? Why is it just Noto Sans for a character in the CJK range?
On Fedora:
$ fc-match charset=76F4
NotoSans[wght].ttf: "Noto Sans" "Regular"
$ fc-match sans:charset=76F4
NotoSansCJK-VF.ttc: "Noto Sans CJK JP" "Regular"Why is it JP on Fedora?
❯ FC_DEBUG=2 fc-match sans:charset=76F4 > Downloads/1.log
(JP) Score 0 0 0 0 0 0 0 0 0 1e+99 0 0 0 1e+99 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.14735e+12
(KR) Score 0 0 0 0 0 0 0 0 0 1e+99 0 0 0 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.14735e+12What is the 14th criterion? fcmatch.c
typedef enum _FcMatcherPriority {
PRI1 (FILE),
PRI1 (FONT_WRAPPER),
PRI1 (FONTFORMAT),
PRI1 (VARIABLE),
PRI1 (NAMED_INSTANCE),
PRI1 (SCALABLE),
PRI1 (COLOR),
PRI1 (FOUNDRY),
PRI1 (CHARSET),
PRI_FAMILY_STRONG,
PRI1 (GENERIC_FAMILY),
PRI_POSTSCRIPT_NAME_STRONG,
PRI1 (LANG),
PRI_FAMILY_WEAK,
PRI_POSTSCRIPT_NAME_WEAK,
PRI1 (SYMBOL),
PRI1 (SPACING),
PRI1 (SIZE),
PRI1 (PIXEL_SIZE),
PRI1 (STYLE),
PRI1 (SLANT),
PRI1 (WEIGHT),
PRI1 (WIDTH),
PRI1 (FONT_HAS_HINT),
PRI1 (DECORATIVE),
PRI1 (ANTIALIAS),
PRI1 (RASTERIZER),
PRI1 (OUTLINE),
PRI1 (ORDER),
PRI1 (FONTVERSION),
PRI_END
} FcMatcherPriority;Eh... what is "FAMILY_WEAK"? fonts-config:
There is one special case to this rule; family names are split into two bindings; strong and weak. Strong family names are given greater precedence in the match than lang elements while weak family names are given lower precedence than lang elements. This permits the document language to drive font selection when any document specified font is unavailable.
I'm still not quite getting what "weak family name" is...
Besides that, what's the proper way to specify an ordering for CJK in the absence of language hint? Something to subtly affect the (language) score without other side effects.
So far I've found none. I'm guessing it hasn't been done before...
Last edited by Beemo (2026-10-01 06:25:05)
Offline
Reading that quote again I think it meant something (likely in /etc/fonts/conf.d) specified KR as the weakly preferred language on Arch. But what is it?
p.s. And yea it seems a rule involving a weak binding to family names might be the way to specify CJK order.
FC_LANG is used to specify the default language as the weak binding in the query. if this isn't set, the default language will be determined from current locale.
But it can only specify one language, and I'd prefer it to be my current locale instead of CJK.
Last edited by Beemo (2026-10-01 01:40:53)
Offline
Bruh I finally found it...
The upstream fontconfig set Noto Fonts CJK KR as preferred: https://gitlab.freedesktop.org/fontconf … type=heads
So I guess the idea is that CJK users will have one of those specialty fonts before Noto Fonts installed.
Oh but wait, they are proprietary so you can't install them on Linux: https://gitlab.freedesktop.org/fontconf … k_items/53
Hilarious... XD (well at least there is already a bug report)
Last edited by Beemo (2026-10-01 01:55:26)
Offline
<alias>
Alias elements provide a shorthand notation for the set of common match operations needed to substitute one font family for another. They contain a <family> element followed by optional <prefer>, <accept> and <default> elements. Fonts matching the <family> element are edited to prepend the list of <prefer>ed families before the matching <family>, append the <accept>able families after the matching <family> and append the <default> families to the end of the family list.
Example: 60-latin (contain Noto Sans) -> 64 JP -> 65-nonlatin (contain KR) -> 66-noto-sans (Noto Sans again) -> etc.
family: 1e+99 (1e+99) "Noto Sans"(w) "DejaVu Sans"(w) "Verdana"(w) "Arial"(w) "Albany AMT"(w) "Luxi Sans"(w) "Nimbus Sans L"(w) "Nimbus Sans"(w) "Helvetica"(w) "Lucida Sans Unicode"(w) "BPG Glaho International"(w) "Tahoma"(w) "Noto Sans CJK JP"(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) "malayalam"(w) "Sampige"(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) "Hiragino Sans"(w) "PingFang SC"(w) "PingFang TC"(w) "PingFang HK"(w) "Hiragino Sans CNS"(w) "Hiragino Sans GB"(w) "MgOpen Modata"(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) "TSCu_Paranar"(w) "Noto Sans CJK KR"(w) "NanumGothic"(w) "Apple SD Gothic Neo"(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 Odia"(w) "LKLUG"(w) "Noto Sans"(w) "FreeSans"(w) "Arial Unicode MS"(w) "Arial Unicode"(w) "Code2000"(w) "Code2001"(w) "sans-serif"(s) "Roya"(w) "Koodak"(w) "Terafik"(w) "sans-serif"(w) "sans-serif"(w), "Adwaita Mono"(w)Then in the score JP > KR by ordering, JP > Noto Sans by character set.
So for Noto Fonts CJK ordering the file must be before 65-nonlatin.conf. E.g. 64-noto-cjk-pref.conf:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>sans-serif</family>
<prefer>
<family>Noto Sans CJK JP</family>
</prefer>
</alias>
<alias>
<family>serif</family>
<prefer>
<family>Noto Serif CJK JP</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Noto Sans Mono CJK JP</family>
</prefer>
</alias>
</fontconfig>Turns out this is the right answer: https://github.com/lch/fontconfig/blob/ … refer.conf
p.s. This cannot be put under user config ~/.config/fontconfig/conf.d/, because of /etc/fonts/conf.d/50-user.conf which will load it at precedence 50.
Last edited by Beemo (2026-10-01 06:24:53)
Offline
❯ fc-match charset=76F4
NotoSans-Regular.ttf: "Noto Sans" "Regular"
❯ fc-match sans:charset=76F4
NotoSansCJK-Regular.ttc: "Noto Sans CJK JP" "Regular"
❯ fc-match charset=4c
NotoSans-Regular.ttf: "Noto Sans" "Regular"
❯ fc-match sans:charset=4c
NotoSans-Regular.ttf: "Noto Sans" "Regular"Last edited by Beemo (2026-10-01 05:05:55)
Offline
Still, characters without typeface info (e.g. Sans) will use the wrong font. Not sure if happens anywhere tho.
Also is there a better way? Doing it font by font is pretty tedious.
Better ask the upstream, nobody online has managed to do such a thing...
Last edited by Beemo (2026-10-01 06:25:51)
Offline
* Override *-latin w/ versions that prefer the JP fonts (ie. basically restore the status quo ante
* forego installing the overweight noto package and just fetch and install the CJK fonts you actually want from google
*
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>Noto Sans Mono CJK KR</family>
<prefer>
<family>Noto Sans Mono CJK JP</family>
</prefer>
</alias>
</fontconfig>? (No idea whether the latter works)
Offline