Bug 128930

Summary: Patch to fontconfig to support localized font family and style names.
Product: [openSUSE] SUSE Linux 10.1 Reporter: Zhe Su <zsu>
Component: BasesystemAssignee: Mike Fabian <mfabian>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Enhancement    
Priority: P5 - None    
Version: Alpha 1   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: The patch against fontconfig 2.3.91
A new patch to support the behaviour described in comment #8.

Description Zhe Su 2005-10-18 06:53:04 UTC
With the attached patch, fontconfig 2.3.91 could re-order the name list of font
family and style according to current locale setting, so that applications,
which use fontconfig to manage fonts, could get localized font family and style
name list.
Comment 1 Zhe Su 2005-10-18 07:01:10 UTC
Created attachment 54468 [details]
The patch against fontconfig 2.3.91

With this patch, the patch for bug #128354 is not necessary anymore.
However, it seems that mozilla based applications (mozilla, firefox, thunderbird etc.) don't support utf-8 encoded font name.
I'll try to fix them.
Comment 2 Zhe Su 2005-10-18 07:05:06 UTC
If you think this patch is ok, I'll submit it to upstream.
Comment 3 Zhe Su 2005-10-18 11:20:21 UTC
I found that firefox 1.5 beta2 can support localized font names very well.
Comment 4 Mike Fabian 2005-10-19 13:13:21 UTC
Zhe> I found that firefox 1.5 beta2 can support localized font names very well.

With your patch or without your patch?
Comment 5 Mike Fabian 2005-10-19 13:19:11 UTC
Patch looks fine to me. Can you please submit it upstream?

Comment 6 Mike Fabian 2005-10-19 13:27:25 UTC
fontconfig-2.3.91.20051019 (CVS snapshot of fontconfig 2.4 branch)
with your patch added submitted to STABLE.
Comment 7 Mike Fabian 2005-10-19 13:40:11 UTC
Packages for SuSE Linux 10.0 including your patch are available in

    ftp://ftp.suse.com/pub/projects/m17n/10.0
Comment 8 Mike Fabian 2005-10-19 13:46:30 UTC
Without the patch:

mfabian@magellan:/var/tmp/abuild/x86_64$ LANG=zh_CN.UTF-8 fc-list : | grep -i FZ
FZHeiTi,方正黑体:style=Regular
FZFangSong,方正仿宋:style=Regular
FZKaiTi,方正楷体:style=Regular
FZSongTi,方正宋体:style=Regular
FZKaiTiB,方正楷體:style=Regular
FZMingTiB,方正明體:style=Regular
mfabian@magellan:~$

With the patch:

mfabian@magellan:~$ LANG=zh_CN.UTF-8 fc-list : | grep -i FZ
方正黑体,FZHeiTi:style=Regular
方正仿宋,FZFangSong:style=Regular
方正楷体,FZKaiTi:style=Regular
方正宋体,FZSongTi:style=Regular
FZKaiTiB,方正楷體:style=Regular
FZMingTiB,方正明體:style=Regular
mfabian@magellan:~$

I.e. when the locale is simplified Chinese, the traditional Chinese
font names will still be displayed in the ASCII versions.

That's funny, but probably OK, isn't it?



Comment 9 Mike Fabian 2005-10-19 13:50:35 UTC
With the patch applied, font names will usually be saved localized in
config files and documents. For example:

mfabian@magellan:~$ grep  font= .qt/qtrc
font=方正宋体,10,-1,5,50,0,0,0,0,0
mfabian@magellan:~$

Do you think this could cause problems?

What happens if a document is transferred to a system which does not
support localized font names? Probably default fallback fonts will be
used then even if the correct fonts are installed.

Comment 10 Mike Fabian 2005-10-19 14:12:59 UTC
Reported to the fontconfig mailing list <fontconfig@lists.freedesktop.org>.

Closing as FIXED.
Comment 11 Zhe Su 2005-10-19 14:25:05 UTC
I think the localized fontname in config file should be ok. fontconfig 2.3.x support  it. And using newer config file in old system makes no sense.
Comment 12 Mike Fabian 2005-10-19 14:35:21 UTC
And what about documents which specify font names?
Comment 13 Zhe Su 2005-10-19 14:48:06 UTC
Hmm, it maybe an issue. However documents generated by microsoft office always use localized font names. I think in such case, the default font should be used if the target system doesn't support localized font name.
Comment 14 Zhe Su 2005-10-19 14:55:13 UTC
Created attachment 54788 [details]
A new patch to support the behaviour described in comment #8.

I think such behaviour should also be ok. So please use the new patch if you think so.
Comment 15 Mike Fabian 2005-10-19 15:03:06 UTC
Zhe Su> I think in such case, the default font should be used if the target
Zhe Su> system doesn't support localized font name.

Yes, I agree. I just wanted to mention that there might be a problem.

Comment 16 Mike Fabian 2005-10-20 10:35:20 UTC
I submitted fontconfig with your new patch from comment #14 to STABLE.

packages for 10.0 will be available soon in

    ftp://ftp.suse.com/pub/projects/m17n/10.0
Comment 17 Mike Fabian 2005-10-24 12:38:54 UTC
I updated fontconfig to 2.3.91.20051024 (CVS snapshot of fontconfig 2.4
branch of today) and submitted it to STABLE.

Patrick Lam  <plam@mit.edu> has accepted your patch and it is included
in this version already.

Please check whether everything is OK.

packages for 10.0 will be available in

    ftp://ftp.suse.com/pub/projects/m17n/10.0

in a few hours.
Comment 18 Tor Lillqvist 2006-01-27 11:29:09 UTC
*** Bug 71746 has been marked as a duplicate of this bug. ***