Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Does alacritty ignore fontconfig's charset property? #5351

Closed
huyuehui opened this issue Jul 20, 2021 · 3 comments
Closed

Comments

@huyuehui
Copy link

OS: Linux
Version: 0.8.0
WM: Wayland

I want to use only the Latin part of the glyphs in a CJK font. In my fonts.conf, the charset property is set to specify the ranges of glyphs that I need. It doesn't work.

I use 'Migu-1M' font to display 'en' and 'ja' glyphs. 'SourceHanSansCN' font is for Chinese glyphs. But the fallback doesn't happen. Alacritty uses the Japanese glyph to display the Chinese glyph of the same unicode code point.

If a non CJK font is used instead of 'Migu-1M', the fallback mechanism works fine.


Log:

locale

LANG=en_US.utf8
LC_CTYPE=zh_CN.UTF-8
......

fc-validate

migu-1m-regular.ttf:0 Satisfy the coverage for en language
migu-1m-regular.ttf:0 Satisfy the coverage for ja language
migu-1m-regular.ttf:0 Missing 2617 glyph(s) to satisfy the coverage for zh-cn language

fc-match monospace

migu-1m-regular.ttf: "Monospace" "Regular"
migu-1m-bold.ttf: "Monospace" "Bold"
SourceHanSansCN-Regular.otf: "zhHei" "Regular"
SourceHanSansCN-Medium.otf: "zhHei" "Medium"
......

fc-cat

...charset=20-7e a0-181 186 189-18a 18e-194 198-19b 19d-1a1 1af-1b1 1b3-1b6 1bf-1e3 1e6-1ed 1ef-1f5 1f7-1ff 218-21f 230-233 237 23d 250-2ff 372-375 37a 37e 384-38a 38c 38e-3a1 3a3-3e1 400-45f 462-463 472-475 480-481 490-491 4ae-4af 4e8-4e9 20a1 20a8-20ac 20af-20b3 20b5 2103 2113 2116 211e 2121-2122 2126-2127 2160-216b 2170-217b 2190-2199 21b0-21b5 21c4-21ca 21d0-21d9 21e4-21ed 2400-2426 2460-2473 24d0-24ff 2776-2793 2a2f 2c71 2c7d 3041-3096 3099-30ff 31f0-31ff a78b-a78c fb00-fb04 feff...

@chrisduerr
Copy link
Member

Sounds like an issue with your fontconfig configuration. Did you verify this works at all?

@huyuehui
Copy link
Author

huyuehui commented Jul 21, 2021

Sounds like an issue with your fontconfig configuration. Did you verify this works at all?

Replace the migu-1m font with a font contains only westen glyphs, such as source code pro or jetbrainsmono. With almost the same fontconfig's settings, the issue is gone.

Rxvt-unicode works fine with the following font settings.

URxvt.font: xft:Monospace, xft:zhHei

@chrisduerr
Copy link
Member

Before loading any font, we make sure that the charset contains the glyph we're looking for. So as far as I can see this should work. Though I've never tested a lot of different fontconfig configs yourself.

Though if replacing fonts fixed it for you, that should be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants