[Pkg-fonts-devel] Fwd: Draining the font swamp

"Arne Götje (高盛華)" arne at linux.org.tw
Thu May 24 03:28:09 UTC 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ok, guys, here are my thoughts:

> I don't know:
> 
> - Exactly which pieces are used by GTK, Qt, XUL, etc. and how applications
>   using those APIs ask for a font specification

* GTK2 apps use fontconfig
* QT3 apps do not use fontconfig, at least not for the alias fonts
serif, sans and monotype
* Legacy X apps and GTK1 also cannot use fontconfig. They only use xft
to select the fonts. For these ones defoma is still neded.

> - Which applications ask for which font specifications, and where that's
>   configured (sometimes in the application itself, as in Firefox)

yes, firefox is a horrible application in this regard. Are there any
ways to change that behavior?

> - Which fonts are any good, and for which languages (no easy answer here)

IMHO the following needs to be done:

1. classify the available fonts into "Decorative" and "Desktop" fonts.
With "Decorative" I mean fonts, which are nice for *printing*, "Desktop"
refers to fonts which are suitable for *screen* display.
Example for Decorative fonts: AR PL ZenKai family, this is a brushstroke
CJK font, which is nice for printing documents, but horrible for screen
display.
Example for Desktop fonts: DejaVu sans. It's a smart font and a very
simple stroked font, makes it perfect for screen display... no issues
with hinting and so on...

2. A list of default fonts should be made for certain languages (this is
only interesting for screen display):
 * For Latin script DejaVu Sans and the SIL fonts for sans and serif
respectively should be on the top of the list. Both are smart fonts
which can compose almost any diacritical combination, as for Vietnamese,
European languages and African languages based on Latin script. Also
both fonts include the full list of IPA characters...
 * For CJK this is difficult. Here we have several issues to take care of:
  a) embedded bitmap glyphs are needed to render acceptable glyphs in
small fontsizes (12 pt and below)
  b) there is currently no font avaliable which covers all CJK glyphs in
Unicode
  c) we don't have any acceptable sans-serif font for CJK
  d) currently we can only use the ming/mincho style for screen display,
the Kochi Mincho and AR PL ShanHeiSun Uni fonts contain embedded bitmaps
already.
  e) CJK glyphs in China, Hong Kong, Taiwan, Japan and Korea have
different shapes which share the same Unicode codepoints. The available
fonts (ttf-arphic-uming, ttf-kochi-mincho and ttf-unfonts) overlap each
other in the CJK range, which confuses fontconfig! Chinese users usually
prefer the ttf-arphic-uming package, while Japanese users might prefer
the ttf-kochi-mincho or ttf-sazanami-mincho fonts and Korean users stick
with the ttf-unfonts package. What makes it worse is, that fontconfig
comes with a predefined list of fonts which should be preferred. This
does not suit all CJK users, as they have different preferences.

For all these CJK issues I'm working on a solution. But it takes time
until it's ready.

 * For other scripts I don't know in the moment.

> - Which criteria are important for selecting which font to use in which
>   context (language, character set, ...)

1. locale setting is probably best to determine the default preferred
fonts, but the user should have a possibility to change it.
2. documents which use the ODF format can have paragraphs or even single
letters marked with a language tag. Those can override the default
system font settings.
3. fontconfig should take care of selecting the proper font for each
script. But it needs some tuning IMHO... see below!

> - Whether fontconfig requires adjustments in order to respect those criteria

YES! IMHO fontconfig needs some big improvement.
Currently fontconfig's decision on which font to use for a specific
glyph is influenced by the following:
 * which charsets the font package has registered in defoma. If the font
has registered itself for ISO8859-1, fontconfig will consider the font
suitable for that codepoint range. Same is true for all other charsets.
 * how many glyphs are covered by the font and in which codepoint
regions (determined by fontconfig)
 * the config files provided by fontconfig contain a default font
preference ordering. This might not suit all users... and usually does not.
 * config files provided by font packages, which can label their own
fonts as preferred ones and override the system wide setting by this.

The following needs to be done:
 * the default config files which specify any font preference should be
removed!
 * fontpackages should not label their own fonts as preferred, but
should rather indicate for which locales and which codepoint ranges the
fonts should be used. (Latin fonts can label the locales as "any" and
Unicode range to the latin ranges they support; see next item.)
 * fontconfig should provide a method to specify for which locales which
fonts are suitable and which codepoint ranges they should be preferred
for. For example: Chinese users might want the AR PL ShanHeiSun Uni font
to be preferred for the CJK ranges, but the Doulos SIL or DejaVu Sans
fonts for Latin glyphs. So, I would configure fontconfig for the zh_*
locales to prefer the SIL fonts for Unicode ranges U+0000 ~ U+001F, etc.
and the AR PL ShanHeiSun Uni font for the range U+2E80 ~ U+9FFF, etc.
(This is really just an example for illustration!) Japanese users might
want to use a different font for CJK... so, they can configure it
differently.
Whether this should be done on font package level, or rather on language
environment level, is hard to say, but I would prefer the language
environment level, with a nice tool for the user to change it if he/she
wants.

> - Whether we still need all these horrible bitmap fonts

As seperate fonts, probably only for X. CJK users however need fonts
with embedded bitmaps.

> - Whether we still need server-side fonts for anything
> 
> - Whether we need DeFoMa

Yes, as legacy X, GTK1 and QT apps depend on it.
Fontconfig also uses the settings to determine the character sets
provided by the fonts.
AFAIK, it is also used to register fonts for ghostscript... however I'm
not an expert on this and it seems to me that it does not always work as
planned.

Cheers
Arne
- --
Arne Götje (高盛華) <arne at linux.org.tw>
PGP/GnuPG key: 1024D/685D1E8C
Fingerprint: 2056 F6B7 DEA8 B478 311F  1C34 6E9F D06E 685D 1E8C
Key available at wwwkeys.pgp.net.   Encrypted e-mail preferred.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGVQZJbp/QbmhdHowRAhSCAJ4iWnGjTbcBfr1Dhf7tkRKafAJOKwCgoZAv
LMQnRyNfh/oXKZOoRISe4zg=
=7v6n
-----END PGP SIGNATURE-----



More information about the Pkg-fonts-devel mailing list