flexibeast wrote: Sun Apr 05, 2026 12:58 am
ldd /usr/bin/kate | grep fontconfig
Thanks, it does use fontconfig
flexibeast wrote: Sun Apr 05, 2026 12:58 am
The `-s` option sorts the output from 'best' to 'worst' match.
Code: Select all
fc-match -s 'mono:lang=jp' | head -n1
The "best" for both queries is `DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"` It has no hieroglyphs.
How does this best-to-worst-matching work? Do programs scan this list and use the first font that has the required symbol? If yes, the topmost with CJK is `wqy-zenhei.ttc: "WenQuanYi Zen Hei Mono" "Regular"`
Somehow, it appears in Kate's font selection dialog only when "Show only monospaced fonts" is unchecked. Bug?
But yes, it seems that the line "あ23456789" uses digits from "WenQuanYi Zen Hei Mono" and the line "秋23456789" uses digits from "DejaVu Sans Mono".
The line "あ234f6789" uses WenQuanYi for "234" and DejaVu for "6789".
At least one question sorted out. Thanks.
But how does Kate pick them?
Does it assume that every symbol after Japanese-exclusive "あ" is also Japanese until it encounters end-of-line or a European letter? Can I disable this behavior?
And why does it behave correctly when I use "Droid" font instead of "Monospace"?
Could you answer several more Fontconfig questions?
I disabled all 3 DejaVu configs in "eselect fontconfig" and refreshed the cache. What should be the result? I still get DejaVu on top of fontconfig queries.
I've got several CJK fonts. How do I set the preferred one? With something like
Code: Select all
<test name="lang">
<string>ja</string>
</test>
<prefer>
<family>WenQuanYi Zen Hei Mono</family>
</prefer>
in ~/.config/fontconfig/fonts.conf ?
Is it possible to use fontconfig to set double symbol width e.g. when "WenQuanYi Zen Hei Mono" supplies symbols missing in "Droid Sans Mono Dotted"? Preferrably, by increasing spacing between symbols rather than stretching them.