Summary

This sub specification aims at improving Font configuration for CJK support in Ubuntu.

Rationale

Usually Chinese, Japanese and Korean (CJK) users make their own font configurations in ~/.fonts.conf so that they see the best looking, highest quality, ttf fonts. This is necessary due to lack of support by fontconfig; we don't currently have any method to simplify this process for CJK users.

Use cases

Background

We believe we have established the following facts.

Approach

The default choice of the font system must be improved. We would like the user to be able to make the choice of font using the normal font configuration mechanism (System / Preferences / Font and the corresponding Firefox preferences).

This will be achieved by providing language-specific fontconfig XML stanzas in the default install which (i) map sans-serif, the default font, to the "best" relevant CJK font (ii) provide a mapping for suitable name(s) for the plausible alternatives.

These XML stanzas will be provided in /etc/fonts/conf.d by the ttf-* packages. Providing them there means that, since all systems will have them installed, any bugs which make the changes break other languages will be detected; if they were in the language packs then such bugs would strike systems with multiple language support but be otherwise undetected. The other alternative would be to provide this information from the fontconfig package itself but since it's likely to be fairly large, and at least initially fairly volatile, and to some extent coupled to the ttf font packages' contents, this would be less than ideal.

Open Questions

The information here is currently based mainly on the knowledge of a Korean-language expert. The situation for the other affected languages needs to be checked.

There have been reports of trouble to do with ordering of the various fontconfig stanzas. fontconfig is sensitive to ordering and somewhat fragile. Certainly none of the language-specific changes to fontconfig files should involve reordering any existing configuration. We need to establish that writing appropriate XML to /etc/fonts/conf.d is sufficient, and whether there is any specific ordering constraint which affects the appropriate choice of filename. (Files in conf.d are read in lexicographical order, and recent practice is to prepend a sequence number to the filename.)

We currently have no confirmation that language-specific XML works correctly in practice. If it does not then we must either fix it (if this is feasible) or opt for a different approach (which will definitely be suboptimal for multilingual installs).

Exact syntax of the appropriate fontconfig XML stanzas need to be established and tested. We have examples for Korean (see below).

Implemented solution

Notes

These notes predate the discussions and decision documented above but are retained because they contain information that may still be useful.

2. Setting up a .conf file to /etc/fonts/conf.d when a ttf-font package installed, is it preferred way to solve this?

3. The below configration for spacing needs to be a patch of Dapper's fontconfig for CJK langs. The ko_KR fontconfig file contains same configuration already, but better to be used for all CJK.

4.To display semibold as bold for embolden glyphes, the following configuration required. Problem and test results are described in the bug 38595 Applying this configuration to fontconfig with "CJK lang test" is a boon to most of CJK fonts which don't have semibold and bold glyphes.

BetterCJKSupportSpecification/FontConfig (last edited 2008-08-06 16:14:54 by localhost)