Bug 175599 - Emacs cannot display all Chinese glyphs even if there are proper fonts
Emacs cannot display all Chinese glyphs even if there are proper fonts
Product: Fedora
Classification: Fedora
Component: emacs (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Chip Coldwell
Depends On:
  Show dependency treegraph
Reported: 2005-12-13 03:27 EST by Yijun Yuan
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version: 22.0.95-1.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-04-07 03:35:35 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
a text file contains 6 chinese characters. (19 bytes, text/plain)
2005-12-13 03:29 EST, Yijun Yuan
no flags Details

  None (edit)
Description Yijun Yuan 2005-12-13 03:27:56 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.8) Gecko/20051111 Firefox/1.5

Description of problem:
Currently there are two sets of free Chinese bitmap fonts usable. One is by firefly from zh_TW. It is embeded in "AR PL ShanheiSun Uni" (uming), which is contained in fonts-chinese-3.0x package of fedora core, and every major distributions use it. Another is WenQuanYi Bitmap Song (wqy), which is GPL but still not in fedora core or extras (I believe that it will soon find its way to fedora). All of them are relatively complete and of high quality.

But neither could be used in emacs. Not all characters can be displayed in emacs. for example, "我问你为什么" is a sentence made up of 6 characters. If either uming or wqy is installed, the 1st and 5th characters will be displayed properly. Others are blanks. If xorg-x11-fonts-misc is installed, the 2nd, 4th, 6th characters will show up in a different font which I believe is "gb16st" from xorg. But the 3rd one will never be displayed, unless you install "fonts-japanese". Of course, it would be rendered using a third font-family (funny up!). I cannot understand why.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. open the attached file in emacs

Actual Results:  depends on what fonts is installed on your system, it would display 2, 5 or 6 glyphs, they may be in 2 different scripts and 2 different sizes which makes it unable to read.

Expected Results:  display all 6 characters in the same font-family and font-size because they belong to the same script.

Additional info:

I found bug 145931 and bug 174614 but not sure whether they are related. If there is only three bitmap fonts in system: fixed, cursor and one chinese font (wqy), and specify emacs to use wqy in $HOME/.Xdefaults, then emacs cannot display any chinese characters at all -- it only displays blanks instead. It is using wqy for English characters, and since current locale is always zh_CN.UTF-8, I believe the right coding system is already loaded at startup. I can see several extra warnings in the terminal speaking that "Cannot find any ISO8859 fonts", of course there are other warnings like "Warning: cannot convert -*-helvetica-*** and -*-courier-*** to FontStruct". Is there any relation between these things? 

I still think that 1. make emacs depends on either 100dpi or 75dpi fonts is a bad idea 2. wqy fonts should be in core while gb16st, gb24fs, etc. should be take out of xorg misc font package because we have better alternatives now.
Comment 1 Yijun Yuan 2005-12-13 03:29:40 EST
Created attachment 122169 [details]
a text file contains 6 chinese characters.
Comment 2 Yijun Yuan 2005-12-29 22:18:17 EST
problem solved.

Thanks to hellwolf@seu, his init script helps a lot. please follow the URL
link[1] to find his explanation.

the scripts including wqy-bitmapfont rpm spec and .el can be found in fedora-gro

[1] http://www.linuxsir.org/bbs/showthread.php?t=234273
[2] http://gro.clinux.org/scm/cvsweb.php/rpms/w/wqy-bitmapfont/?cvsroot=fedora
Comment 3 Jens Petersen 2006-02-02 23:23:04 EST
It would nice to have the WenQuanYi Bitmap Song font in Fedora Extras.

I don't really understand the solution you referred to: would you be able to
summarize it here.

By the way have you tried mule-gbk <http://mule-gbk.sourceforge.net/> ?
Comment 4 Yijun Yuan 2006-02-08 04:22:24 EST
The .el file is here:

this snippet is an expanded version:
  chinese-gb2312:-*-firefly new sung-medium-r-normal-*-13-*-*-*-*-*-iso10646-1,
  chinese-big5-1:-*-firefly new sung-medium-r-normal-*-13-*-*-*-*-*-iso10646-1,
  chinese-big5-2:-*-firefly new sung-medium-r-normal-*-13-*-*-*-*-*-iso10646-1,
  chinese-sisheng:-*-firefly new sung-medium-r-normal-*-13-*-*-*-*-*-iso10646-1,
 chinese-cns11643-3:-*-firefly new sung-medium-r-normal-*-13-*-*-*-*-*-iso10646-1,
  chinese-cns11643-4:-*-firefly new sung-medium-r-normal-*-13-*-*-*-*-*-iso10646-1,
  chinese-cns11643-5:-*-firefly new sung-medium-r-normal-*-13-*-*-*-*-*-iso10646-1,
  chinese-cns11643-6:-*-firefly new sung-medium-r-normal-*-13-*-*-*-*-*-iso10646-1,
  chinese-cns11643-7:-*-firefly new sung-medium-r-normal-*-13-*-*-*-*-*-iso10646-1,
  japanese-jisx0208-1978:-*-firefly new
  japanese-jisx0208:-*-firefly new sung-medium-r-normal-*-13-*-*-*-*-*-iso10646-1,
  japanese-jisx0212:-*-firefly new sung-medium-r-normal-*-13-*-*-*-*-*-iso10646-1,
  japanese-jisx0213-1:-*-firefly new sung-medium-r-normal-*-13-*-*-*-*-*-iso10646-1,
  japanese-jisx0213-2:-*-firefly new sung-medium-r-normal-*-13-*-*-*-*-*-iso10646-1,

(set-default-font "fontset-firefly")

To tell the truth, I cannot fully understand why. Hellwolf@seu told me that
emacs is matching wrong font to chinese script in utf8 environment. In his code
he specifies "firefly new sung" for all chinese and english encodings. In the
.el file I use "wenquanyi" instead of "firefly new sung". I could not explain
more :(
Comment 5 Yijun Yuan 2006-02-08 04:27:15 EST
sorry, but it is "all chinese and japanese encodings".
Comment 6 sangu 2006-02-14 08:49:08 EST
please see bug 175599

this problem isn't emacs bug but xorg 7.0 (libfontenc) bug, maybe.
Comment 7 Matthew Miller 2007-04-06 13:29:27 EDT
Fedora Core 5 and Fedora Core 6 are, as we're sure you've noticed, no longer
test releases. We're cleaning up the bug database and making sure important bug
reports filed against these test releases don't get lost. It would be helpful if
you could test this issue with a released version of Fedora or with the latest
development / test release. Thanks for your help and for your patience.

[This is a bulk message for all open FC5/FC6 test release bugs. I'm adding
myself to the CC list for each bug, so I'll see any comments you make after this
and do my best to make sure every issue gets proper attention.]
Comment 8 Yijun Yuan 2007-04-07 03:35:35 EDT
So happy to find that in fc7t3, with default installed emacs-22.0.95-1.fc7 and
fonts-chinese-3.03-4.fc7, locale is zh_CN.UTF-8, every single chinese character
is displayed very well (though a bit small on large display), even when
fonts-japanese is also installed. 

Please close this bug, thanks!

Note You need to log in before you can comment on or make changes to this bug.