Bugzilla – Bug 128930
Patch to fontconfig to support localized font family and style names.
Last modified: 2006-01-27 11:29:09 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.
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.
If you think this patch is ok, I'll submit it to upstream.
I found that firefox 1.5 beta2 can support localized font names very well.
Zhe> I found that firefox 1.5 beta2 can support localized font names very well. With your patch or without your patch?
Patch looks fine to me. Can you please submit it upstream?
fontconfig-2.3.91.20051019 (CVS snapshot of fontconfig 2.4 branch) with your patch added submitted to STABLE.
Packages for SuSE Linux 10.0 including your patch are available in ftp://ftp.suse.com/pub/projects/m17n/10.0
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?
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.
Reported to the fontconfig mailing list <fontconfig@lists.freedesktop.org>. Closing as FIXED.
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.
And what about documents which specify font names?
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.
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.
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.
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
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.
*** Bug 71746 has been marked as a duplicate of this bug. ***