Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] Re: help w/japanese



"Stephen J. Turnbull" <stephen@example.com> writes:

>>>>>> "Jack" == Jack Morgan <yojack@example.com> writes:
>
>     Jack> I'm having trouble getting japanese to display in an
>     Jack> xterm/mlterm.
>
> xterm don't do Japanese.  It will do UTF-8, which may be good enough.

xterm also does EUC-JP together with luit (comes with XFree86 4.2.0).
See 'man luit'. Within an xterm running in e.g. ja_JP.UTF-8 locale
you can do:

    LC_ALL=ja_JP.eucJP luit

you will get a new prompt and it works in EUC-JP then because
luit converts.

> See below.  mlterm I don't know about.

mlterm works in UTF-8, EUC-JP and many other encoding. It's
a really great terminal.

>     Jack> If I try export LANG=ja_JP mutt, I get mojibake menu's.
>
> Have you tried ja_JP.eucJP and/or ja_JP.utf8?

The correct spelling is ja_JP.UTF-8. glibc ignores case and hyphens
and underscores, i.e. as far as glibc is concerned you could also
write ja_JP.uTf-8, but X11 insists on the correct spelling
ja_JP.UTF-8, otherwise XSupportsLocale() will fail and many X11
programs will get into trouble.

> For xterm, you also need a sane set of iso10646 fonts.  I think the
> adobe and b&h fonts are irrelevant.

Yes.

> I'm not sure which of the following do Japanese, probably unifont
> and fixed-*-ja.

Unifont doesn't work well with xterm (It works nicely with mlterm in
UTF-8 though).

> $ xlsfonts | fgrep iso10646
> -gnu-unifont-medium-r-normal--0-0-75-75-c-0-iso10646-1
> -gnu-unifont-medium-r-normal--16-160-75-75-c-80-iso10646-1
> -misc-fixed-bold-r-normal--0-0-100-100-c-0-iso10646-1
> -misc-fixed-bold-r-semicondensed--0-0-75-75-c-0-iso10646-1
> -misc-fixed-medium-o-normal--0-0-75-75-c-0-iso10646-1
> -misc-fixed-medium-o-semicondensed--0-0-75-75-c-0-iso10646-1

> -misc-fixed-medium-r-normal--0-0-100-100-c-0-iso10646-1
> -misc-fixed-medium-r-normal-ja-0-0-100-100-c-0-iso10646-1
> -misc-fixed-medium-r-normal-ko-0-0-100-100-c-0-iso10646-1

These three fonts above will do. If you have :unscaled in
/etc/X11/XF86Config you will see only the following XLFDs for these
fonts:

   -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1
   -misc-fixed-medium-r-normal-ja-18-120-100-100-c-180-iso10646-1
   -misc-fixed-medium-r-normal-ko-18-120-100-100-c-180-iso10646-1

> -misc-fixed-medium-r-semicondensed--0-0-75-75-c-0-iso10646-1
> -mutt-clearlyu alternate glyphs-medium-r-normal--0-0-100-100-p-0-iso10646-1
> -mutt-clearlyu pua-medium-r-normal--0-0-100-100-p-0-iso10646-1
> -mutt-clearlyu-medium-r-normal--0-0-100-100-p-0-iso10646-1

The clearlyu fonts don't contain Japanese glyphs.

If you want to display Japanese in an UTF-8 xterm, you need a pair of
fonts, one for the single width characters (option '-fn') and
one for the double width characters (option '-fw'). For example
the following will work:

    LANG=ja_JP.UTF-8 xterm -fn -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1 -fw -misc-fixed-medium-r-normal-ja-18-120-100-100-c-180-iso10646-1

Actually you don't absolutely need to specify the second font here, if
you specify only one font with the option '-fn', xterm will
automatically try a font for the double width characters which has an
almost identical XLFD and but twice the width field and possibly
something in the adstyl field. In the above example the first font has
the average width 90 and the second one 180, i.e. exactly twice as
much and it has 'ja' in the adstyl field. This means xterm would
choose the second font automatically for the double width characters.

If you prefer Korean style glyphs, you can choose the font with the
'ko' in the adstyl field for the wide characters.

You can also specify the fonts for xterm with X resources.
I have the following in my ~/.Xresources file:

XTerm*font:     -misc-fixed-medium-r-normal-*-18-120-100-100-c-90-iso10646-1
XTerm*wideFont: -misc-fixed-medium-r-normal-*-18-120-100-100-c-180-iso10646-1

XTerm*font1:     -efont-fixed-medium-r-normal-*-12-120-75-75-c-60-iso10646-1
XTerm*wideFont1: -efont-fixed-medium-r-normal-*-12-120-75-75-c-120-iso10646-1
XTerm*font2:     -misc-fixed-medium-r-semicondensed-*-13-120-75-75-c-60-iso10646-1
XTerm*wideFont2: -misc-fixed-medium-r-normal-*-13-120-75-75-c-120-iso10646-1
XTerm*font3:     -efont-fixed-medium-r-normal-*-14-140-75-75-c-70-iso10646-1
XTerm*wideFont3: -efont-fixed-medium-r-normal-*-14-140-75-75-c-140-iso10646-1
XTerm*font4:     -efont-fixed-medium-r-normal-*-16-160-75-75-c-80-iso10646-1
XTerm*wideFont4: -efont-fixed-medium-r-normal-*-16-160-75-75-c-160-iso10646-1
XTerm*font5:     -misc-fixed-medium-r-normal-*-18-120-100-100-c-90-iso10646-1
XTerm*wideFont5: -misc-fixed-medium-r-normal-*-18-120-100-100-c-180-iso10646-1
XTerm*font6:     -efont-fixed-medium-r-normal-*-24-240-75-75-c-120-iso10646-1
XTerm*wideFont6: -efont-fixed-medium-r-normal-*-24-240-75-75-c-240-iso10646-1

With these default settings, just

    LANG=ja_JP.UTF-8 xterm

will already do as the above long command line and you can switch
the font size using Control-Rightmousebutton.

The 18 pixel and 13 pixel misc fonts are already in the standard
XFree86 distribution, the efont fonts are available at

   http://openlab.ring.gr.jp/efont/

or, packaged for SuSE Linux:

    ftp://ftp.suse.com/pub/people/mfabian/7.3-src/efont-unicode-0.4.0-0.src.rpm

-- 
Mike Fabian   <mfabian@example.com>   http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links