[Bug 499902] New: Restructure the fontconfig settings for CJK languages

bugzilla at redhat.com bugzilla at redhat.com
Fri May 8 19:16:27 UTC 2009


Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug.

Summary: Restructure the fontconfig settings for CJK languages

https://bugzilla.redhat.com/show_bug.cgi?id=499902

           Summary: Restructure the fontconfig settings for CJK languages
           Product: Fedora
           Version: rawhide
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: medium
          Priority: low
         Component: fontconfig
        AssignedTo: besfahbo at redhat.com
        ReportedBy: fangqq at gmail.com
         QAContact: extras-qa at fedoraproject.org
                CC: tagoh at redhat.com, petersen at redhat.com,
                    nicolas.mailhot at laposte.net, besfahbo at redhat.com,
                    fedora-fonts-bugs-list at redhat.com
    Classification: Fedora


Created an attachment (id=343146)
 --> (https://bugzilla.redhat.com/attachment.cgi?id=343146)
language specific fontconfig settings for Japanese

The CJK language fontconfig settings has been a long-standing issue ever since
the beginning of using fontconfig. There hasn't been a good solution yet. The
major difficulties for causing this problem, IMO, include

1. the default 65-nonlatin.conf was badly outdated with unoptimized font orders
2. there are no CJK language-specific fontconfig files, therefore, to override
the default orders, one has to add font prefer list in the fontconfig settings
shipped with individual CJK font package.
3. because these settings were scattered into many font packages, this further
makes the problem complex, and the conflict between different CJK font packages
became more and more frequent.

To solve this issue, I propose the following solution
1. update 65-nonlatin.conf and setup an optimized and up-to-date font list
2. add language specific fontconfig settings, defining font preferred orders
with for a given lang tag, and assign these files a lower number than 65
3. remove all font order settings from all CJK related font packages

For solution step 1, I proposed a completely updated 65-nonlatin.conf at
http://bugs.freedesktop.org/show_bug.cgi?id=20911 . My rationale of the font
orders was also explained in details.

For solution step 2, I created two default settings for ja and zh locales (that
for ko can be done similarly) as examples, and you can find them in the
attachments. Because I used lang tag matching in the rules, these files can be
installed concurrently (in this sense, it is better than the language-selector
in Ubuntu, which needs to run fontconfig-voodoo to link a set of active config
under a given language).

I did the following to test this proposal. From what I saw for zh-*, ja and en
locales, all the wanted features were working properly.

Here are the details of my test:

First, I did this test with rawhide updated this morning. On the system, I
installed chinese-support and japanese-support, including wqy-bitmap-fonts,
wqy-zenhei-fonts, arphic-uming, vlgothic-fonts and some mincho Japanese font. 

To clean up all the font config settings, I "su" to root, and run the following
  cd /etc/fonts/conf.d/
  mkdir cjk
  mv *wqy* cjk
  mv *vlgo* cjk
  mv *arphic* cjk
  mv *gothic* cjk

This is just a quick way to get rid of all the font-wise preference settings.
In the future, most of these files can stay, as long as they remove the blocks
to set <prefer> or prepend family names.

The second step is to update (of course, make a backup first) the
65-nonlatin.conf by downloading from the attachment at
http://bugs.freedesktop.org/show_bug.cgi?id=20911

Then, download the 55-language_fonts_ja-jp.conf and
55-language_fonts_zh-cn.conf from this thread and save them under
/etc/fonts/conf.d/ . This completes the settings.

For Chinese users, some of them prefer bitmap glyphs for Han characters (35%),
some prefer vectors (65%). This is controlled by installing wqy-bitmap-fonts or
uninstalling the bitmap fonts.

I tested my proposed settings for English, Japanese and Chinese languages, with
bitmap preferred settings and vector preferred settings. My screenshots for all
combination can be found at this online album:
http://picasaweb.google.com/fangqq/ProposalForFontconfigSettingsForCJKLanguages

When bitmap font is installed, for en and zh desktops, fonts at sizes 9pt ~
12pt will be rendered as bitmaps for all font aliases (sans,serif, mono);
otherwise, it will be rendered by the respective vector fonts. Particularly,
for en desktop, no more font-mosaic problems caused by high priority of
Japanese fonts (such as
http://picasaweb.google.com/fangqq/ConfigScreenshot#5333302146968242258) . When
one remove the bitmap fonts, all Hanzi glyphs were rendered by the preferred
vector fonts, as expected (some remaining ones are from UMing, which I did not
disable).

For ja desktop, all fonts were rendered by their preferred vector fonts, no
matter bitmap Chinese fonts installed or not (please ignore "驿" and "阵" as they
are not defined in JIS).



I believe this approach greatly simplifies the CJK font settings by
centralizing the related settings to language specific files. All the expected
basic rendering order were achieved with the current proposed config files. Of
course one can fine-tune them further. For Korean users, a
55-language-fonts-ko.conf file can be made similarly.

It will be really great if this proposal can be tested and agreed by all CJK
font package maintainers.

-- 
Configure bugmail: https://bugzilla.redhat.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.




More information about the Fedora-fonts-bugs-list mailing list