Bug 589974

Summary: cjkuni-uming-fonts .conf file breaks font lookup by lang
Product: [Fedora] Fedora Reporter: Caolan McNamara <caolanm>
Component: cjkuni-fontsAssignee: Caius Chance <K9>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 13CC: behdad, fonts-bugs, i18n-bugs, K9, petersen, phuang, pwu, tagoh
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: cjkuni-fonts-0.2.20080216.1-42.fc13 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-05-27 18:37:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Caolan McNamara 2010-05-07 12:44:53 UTC
Description of problem:
Once cjkuni-uming-fonts is installed fc-match :lang=zh-cn stops working. i.e. when querying for a font by zh-* language you get fonts that don't support those languages.

Version-Release number of selected component (if applicable):
cjkuni-uming-fonts-0.2.20080216.1-37.fc13.noarch

How reproducible:
100%

Steps to Reproduce:

1. start without any cjkuni-*-fonts installed
2. install some other zh supporting fonts, e.g. yum install wqy-zenhei-fonts
3. LANG=C fc-match ":lang=zh-cn"
wqy-zenhei.ttc: "WenQuanYi Zen Hei" "Regular"
4. yum -y install cjkuni-uming-fonts
3. LANG=C fc-match ":lang=zh-cn"
DejaVuSans.ttf: "DejaVu Sans" "Book"
and that font does not support zh-cn
5. mv /etc/fonts/conf.d/64-ttf-arphic-uming.conf /tmp
6. LANG=C fc-match ":lang=zh-cn"
wqy-zenhei.ttc: "WenQuanYi Zen Hei" "Regular"

i.e. /etc/fonts/conf.d/64-ttf-arphic-uming.conf causes this, looking closer at it I see..

<test name="lang" compare="contains">
  <string>zh</string>
</test>
<edit name="family" mode="prepend" binding="strong">
  <string>Bitstream Vera Sans</string>
  <string>DejaVu Sans</string>
  <string>AR PL UMing HK</string>
  <string>AR PL UMing CN</string>
</edit>

This looks bogus to me. prepend Bitstream and DejaVu to the list (if I'm reading this right) when the language is zh* ? Surely it should at least be...

<edit name="family" mode="prepend" binding="strong">
  <string>AR PL UMing HK</string>
  <string>AR PL UMing CN</string>
</edit>

Doing that I get...

LANG=C fc-match ":lang=zh-cn"
uming.ttc: "AR PL UMing HK" "Light"

which makes a lot more sense.

Perhaps the .conf should also do more precise matching to suggest the HK variant for traditional zh language tags and the CN one for simplified zh language tags

Comment 1 Caolan McNamara 2010-05-07 12:47:41 UTC
caolanm->behdad: Am I right here ?

Comment 2 Jens Petersen 2010-05-21 04:04:48 UTC
This doesn't look so good: I think we need to investigate.

Comment 3 Akira TAGOH 2010-05-21 05:15:53 UTC
I should already pointed out that on the bug and the list Peng Wu posted about reorganizing Chinese fonts thing. actually those bogus rules are being dropped in the proposed configuration files - http://pwu.fedorapeople.org/fonts-conf/65-0-ttf-arphic-uming.conf

Peng Wu, that would be good time to push those updates.

FYI.

Comment 4 Peng Wu 2010-05-24 05:59:51 UTC
Hi Akira TAGOH,
  I will push the updates for UMing/UKai and WQY soon. Thanks for the review.
  The next comment will describes the changes to UMing/UKai.

Comment 5 Peng Wu 2010-05-24 06:14:37 UTC
In Simplified Chinese (SC for short) and Traditional Chinese (TC for short), many characters has different writing styles, so it has better use different fonts for SC and TC.
In order to provides better fonts for SC and TC users, UMing will be the default font for TC, and ZenHei will be the default font for SC.

The purpose of this change is:
  1. When use Simplified Chinese locale to login Fedora gdm, all default desktop fonts will use WenQuanYi;
  2. When use Traditional Chinese locale to login Fedora gdm, all default desktop fonts will use UMing.

For cjkuni-fonts-uming:

The needed changes for cjkuni-fonts-uming is:
1. Please remove the following fontconfig files from cjkuni-fonts-uming: 35-ttf-arphic-uming-aliases.conf 41-ttf-arphic-uming.conf 64-ttf-arphic-uming.conf.
2. And add the 65-0-ttf-arphic-uming.conf to UMing fontconfig file.

For cjkuni-fonts-ukai:

The needed changes for cjkuni-fonts-ukai is:
1. Please remove the following fontconfig files from cjkuni-fonts-ukai:
35-ttf-arphic-ukai-aliases.conf 41-ttf-arphic-ukai.conf 75-ttf-arphic-ukai-select.conf.

I think most files removed is kept for legacy reason, if there are no explicit reason to keep them, will clean up these fontconfig files.

For more details and reasons, please see also README.en on http://pwu.fedorapeople.org/fonts-conf.

Comment 6 Fedora Update System 2010-05-27 07:27:10 UTC
cjkuni-fonts-0.2.20080216.1-42.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/cjkuni-fonts-0.2.20080216.1-42.fc13

Comment 7 Fedora Update System 2010-05-27 18:36:48 UTC
cjkuni-fonts-0.2.20080216.1-42.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.