[opensuse-m17n] Re: noto-sans-cjk-fonts' config replaces "serif" with "Noto Sans CJK *" (sans)
Hi I move the config file from noto-sans-cjk-fonts to fonts-config https://build.opensuse.org/package/view_file/home:ftake:branches:M17N/ fonts-config/59-family-prefer-locale-specific.conf As far as I read 60-family-prefer.conf, the preferred serif font for Chinese is not clear. (There are some sans font in preference list.) After some investigation, I set following fonts zh-cn: AR PL UMing CN zh-sg: AR PL UMing CN zh-tw: AR PL CMEXSong UMing TW zh-hk: AR PL CMEXSong UMing HK zh-mo: AR PL CMEXSong UMing HK ko: NanumMyeongjo Chinese maintainers, is this configuration appropriate?
I _guess_ that the consequence would be that, if e. g. IPA PMincho contains latin characters, then that ones will be used for given locale instead of that ones in 60-family-prefer.conf.
Well, before the problematic conf file is not installed, IPA PMincho has been used for latin characters. However, IPA* fonts does not provide good glyphs (suitable for FreeType). So following this approach:
1. adding prefered latin fonts before that cjk ones to 59-family-prefer-cjk.conf
I put "Roboto Slab" before IPA* fonts. Here, the binding="strong" is important. Without it, fc-match picks IPAMincho before Roboto Slab. <match target="pattern"> <test qual="any" name="family" compare="eq"> <string>serif</string> </test> <test name="lang" compare="eq"> <string>ja</string> </test> <edit name="family" mode="prepend" binding="strong"> <!-- use latin font for non Japanese characters --> <string>Roboto Slab</string> <string>IPAPMincho</string> <string>IPAexMincho</string> </edit> </match> I am finding the best latin font used with IPA* fonts. BTW, 60-family-prefer.conf is still important when CJK character is used under non-CJK environment where LC_CTYPE is, for example, en. Fuminobu TAKEYAMA On 2016/09/07 16:41, Petr Gajdos wrote:
Fuminobu,
On Wed, Sep 07, 2016 at 02:13:17AM +0900, Fuminobu TAKEYAMA wrote:
Thank you for using your time for this help. I am sorry. I just wanted to ask the intention (requirement) of the latest package, which force to use Noto Sans as a serif font.
You do not need to sorry, your mail was actally that one which kick me to understand.
I vaguely remember there was a problem with overlapping unicode points in CJK. Perhaps Japanese variant of noto cjk ttc was chosen just because of alphabet order even for chinese text, or so. But I had not participated on the solution of the problem, so I do not know about it more.
As a quick fix for 42.2 and Tumbleweed, I will remove the following part from the config file: (1) appending Noto Sans CJK JP/SC/TC/KR to serif (2) appending Noto Sans (Mono) CJK Japanese to sans-serif (monospace) respectively
Just to be correct, _prepending_. Appending is also possible via append/<accept> alias.
About (2), we have discussed on the previous thread. We do not make it default sans/monospace for Japanese for now when the package is manually installed.
That is one option, as you say, quick. But let me propose a permanent solution and be critical.
What about somewhat copy the idea of 59-noto-sans-cjk.conf and generalize it, say to 59-family-prefer-cjk.conf, or maybe even 59-family-prefer-lang.conf for matter of future requests. I. e. introduce language specific variants of default preference lists and prepend them to that in 60-family-prefer.conf.
<!-- Japanese --> <match target="pattern"> <test qual="any" name="family" compare="eq"> <string>sans-serif</string> </test> <test name="lang" compare="eq"> <string>ja</string> </test> <edit name="family" mode="prepend"> <string>IPA PGothic</string> [.. another families better then noto ..] <string>Noto Sans CJK JP</string> [.. another families worse then noto ..] </edit> </match> <match target="pattern"> <test qual="any" name="family" compare="eq"> <string>serif</string> </test> <test name="lang" compare="eq"> <string>ja</string> </test> <edit name="family" mode="prepend"> <string>IPA PMincho</string> [.. another families ..] </edit> </match> <match target="pattern"> <test qual="any" name="family" compare="eq"> <string>monospace</string> </test> <test name="lang" compare="eq"> <string>ja</string> </test> <edit name="family" mode="prepend"> <string>IPA Gothic</string> [.. another families better then noto ..] <string>Noto Sans Mono CJK JP</string> [.. another families worse then noto ..] </edit> </match>
The same way for another languages, for now just Korean and Chinese.
Of course, these families could be then removed from 60-family-prefer.conf and the rest of lists in there could be perhaps reviewed and lightened a bit.
Because of 59- prefix it would be read after 56-user.conf (user conf from custom fonts.conf) and after 58-family-prefer-local.conf (fonts-config written configuration derived from /etc/sysconfig/fonts-config), it should not override the settings there.
I _guess_ that the consequence would be that, if e. g. IPA PMincho contains latin characters, then that ones will be used for given locale instead of that ones in 60-family-prefer.conf. YOU, C J and K guys need to decide if it is wrong for you or not. If not, that can be perhaps easily solved by (not sure what would be better):
1. adding prefered latin fonts before that cjk ones to 59-family-prefer-cjk.conf 2. remove surely all fonts from 60-family-prefer.conf that contains CJK characters and exchange order of 59-family-prefer-lang.conf and 60-family-prefer.conf, i. e. 59-family-prefer.conf and 60-family-prefer-lang.conf.
I would prefer the first variant slightly, when there would not be high duplication of 60-family-prefer.conf for each locale (one or two fonts at maximum). Each lang would have a freedom to decide which latin font match best in addition to their CJK-font-preference.
DISCLAIMER: all of this I wrote from top of my head, so sorry when I talk rubbish. Needs to be tested for sure.
Maybe I misunderstood some current situation. I will do more investigation e.g. fonts-config really works with the Noto's config file or not.
I do not think you misunderstood something. I recently unsubscribed as maintainer/bugowner of fontconfig/fonts-config for openSUSE because of the reasons I have already wrote in my previous email.
If you would like to take partly over, I will return myself as comaintainer with you.
Thanks, Petr
-- To unsubscribe, e-mail: opensuse-m17n+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-m17n+owner@opensuse.org
Hi I noticed that using latin font under Japanese environment is difficult as system default settings. (as user's custom setting, it's possible.) The configuration below in 59-faimily-prefer-by-locale.conf disables the preference list defined in 58-family-prefer-local.conf.
Here, the binding="strong" is important. Without it, fc-match picks IPAMincho before Roboto Slab.
<match target="pattern"> <test qual="any" name="family" compare="eq"> <string>serif</string> </test> <test name="lang" compare="eq"> <string>ja</string> </test> <edit name="family" mode="prepend" binding="strong"> <!-- use latin font for non Japanese characters --> <string>Roboto Slab</string> <string>IPAPMincho</string> <string>IPAexMincho</string> </edit> </match>
Suppose that 58-family-prefer-local.conf have <alias><family>serif</family><prefer><family>FooBar Mincho</family></prefer></alias> The resulting family list will be FooBar Mincho, Robot Slab, IPAPMincho, IPAexMincho, ..., serif However, the font fontconfig selects Robot Slab. This is because the selected font is not the one of the top of the family list but the family that have highest score. The scoring rule of fontconfig is not clear. It seems that its factor might be (a) The position of the family in the family list (b) The character sets provided by the family (c) The strength of binding The rule (b) precedes (a). This is why the CJK font is selected even though there are many latin families before the CJK family. For example, when we have a family list like: Roboto Slab, IPA Mincho, ..., serif (defined without strong binding) $ fc-match serif returns "IPA Mincho" under Japanese environment. To use "Robot Slab" for latin character under Japanese env., we need to use (c) "strong" binding as I mentioned before, which gives much higher score than (a) and (b). This enables us to use latin font for alphabets and Arabic numbers but the binding breaks other preference rules. I will give up using latin font for Japanese environment and revert to use always Japanese fonts as before. -- Fuminobu TAKEYAMA On 2016/09/11 23:12, Fuminobu TAKEYAMA wrote:
Hi
I move the config file from noto-sans-cjk-fonts to fonts-config https://build.opensuse.org/package/view_file/home:ftake:branches:M17N/ fonts-config/59-family-prefer-locale-specific.conf
As far as I read 60-family-prefer.conf, the preferred serif font for Chinese is not clear. (There are some sans font in preference list.)
After some investigation, I set following fonts
zh-cn: AR PL UMing CN zh-sg: AR PL UMing CN zh-tw: AR PL CMEXSong UMing TW zh-hk: AR PL CMEXSong UMing HK zh-mo: AR PL CMEXSong UMing HK ko: NanumMyeongjo
Chinese maintainers, is this configuration appropriate?
I _guess_ that the consequence would be that, if e. g. IPA PMincho contains latin characters, then that ones will be used for given locale instead of that ones in 60-family-prefer.conf.
Well, before the problematic conf file is not installed, IPA PMincho has been used for latin characters.
However, IPA* fonts does not provide good glyphs (suitable for FreeType). So following this approach:
1. adding prefered latin fonts before that cjk ones to 59-family-prefer-cjk.conf
I put "Roboto Slab" before IPA* fonts.
Here, the binding="strong" is important. Without it, fc-match picks IPAMincho before Roboto Slab.
<match target="pattern"> <test qual="any" name="family" compare="eq"> <string>serif</string> </test> <test name="lang" compare="eq"> <string>ja</string> </test> <edit name="family" mode="prepend" binding="strong"> <!-- use latin font for non Japanese characters --> <string>Roboto Slab</string> <string>IPAPMincho</string> <string>IPAexMincho</string> </edit> </match>
I am finding the best latin font used with IPA* fonts.
BTW, 60-family-prefer.conf is still important when CJK character is used under non-CJK environment where LC_CTYPE is, for example, en.
Fuminobu TAKEYAMA
On 2016/09/07 16:41, Petr Gajdos wrote:
Fuminobu,
On Wed, Sep 07, 2016 at 02:13:17AM +0900, Fuminobu TAKEYAMA wrote:
Thank you for using your time for this help. I am sorry. I just wanted to ask the intention (requirement) of the latest package, which force to use Noto Sans as a serif font.
You do not need to sorry, your mail was actally that one which kick me to understand.
I vaguely remember there was a problem with overlapping unicode points in CJK. Perhaps Japanese variant of noto cjk ttc was chosen just because of alphabet order even for chinese text, or so. But I had not participated on the solution of the problem, so I do not know about it more.
As a quick fix for 42.2 and Tumbleweed, I will remove the following part from the config file: (1) appending Noto Sans CJK JP/SC/TC/KR to serif (2) appending Noto Sans (Mono) CJK Japanese to sans-serif (monospace) respectively
Just to be correct, _prepending_. Appending is also possible via append/<accept> alias.
About (2), we have discussed on the previous thread. We do not make it default sans/monospace for Japanese for now when the package is manually installed.
That is one option, as you say, quick. But let me propose a permanent solution and be critical.
What about somewhat copy the idea of 59-noto-sans-cjk.conf and generalize it, say to 59-family-prefer-cjk.conf, or maybe even 59-family-prefer-lang.conf for matter of future requests. I. e. introduce language specific variants of default preference lists and prepend them to that in 60-family-prefer.conf.
<!-- Japanese --> <match target="pattern"> <test qual="any" name="family" compare="eq"> <string>sans-serif</string> </test> <test name="lang" compare="eq"> <string>ja</string> </test> <edit name="family" mode="prepend"> <string>IPA PGothic</string> [.. another families better then noto ..] <string>Noto Sans CJK JP</string> [.. another families worse then noto ..] </edit> </match> <match target="pattern"> <test qual="any" name="family" compare="eq"> <string>serif</string> </test> <test name="lang" compare="eq"> <string>ja</string> </test> <edit name="family" mode="prepend"> <string>IPA PMincho</string> [.. another families ..] </edit> </match> <match target="pattern"> <test qual="any" name="family" compare="eq"> <string>monospace</string> </test> <test name="lang" compare="eq"> <string>ja</string> </test> <edit name="family" mode="prepend"> <string>IPA Gothic</string> [.. another families better then noto ..] <string>Noto Sans Mono CJK JP</string> [.. another families worse then noto ..] </edit> </match>
The same way for another languages, for now just Korean and Chinese.
Of course, these families could be then removed from 60-family-prefer.conf and the rest of lists in there could be perhaps reviewed and lightened a bit.
Because of 59- prefix it would be read after 56-user.conf (user conf from custom fonts.conf) and after 58-family-prefer-local.conf (fonts-config written configuration derived from /etc/sysconfig/fonts-config), it should not override the settings there.
I _guess_ that the consequence would be that, if e. g. IPA PMincho contains latin characters, then that ones will be used for given locale instead of that ones in 60-family-prefer.conf. YOU, C J and K guys need to decide if it is wrong for you or not. If not, that can be perhaps easily solved by (not sure what would be better):
1. adding prefered latin fonts before that cjk ones to 59-family-prefer-cjk.conf 2. remove surely all fonts from 60-family-prefer.conf that contains CJK characters and exchange order of 59-family-prefer-lang.conf and 60-family-prefer.conf, i. e. 59-family-prefer.conf and 60-family-prefer-lang.conf.
I would prefer the first variant slightly, when there would not be high duplication of 60-family-prefer.conf for each locale (one or two fonts at maximum). Each lang would have a freedom to decide which latin font match best in addition to their CJK-font-preference.
DISCLAIMER: all of this I wrote from top of my head, so sorry when I talk rubbish. Needs to be tested for sure.
Maybe I misunderstood some current situation. I will do more investigation e.g. fonts-config really works with the Noto's config file or not.
I do not think you misunderstood something. I recently unsubscribed as maintainer/bugowner of fontconfig/fonts-config for openSUSE because of the reasons I have already wrote in my previous email.
If you would like to take partly over, I will return myself as comaintainer with you.
Thanks, Petr
-- To unsubscribe, e-mail: opensuse-m17n+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-m17n+owner@opensuse.org
participants (1)
-
Fuminobu TAKEYAMA