Re: xterm failing to display some chars in zh_*.utf-8

Mike FABIAN <[email protected]>
Newsgroups gmane.linux.suse.m17n
Organization SUSE LINUX Products GmbH - Nürnberg - AG Nürnberg - HRB 16746 - GF: Markus Rex
Message-ID <[email protected]>
PILCH Hartmut <[email protected]> さんは書きました:

>> > I should add that I'm working in the zh_CN.utf-8 locale, with almost all
>> > locale variables set to this, based on selection at the beginning of the
>> > installation process, done with YaST2 in this locale this week.
>> >
>> > I notice also that the display of characters in zh_CN.utf-8 is
>> > incomplete.
>> 
>> Where? In xterm?
>
> Yes.
>
> In mlterm everything works fine.
>
>> What font are you using?
>
> I have installed most of the SuSE 10.3 font packages as they came.  I guess
> the fonts listed in
>
>     /usr/share/X11/app-defaults/XTerm
>
> are being used.

Yes.

> How can I check which font XTerm is using for a given character?

xterm is never using more than two fonts at once, one for single width
and one for double-width (This is the same with mlterm by the way).

In /usr/share/X11/app-defaults/XTerm you see:

*fontMenu*fontdefault*Label:	Default
*VT100.font:		-misc-fixed-medium-r-semicondensed-*-13-120-75-75-c-60-iso10646-1
*VT100.wideFont:	-misc-fixed-medium-r-normal-*-13-120-75-75-c-120-iso10646-1

I.e. by default these two fonts are used, the one with the VT100.font
resource for the single width characters, the one with the
VT100.wideFont resource for the double-width characters.

The -misc-fixed-medium-r-normal-*-13-120-75-75-c-120-iso10646-1 font
used for the double-width characters has enough characters for Japanese 
but unfortunately not for Chinese.

Because of this, I tried to change the default to a different font years
ago, but so many people insisted on keeping exactly this font as the
default that I could not do it.

I would have liked to change the other 6 fonts which can be selected
with Control+RightMouse to fonts which cover Unicode well and have
matching double width fonts which cover Japanese and Chinese.  But this
was not possible either because again some people strongly insisted on
keeping exactly the same fonts as always.

As the people who insist on keeping the time honoured default fonts for
xterm usually care only about single width fonts, it would be possible
to make CJK work well by default if xterm would not require that the
double-width font must be *exactly* twice as wide and *exactly* as high
as the single with font but could adapt to small differences by padding
a few pixels. mlterm, urxvt, gnome-terminal, konsole, ... can do this.
See

    http://bugzilla.novell.com/show_bug.cgi?id=49305

Then one could keep the well known default fonts for single width
and configure double width fonts which are close to the optimal size
and have good coverage.

But as the single width fonts and the double with fonts currently need
to fit *exactly* in xterm, one needs to configure exactly matching pairs
of fonts and there are not many of these. With the additional
requirement that the single width fonts must stay the same as always,
there is not much which can be done except from adding Chinese
characters to double width font which match the "classic" xterm single
width fonts exactly.

The only small concession in the xterm default setup I could achieve was
to replace the "unreadable" font which, as the name says, was just some
tiny dots too small to read by fonts with good coverage. This is the
font pair now called "Unicode Best" in the Control+RightMouse menu:

*fontMenu*font1*Label:	Unicode Best
*VT100.font1:		-misc-fixed-medium-r-normal-*-18-120-100-100-c-90-iso10646-1
*VT100.wideFont1:	-misc-fixed-medium-r-normal-*-18-120-100-100-c-180-iso10646-1

(But there were even users who objected against this change!)

I could change the file /usr/share/X11/app-defaults/UXTerm to use fonts
with good Unicode coverage without any complaints though.  Therefore,
you get default fonts with much better Unicode coverage when you start
xterm like this:

    xterm -class UXTerm

(or use the script /usr/bin/uxterm which does use the "-class UXTerm"
option.)

> Some members of the corresponding charset (the unicode subset that corresponds
> to gb2312) are represented by boxes.   I find it difficult to imagine that
> 10.3 could have been published for China with such flaws and in fact haven't
> found any Chinese reports about such flaws with Google so far.

I think the reason why nobody complains is that most people use the
"default" terminals of the Gnome or KDE desktop environments,
i.e. gnome-terminal or konsole. Both gnome-terminal and konsole handle
CJK reasonably well. 

Only old UNIX hackers use xterm. And these usually know how to setup
their fonts if they don’t suit their purpose.

Another very good terminal for which is unfortunately not so well known
is rxvt-unicode aka urxvt. Contrary to xterm and mlterm, urxvt can use
not only two fonts at the same time but any number you like. For
example:

   urxvt -fn "xft:DejaVu Sans Mono:pixelsize=16,xft:IPAGothic,xft:FZSongTi,xft:Khmer OS System,xft:Code2000" 

This command line uses the first font on the list, i.e. “DejaVu Sans
Mono” for all glyphs it supports, then falls back to the next one,
“IPAGothic”. If “IPAGothic” still lacks a glyph “FZSongTi” is used and
so on ...

If you are interested more in Chinese than Japanese, move your favorite
Chinese fonts before any Japanese font in the urxvt font list.

For further details of the urxvt font setup please see the man-page
(“man urxvt”).

-- 
Mike FABIAN   <[email protected]>   http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。
I � Unicode
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.