[Fontconfig] Font matching in Unicode locales

John Alexander Thacker thacker at math.cornell.edu
Sat Oct 25 15:09:50 EST 2003


I have a real problem with fontconfigi-2.2.1 selecting the wrong fonts for 
the Sans alias when I'm in a Unicode locale, specifically en_US.UTF-8.  It 
seems that fontconfig prioritizes the current language setting too much, 
which is a real problem when the intended glyphs come from a language other 
than English.

Specifically, I occasionally view Japanese Unicode files, though I want 
my UI to remain English, and hence keep my locale as en_US.UTF-8.  I'd 
like the Sans alias to use the preferred Kochi Gothic for viewing Japanese 
glyphs, and similarly to use Kochi Mincho for Serif.  In fact, these are
listed as preferred by default in fonts.conf, if I understand the file.

However, neither Kochi Gothic nor Kochi Mincho list "en" as a supported 
language.  This means that fontconfig will strongly prefer any other font
which has those glyphs to Kochi Gothic or Kochi Mincho.  On a RedHat 9
installation, this will mean preferring to use the far inferior hiragana
and katakana contained in the MiscFixed bitmap font to that in Kochi Gothic 
or Kochi Mincho.  (MiscFixed is installed by default as part of the
bitmap-fonts package, and placed in /usr/share/fonts/bitmap-fonts.)
Mozilla, of course, will completely refuse to use Kochi Gothic or Kochi
Mincho for Unicode at all, since, as previously discussed, it is even
more restrictive based on the language supported by a font.

The end result of this is fairly ridiculous.  Despite my locale being
en_US, when I'm in Unicode, I want to view Japanese characters with a 
Japanese font, not a font which is primarily an English font which happens 
to have a few badly drawn Japanese characters!  Ideally, I shouldn't have
to uninstall or unconfigure all fonts supporting English which also have
badly drawn characters from other languages.  And fonts which only contain
characters from other languages, but contain no Roman characters or are
otherwise unsuitable for English, shouldn't have to list "en" (and every
other language) as a supported language just to work right with Unicode
locales.

It seems to me that the promise of Unicode and fontconfig would be that
I could just set all my applications to use "Sans" (or "Monospace" or 
"Serif") by default, and that would always select the proper font.  I
shouldn't have to change my locale or my font just to view something in
Japanese-- that breaks the whole point of Unicode.

Perhaps this is different in 2.2.90 or CVS, but it doesn't look like it to 
me from the Changelog.

John Thacker




More information about the Fontconfig mailing list