Summary: | Language Match problem for Chinese, Japanese and Korean | ||
---|---|---|---|
Product: | fontconfig | Reporter: | Guo Yunhe <guoyunhebrave> |
Component: | library | Assignee: | fontconfig-bugs |
Status: | RESOLVED NOTABUG | QA Contact: | Behdad Esfahbod <freedesktop> |
Severity: | normal | ||
Priority: | medium | CC: | akira |
Version: | 2.11 | ||
Hardware: | Other | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | fc-match debug information |
Description
Guo Yunhe
2015-09-10 09:38:55 UTC
it is hard to figure out the reason of that result by the part of configuration. I guess you may have other configuration that fontconfig determines that way. try FC_DEBUG=4 to see what kinda configuration you have or FC_DEBUG=3 to see how fontconfig evaluates fonts to determine the best font or FC_DEBUG=7 to see both. in most cases, the sort of this claim isn't a bug in fontconfig but introduced by unexpected configurations. (In reply to Akira TAGOH from comment #1) > it is hard to figure out the reason of that result by the part of > configuration. I guess you may have other configuration that fontconfig > determines that way. try FC_DEBUG=4 to see what kinda configuration you have > or FC_DEBUG=3 to see how fontconfig evaluates fonts to determine the best > font or FC_DEBUG=7 to see both. > > in most cases, the sort of this claim isn't a bug in fontconfig but > introduced by unexpected configurations. How to use FC_DEBUG=7? Is it a command or paramater? Can you give me a full command line that I can try? it is an environment variable. try FC_DEBUG=3 fc-match blahblahblah. I tried FC_DEBUG=4 fc-match sans:lang=ko > debug.log ---------------------------------------------------- Prepend list before "Nimbus Sans L"(s) "WenQuanYi Zen Hei"(s) [marker] "sans-serif"(s) Prepend list after "Nimbus Sans L"(s) "WenQuanYi Zen Hei"(s) "Droid Sans Fallback"(s) "sans-serif"(s) FcConfigSubstitute editPattern has 9 elts (size 16) family: "Nimbus Sans L"(s) "WenQuanYi Zen Hei"(s) "Droid Sans Fallback"(s) "sans-serif"(s) rgba: 5(i)(w) lang: ko(s) "zh-CN"(w) lcdfilter: 0(i)(w) prgname: "fc-match"(s) force_hintstyle: "none"(w) force_autohint: False(w) force_bw: False(w) force_bw_monospace: False(w) ---------------------------------------------------- I found there is always a "zh_CN" following "ko". Fontconfig always prepends "WenQuanYi Zen Hei" (zh_CN font) before "Droid Sans Fallback" (ko font). When I change Chinese China font in ~/.config/fontconfig/fonts.conf , fontconfig will prepend new Chinese China font before "Droid Sans Fallback" (Korean font). I don't have other user configuration, system configuration didn't do anything to the language. Created attachment 118185 [details]
fc-match debug information
try drop binding="strong" from your configuration. that breaks the binding in the pattern and always force to make the result with the strong bindidng even if the binding of the matched value in the pattern was a weak. I have removed binding="strong" from zh-cn language match. Now fontconfig will not insert before ja, zh-tw, zh-hk fonts. (these language matches have binding="strong" property). If I remove all binding="strong" from all language matches, then Chinese China (zh-cn) will still insert before zh-tw, zh-hk, ja, ko. It seems Chinese China always has a higher binding than others. Any idea about this? I forgot to mention why you always have zh-cn. fontconfig picks up the lang from current locale with the weak binding. I guess because you're running on zh_CN locale and basically Chinese fonts has enough coverage of JK glyphs. so since fontconfig tries to evaluate the configuration at first, Chinese fonts has better priority for them. The solution for that is, run apps with the locale other than zh_CN or move zh-cn configuration later than others. Yes, this is the answer for me! I am configuring fontconfig for Firefox. When I visit Japanese Wikipedia, the page use zh_CN fonts, though it has lang="ja" property. I write a small GUI tool to configure fontconfig (user configuration files). https://github.com/guoyunhe/fontweak I have another question: If my system language is Chinese Hongkong, or Korean, will it also cover other languages? (In reply to Guo Yunhe from comment #10) > Yes, this is the answer for me! > > I am configuring fontconfig for Firefox. When I visit Japanese Wikipedia, > the page use zh_CN fonts, though it has lang="ja" property. > > I write a small GUI tool to configure fontconfig (user configuration files). > https://github.com/guoyunhe/fontweak > > I have another question: If my system language is Chinese Hongkong, or > Korean, will it also cover other languages? as long as you configure your fontconfig files properly and applications requests fonts with proper queries, yes. of course assuming renderers has enough functionality to do so. Anyway, I'm closing this so that it isn't a bug in fontconfig. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.