Kenichi Handa
2008-Oct-06 06:04 UTC
[Fontconfig] How to delete "ja" lang from a specific font?
I installed the font "WenQuanYi Zen Hei" by the debian package "ttf-wqy-zenhei". The font convers many Han glyphs including Japanese specific ones. % fc-list ''WenQuanYi Zen Hei'' lang shows this list: :lang=aa|af|ast|ava|ay|be|bg|bi|br|ca|ce|ch|co|da|de|el|en|es|eu|fj|fo|fr|fur|fy|gd|gl|gv|ho|ia|id|ie|ik|io|is|it|ja|ko|kum|lb|lez|mg|nb|nds|nl|nn|no|nr|ny|oc|om|os|pt|rm|ru|sel|sh|sm|sma|smj|so|sq|sr|ss|st|sv|sw|to|ts|vo|wa|wo|xh|yap|zh-cn|zh-hk|zh-mo|zh-sg|zh-tw|zu But, as Japanese glyphs are not good, I''d like to remove "ja" from that language list. Could someone please tell me how to write ~/.fonts.conf for that? --- Kenichi Handa handa at ni.aist.go.jp
Qianqian Fang
2008-Oct-06 17:43 UTC
[Fontconfig] How to delete "ja" lang from a specific font?
an ugly fix would be adding the following block to your ~/.fonts.conf, replacing "Kochi Gothic" with your favorite Japanese font. <match target="pattern"> <test equal="any" compare="eq" name="family"> <string>WenQuanYi Zen Hei</string> </test> <test equal="any" compare="eq" name="lang"> <string>ja</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Kochi Gothic</string> </edit> </match> The best solution would be re-optimize the font rendering order in 65-nonlatin.conf by fontconfig upstream, which I have heard that Badhad is doing it right now. An earlier reply I sent to Frederic Crozat (Mandriva), from whom I heard the plan, I had a little proposal. My reply is attached. -------- Original Message -------- Subject: Re: Fwd: issue with 85-wqy-bitmapsong.conf file in fontconfig Date: Tue, 26 Aug 2008 14:56:58 -0400 From: Qianqian Fang <fangq at nmr.mgh.harvard.edu> To: Funda Wang <fundawang at gmail.com>, fcrozat at mandriva.com References: <1219740133.6380.89.camel at trinidad.mandrakesoft.com> <e7f875700808260202n4b858a6v3e191683319c8784 at mail.gmail.com> <e7f875700808260204s2fcb79k74729be5cba0f995 at mail.gmail.com> hi Frederic and Funda Bedhad and I had similar discussions last year on this issue, please read the followings posts for my explanations: http://www.redhat.com/archives/fedora-fonts-list/2007-November/msg00062.html http://www.redhat.com/archives/fedora-fonts-list/2007-December/msg00002.html The reason for writing this controversial config file is to compensate the fact that fontconfig upstream has given too high priority to Japanese fonts and Uming for display Chinese under either non-CJK locales and CJK locales. The Hanzi glyphs in most free Japanese fonts are generally low in quality (comparing with commercial Japanese/Chinese fonts). There are also 10s of thousands of missing characters in Unicode CJK block (GB2312+Big5 requires 16000 Hanzi, GBK requires 20932 Hanzi, but JIS only covers 6000 Hanzi). Because Japanese fonts (Micho,Gothic etc) have higher priority by default, when viewing Chinese articles under non-CJK locales (such as en_US, my default locale), the Chinese text will be displayed by mosaics of various of fonts: Micho, Gothic, Uming, Ukai, unifont etc. This is very annoying and complained widely in Chinese Linux forums. There are also common-script issues from Pango as Funda pointed out troubling many CJK users, see http://www.redhat.com/archives/fedora-fonts-list/2007-December/msg00013.html For 9pt-12pt font sizes, register bitmap-song before all Japanese fonts, while below the default Latin vector fonts (Dejavu/Bitstream) is my original intent with this config file (without requiring fontconfig upsteam to change their font order). But now, if Bedhad is willing to reconsider font orders, we do not need this config file at all. (because the wqy''s bitmap fonts are extensively improved version of those embedded in Uming, we also want bitmap-song has higher priority than Uming between 9-12pt). My preferences for Chinese font display order for screen-use will be for non-(Japanese/Korean) locales: Latin fonts > Chinese Hei Ti (wqy-zenhei) > wqy-bitmap-song > Uming > Ukai > Japanese fonts (uming/ukai were good for printing, but not screen use) for Japanese/Korean locales: Latin fonts > Japanese/Korean fonts > Chinese Hei Ti (wqy-zenhei) > wqy-bitmap-song > Uming > Ukai In Ubuntu, the default Chinese fonts were ordered for Sans and Serif separately,where wqy-zenhei is the default Sans Chinese font, and Uming is the default Serif font, that also works for me, except that I want wqy-bitmap-song goes before Uming between 9-12pt. Qianqian Funda Wang wrote:> 2008/8/26 Frederic Crozat <fcrozat at mandriva.com>: > >> Hi Funda, >> >> Bedhad (pango maintainer and fontconfig co-maintainer) has started >> reviewing our Mandriva fontconfig configuration to see what he could >> merge in upstream fontconfig (the ultimate goal would be to have no >> changes in our package). >> >> He noticed 85-wqy-bitmapsong.conf file was forcing WenQuanYi Bitmap Song >> font, even for en and en-US language. Is it really wanted ? >> > This fontconfig file comes from upstream. Personally, I don''t think > WenQuanYi Bitmap Song should be singled out. Maybe we could discuss it > with WenQuanYi maintainer (CC''ed). > > In fact, the displaying result we want is descibed extensively in > gnome bug#321113, which bedhad should already know. As pango does not > want to get the bug solved, the only method for now is using ugly > fontconfig rules. > > >> Thanks in advance for your reply. >> -- >> Frederic Crozat <fcrozat at mandriva.com> >> MandrivaKenichi Handa wrote:> I installed the font "WenQuanYi Zen Hei" by the debian > package "ttf-wqy-zenhei". The font convers many Han glyphs > including Japanese specific ones. > > % fc-list ''WenQuanYi Zen Hei'' lang > > shows this list: > > :lang=aa|af|ast|ava|ay|be|bg|bi|br|ca|ce|ch|co|da|de|el|en|es|eu|fj|fo|fr|fur|fy|gd|gl|gv|ho|ia|id|ie|ik|io|is|it|ja|ko|kum|lb|lez|mg|nb|nds|nl|nn|no|nr|ny|oc|om|os|pt|rm|ru|sel|sh|sm|sma|smj|so|sq|sr|ss|st|sv|sw|to|ts|vo|wa|wo|xh|yap|zh-cn|zh-hk|zh-mo|zh-sg|zh-tw|zu > > But, as Japanese glyphs are not good, I''d like to remove > "ja" from that language list. Could someone please tell me > how to write ~/.fonts.conf for that? > > --- > Kenichi Handa > handa at ni.aist.go.jp > _______________________________________________ > Fontconfig mailing list > Fontconfig at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/fontconfig > > > >
Kenichi Handa
2008-Oct-07 01:39 UTC
[Fontconfig] How to delete "ja" lang from a specific font?
In article <48EA4E43.1040800 at nmr.mgh.harvard.edu>, Qianqian Fang <fangq at nmr.mgh.harvard.edu> writes:> an ugly fix would be adding the following block to your ~/.fonts.conf, > replacing "Kochi Gothic" with your favorite Japanese font.> <match target="pattern"> > <test equal="any" compare="eq" name="family"> > <string>WenQuanYi Zen Hei</string> > </test> > <test equal="any" compare="eq" name="lang"> > <string>ja</string> > </test> > <edit name="family" mode="prepend" binding="strong"> > <string>Kochi Gothic</string> > </edit> > </match>Thank you for the prompt reply. But, with that in ~/.fonts.conf, "WenQuanYi Zen Hei" is still listed by the command "fc-list :lang=ja".> The best solution would be re-optimize the font rendering order > in 65-nonlatin.conf by fontconfig upstream, which I have heard > that Badhad is doing it right now.I''m not sure that is a good solution. As we already have better Japanese fonts than "WenQuanYi Zen Hei", I think just telling fontconfig that the font doesn''t support "ja" is the simplest and best solution. Isn''t it possible? --- Kenichi Handa handa at ni.aist.go.jp
Funda Wang
2008-Oct-07 02:35 UTC
[Fontconfig] How to delete "ja" lang from a specific font?
2008/10/7 Kenichi Handa <handa at m17n.org>:> In article <48EA4E43.1040800 at nmr.mgh.harvard.edu>, Qianqian Fang <fangq at nmr.mgh.harvard.edu> writes: > >> an ugly fix would be adding the following block to your ~/.fonts.conf, >> replacing "Kochi Gothic" with your favorite Japanese font. > >> <match target="pattern"> >> <test equal="any" compare="eq" name="family"> >> <string>WenQuanYi Zen Hei</string> >> </test> >> <test equal="any" compare="eq" name="lang"> >> <string>ja</string> >> </test> >> <edit name="family" mode="prepend" binding="strong"> >> <string>Kochi Gothic</string> >> </edit> >> </match> > > Thank you for the prompt reply. But, with that in > ~/.fonts.conf, "WenQuanYi Zen Hei" is still listed by the > command "fc-list :lang=ja". > >> The best solution would be re-optimize the font rendering order >> in 65-nonlatin.conf by fontconfig upstream, which I have heard >> that Badhad is doing it right now. > > I''m not sure that is a good solution. As we already have > better Japanese fonts than "WenQuanYi Zen Hei", I think just > telling fontconfig that the font doesn''t support "ja" is the > simplest and best solution. Isn''t it possible?Then something like <rejectfont>?> > --- > Kenichi Handa > handa at ni.aist.go.jp > _______________________________________________ > Fontconfig mailing list > Fontconfig at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/fontconfig >
Funda Wang
2008-Oct-07 02:43 UTC
[Fontconfig] How to delete "ja" lang from a specific font?
> Then something like <rejectfont>?<fontconfig> <selectfont> <rejectfont> <pattern> <patelt name="family"><string>WenQuanYi Zen Hei</string></patelt> <patelt name="lang"><string>jp</string></patelt> </pattern> </rejectfont> </selectfont> </fontconfig> But i don''t know if it will work.> >> >> --- >> Kenichi Handa >> handa at ni.aist.go.jp >> _______________________________________________ >> Fontconfig mailing list >> Fontconfig at lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/fontconfig >> >
Kenichi Handa
2008-Oct-07 04:41 UTC
[Fontconfig] How to delete "ja" lang from a specific font?
In article <e7f875700810061943j3285a12m1279e82079d8f95b at mail.gmail.com>, "Funda Wang" <fundawang at gmail.com> writes:> > Then something like <rejectfont>? > <fontconfig> > <selectfont> > <rejectfont> > <pattern> > <patelt name="family"><string>WenQuanYi Zen > Hei</string></patelt> > <patelt name="lang"><string>jp</string></patelt> > </pattern> > </rejectfont> > </selectfont> > </fontconfig>> But i don''t know if it will work.I tried it but still "fc-list :lang=ja" lists WenQuanYi. --- Kenichi Handa handa at ni.aist.go.jp