Hello! On my Ubuntu system I have three Chinese fonts (AR PL ShanHeiSun Uni, AR PL ZenKai Uni and SimSun), two Japanese fonts and four Korean fonts. I''m interested in the Chinese looking good, wanting SimSun by default, but right now sometimes glyphs from the other Chinese fonts and the Japanese and Korean fonts are sometimes used, which looks horrible when they are a different style than the Chinese font. I tried this in my .fonts.conf: <alias> <family>sans-serif</family> <prefer> <family>SimSun</family> </prefer> </alias> <alias> <family>serif</family> <prefer> <family>SimSun</family> </prefer> </alias> <alias> <family>monospace</family> <prefer> <family>SimSun</family> </prefer> </alias> Unsurprisingly, this causes the english glyphs in SimSun to be used for all english text, which I don''t want. So I tried adding <match target="font"> <test name="family"><string>SimSun</string></test> <edit name="lang" mode="assign"><string>zh-cn</string></edit> </match> But this doesn''t change anything, SimSun is still used for english writing. What is the proper way to use the Chinese font by default but forbid it from being used for anything but Chinese? BTW, do my alias-family-prefer snippets override the settings in /etc/fonts/fonts.conf so that even if I could forbid SimSun from being used for english text the font-matching would be completely broken for all non-chinese text? // Philip J?genstedt
On Sat, 2006-06-10 at 23:14 +0200, Philip J?genstedt wrote:> Hello! > > On my Ubuntu system I have three Chinese fonts (AR PL ShanHeiSun Uni, AR > PL ZenKai Uni and SimSun), two Japanese fonts and four Korean fonts. I''m > interested in the Chinese looking good, wanting SimSun by default, but > right now sometimes glyphs from the other Chinese fonts and the Japanese > and Korean fonts are sometimes used, which looks horrible when they are a > different style than the Chinese font.What you probably want here is to prefer fonts which support Chinese to those supporting only Japanese or Korean. What I do is ensure that in the face of no language information provided by the application, I add *both* English and Japanese to the pattern. This pushes English-supporting fonts to the fore and while Japanese-supporting fonts follow along afterwards: <!-- set desired language if unset --> <match target="pattern" > <test compare="eq" name="lang" qual="all" > <string>unset</string> </test> <edit name="lang" > <string>en</string> <string>ja</string> </edit> </match> The <test> is a bit misleading -- it''s checking to see if no language was set at all by ensuring that ''all'' of the settings are equal to ''unset''; the only way that could be true is if there were no settings at all. Replace ''en'' with your own language, and ''ja'' with your preferred form of Chinese, one of zh-cn, zh-hk, zh-mo, zh-sg or zh-tw. Thinking in languages instead of font families seems indirect, but we haven''t come up with a better way to specify what purpose the fonts are intended for. -- keith.packard@intel.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20060610/6a94c0a8/attachment.pgp
Le samedi 10 juin 2006 ? 23:14 +0200, Philip J?genstedt a ?crit : Hi,> Unsurprisingly, this causes the english glyphs in SimSun to be used for > all english text, which I don''t want. So I tried adding > > <match target="font"> > <test name="family"><string>SimSun</string></test> > <edit name="lang" mode="assign"><string>zh-cn</string></edit> > </match> > > But this doesn''t change anything, SimSun is still used for english writing. > > What is the proper way to use the Chinese font by default but forbid it > from being used for anything but Chinese?I don''t have the answer but I asked the almost the same question as you this morning : have a way to force the use of a font different than the default one for some specific script (the simple priority rules of fontconfig aliases suck a lot since they don''t take the actual langage you are reading/writing into account) In pseudo-code if script=foo (and style=bar?) use this font (list?) instead of the default one. You may try ==============<match> <test name="lang"> <string>zh-cn</string> </test> <edit name="family" mode="prepend" binding="same"> <string>SimSun</string> </edit> </match> ============== It''s not ideal for my needs, but maybe it''s good enough for you (please report if it works or if you find a better variation - I still have my own problem to solve) The opinions of the people who actually know fontconfig (as opposed to an ignoranamus like me) are so far a mystery. Regards, -- Nicolas Mailhot -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Ceci est une partie de message =?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20060610/6b11704f/attachment.pgp
Le samedi 10 juin 2006 ? 14:30 -0700, Keith Packard a ?crit :> What you probably want here is to prefer fonts which support Chinese to > those supporting only Japanese or Korean. What I do is ensure that in > the face of no language information provided by the application, I add > *both* English and Japanese to the pattern.Hi Keith, Do you also have an answer for me? Pretty please? I need to tell fontconfig if language=foo prefer this font (list) instead of the default list in sans... aliases (some users are quite vocal in wanting to force a particular font for their script, it''s not possible to make *all* of them at the top of fontconfig priorities and making the decision based on glyph coverage is no good at all. A font may have pretty glyphs for one unicode block - pushing it to the top of the font list - and bad/average/incomplete glyphs for another. If you put it on top you discriminate against the people using the second glyphs, if you put it to the bottom you discriminate against users of the first glyphs) Regards, -- Nicolas Mailhot -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Ceci est une partie de message =?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20060611/f4683556/attachment.pgp
[resending through a relay not blacklisted by RBL+] Le samedi 10 juin 2006 ? 14:30 -0700, Keith Packard a ?crit :> What you probably want here is to prefer fonts which support Chinese to > those supporting only Japanese or Korean. What I do is ensure that in > the face of no language information provided by the application, I add > *both* English and Japanese to the pattern.Hi Keith, Do you also have an answer for me? Pretty please? I need to tell fontconfig if language=foo prefer this font (list) instead of the default list in sans... aliases (some users are quite vocal in wanting to force a particular font for their script, it''s not possible to make *all* of them at the top of fontconfig priorities and making the decision based on glyph coverage is no good at all. A font may have pretty glyphs for one unicode block - pushing it to the top of the font list - and bad/average/incomplete glyphs for another. If you put it on top you discriminate against the people using the second glyphs, if you put it to the bottom you discriminate against users of the first glyphs) Regards, -- Nicolas Mailhot -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Ceci est une partie de message =?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20060611/ba671cdb/attachment.pgp