Owen Taylor
2005-Nov-21 08:50 UTC
[Fontconfig] Setting preferred fonts that are not supported by the current locale
On Mon, 2004-07-05 at 12:23, Maarten van Gompel wrote:> I have a bit of a problem I can''t seem to solve.. I want to set an alias > for Sans that prefers various fonts so the total will display most scripts > nicely. > > The problem I face now is that I can''t seem to get the system to prefer > fonts that don''t support my locale!This is a known problem with the fontconfig matching algorithm; fontconfig will sort *all* fonts matching the locale before all other fonts, but really once you''ve found *one* font for Russian, you want to ignore the language tag. In Pango, I''ve handled this reasonably well for many cases by implementing "language tag refinement" - if Pango finds a ''ru'' language tag on text that is in the Devanagari or Arabic script it will recognize the mismatch and substitute a more appropriate language tag (or ''xx'' when it doesn''t know anything better.) In terms of workarounds for non-GTK+/non-Pango programs, I don''t really have a good suggestion. You can configure your aliases to ignore language tags altogether by using strong bindings, but this will give you decidely inferior results when language tags are present (for instance, on Web pages) Regards, Owen -------------- 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/20040705/20a5e45a/attachment.pgp
Maarten van Gompel
2005-Nov-21 08:50 UTC
[Fontconfig] Setting preferred fonts that are not supported by the current locale
I have a bit of a problem I can''t seem to solve.. I want to set an alias for Sans that prefers various fonts so the total will display most scripts nicely. The problem I face now is that I can''t seem to get the system to prefer fonts that don''t support my locale! For example, I have the following set: <alias> <family>sans-serif</family> <prefer> <family>DVBOTSurekh</family> <family>shiDeva</family> <family>Raghindi</family> <family>Simplified Arabic</family> <family>FreeSans</family> <family>Arial Unicode MS</family> <family>Bitstream Cyberbit</family> <family>Code2000</family> </prefer> </alias> First there are some devanagari-only (hindi) fonts, then an arabic-only font, etc... I have my locale set to russian, and because of that, I can''t seem to get the preferred fonts on top! I want those on top regardless of my locale, because the idea is that the first fonts give me devanagari, the following arabic and the rest is filled in later... Is there any way to tell fontconfig to use my preferred fonts regardless of the locale? Since I''m in a full-unicode environment I aim to display all languages correctly, the locale is more or less irrelevant... I have tried the following in an attempt to tell to all fonts that they support russian (my locale) (making the whole thing locale independant) , but it didn''t work.. it seems the lang property is read-only? <match target="font"> <edit name="lang" mode="append_last"> <string>ru</string> </edit> </match> I''ve run out of options and would appreciate if anybody could show me the way. This surely must be possible right? -- Maarten van Gompel (Proycon) proycon@anaproy.homeip.net proycon@unilang.org -------------------------------------------------------------------------- Personal Homepage: http://proycon.unilang.org UniLang Language Community: http://www.unilang.org -------------------------------------------------------------------------- JABBER: maartenvg@luon.net, ICQ: 15099138, AIM: proycon MSN: proycon_linux@hotmail.com --------------------------------------------------------------------------