Subject: FVWM: fvwm i18n question

From: Shao Zhang <[email-masked]>
Date: Wed, 03 Jul 2002 15:47:14 +1000

Hi,

I am trying to get fvwm to display chinese characters on the windows
title bar.

I installed the latest alpha version 2.5.2, and changed my .fvwm2rc
config file to have the following line:

Style "*" Font StringEncoding=gb2312-1980-0:"-isas-song ti-medium-r-normal--0-0-72-72-c-0-gb2312.1980-0"

Also tried without the StringEncoding bit.

When I use mozilla to go to a Chinese website, only chars like "?????
??? ???" are shown on the title bar.

Thanks for any help in advance.

Regards,

Shao.
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Marcus Lundblad <[email-masked]>
Date: Wed, 3 Jul 2002 08:26:16 +0200 (CEST)

> ??? ???" are shown on the title bar.

Do you set environment variables in your .xsession (or .xinitrc depending
on your OS distrubution)?
LANG should be set to something like: zh_CN (or something like that...)

Or if you use gdm (GNOME's version of xdm), you should have a menu to
choose the session language.

I think it looks like this could be the problem.
Also, do you get any error messages from fvwm?

//Marcus

---

From: Mikhael Goikhman <[email-masked]>
Date: Wed, 3 Jul 2002 10:49:46 +0000

> LANG should be set to something like: zh_CN (or something like that...)

No, setting LANG to anything specific is not required in 2.5.2.
I don't set LANG at all and can see Chinese in window titles.

Regards,
Mikhael.

---

From: Mikhael Goikhman <[email-masked]>
Date: Wed, 3 Jul 2002 11:14:43 +0000

> Style "*" Font StringEncoding=gb2312-1980-0:"-isas-song ti-medium-r-normal--0-0-72-72-c-0-gb2312.1980-0"

It should be "StringEncoding=gb2312.1980-0". A dot, not a dash.
It is critical to specify it correctly.

> Also tried without the StringEncoding bit.

Yes, please don't specify StringEncoding, in this case gb2312.1980-0 is
assumed automatically from a font charset.

> ??? ???" are shown on the title bar.

I don't have this font, but I have another similar one, so I do:

  Style * Font '-isas-song ti-medium-r-normal--16-160-72-72-c-160-gb2312.1980-0'

Then I open mozilla or opera on some Chinese page, say:

  http://www.randburg.com/is/nas_ch.html

choose GB2312 (Simplified) from a View / Encoding menu and see Chinese.
Note, for window title to be refreshed after changing Encoding from both
browser menus, you may need to switch to another tab and return back.

Regards,
Mikhael.

---

From: Shao Zhang <[email-masked]>
Date: Thu, 04 Jul 2002 10:37:17 +1000

> It is critical to specify it correctly.

Sorry, it was a typo. I had it right in the config file.

> browser menus, you may need to switch to another tab and return back.

I also got the same font, so I tried what you described above, but still
no luck. Here is a screen shot:

http://www.cia.com.au/shao/fvwm-i18n.jpg

Regards,

Shao.

---

From: Olivier Chapuis <[email-masked]>
Date: Thu, 4 Jul 2002 07:13:05 +0200

> Sorry, it was a typo. I had it right in the config file.

So,  we need more info. Can you send the output of "echo $LC_CTYPE"
and of "locale". Seems you run FreeBSD, this is maybe the reason of
the problem. I think that BSD libc do not has iconv. Do you have
(gnu) libiconv installed on your machine? (if not install it and
recompile fvwm, maybe configure should require an iconv). What
is the version of XFree?

Regards, Olivier

---

From: Shao Zhang <[email-masked]>
Date: Thu, 04 Jul 2002 16:57:51 +1000

Hi,

On [Thu, 4 Jul 2002 07:19:20 +0200], Olivier Chapuis <[email-masked]> wrote:
> and of "locale". 

I don't have LC_CTYPE, LC_ALL and LANG defined at all. I did not see any
reference of them in the fvwm manpage. Strangely, FreeBSD does not have
zh_CN.GB2312 locale installed. But I did try with a Big5 font with the
following:

export LC_CTYPE=zh_TW.Big5 LC_ALL=zh_TW.Big5 LANG=zh_TW.Big5

with still the same result.

> Seems you run FreeBSD, this is maybe the reason of

I thought libiconv is always required in 2.5.2.

Here are the info:

fvwm-2.5.2          Popular virtual window manager for X
XFree86-Server-4.2.0_3 XFree86-4 X server and related programs
XFree86-clients-4.2.0_2 XFree86-4 Client environments
XFree86-font100dpi-4.2.0 XFree86-4 bitmap 100 dpi fonts
XFree86-font75dpi-4.2.0 XFree86-4 bitmap 75 dpi fonts
XFree86-fontCyrillic-4.2.0 XFree86-4 Cyrillic Fonts
XFree86-fontDefaultBitmaps-4.2.0 XFree86-4 default bitmap fonts
XFree86-fontEncodings-4.2.0 XFree86-4 font encoding files
XFree86-fontScalable-4.2.0 XFree86-4 Scalable font files
XFree86-libraries-4.2.0_1 XFree86-4 include/(shared) library kit
iconv-2.0_1         Charset conversion library and utilities
libiconv-1.8        A character set conversion library

The browser I am running is the linux native mozilla and opera. Will
this make a difference at all?

Regards,

Shao.

---

From: Mikhael Goikhman <[email-masked]>
Date: Thu, 4 Jul 2002 12:32:39 +0000

> http://www.cia.com.au/shao/fvwm-i18n.jpg

Just to show you what I see (Chinese everywhere), here is my screenshot:

  http://fvwm-themes.sf.net/tmp/fvwm-chinese.png

I would like to understand these nifty hieroglyphs.

Regards,
Mikhael.

---

From: Olivier Chapuis <[email-masked]>
Date: Thu, 4 Jul 2002 16:16:49 +0200

> export LC_CTYPE=zh_TW.Big5 LC_ALL=zh_TW.Big5 LANG=zh_TW.Big5

In this case, you should use a Big5 font, e.g.:

Style "foo" Font -*-fixed-medium-r-normal--16-*

should load a big5-0 font if you have any which match the previous
pattern.
Note that, as it is say in the fvwm man page, fvwm will display CJK
in the good way only if you use the appropriate locale (or you can
use appropriate (xft) iso10646-1 font + StringEncoding). If not and
you enforce a multibyte font by specifying its charset the rendering
can only be approximative (but not as bad as you get). In fact,
for GB2312 things should work not so bad at all, but unfortunately
not for you and I do not see the reason ...

Maybe you can try to use an iso10646-1 font:

Style "foo" "StringEncoding=GB2312.1980-0:an_iso10646-1_font_with_simplified_chinese_char

e.g., -gnu-unifont-medium-r-normal--16-160-75-75-c-80-iso10646-1 may have
simplified chinese glyph.
You may also try some ttf fonts (you should find/install a ttf font with
chinese glyph and add the path to XftConfig; I may help).

Anyway I would like to find the problems ... 

> I thought libiconv is always required in 2.5.2.

I think that fvwm-2.5.2 compiles and works without any iconv
(I never test this).

Regards, Olivier

---

From: Shao Zhang <[email-masked]>
Date: Fri, 05 Jul 2002 12:04:40 +1000

Hi,

> I think that fvwm-2.5.2 compiles and works without any iconv

This is indeed my problem. I had --with-iconv-include instead of
--with-iconv-includes, and that made a huge difference.

GB fonts works fine now, but not big5 fonts. Fvwm crashes when I try to
specify any Big5 font. Anyone else getting this?

Regards,

Shao.

---

From: Olivier Chapuis <[email-masked]>
Date: Fri, 5 Jul 2002 08:48:41 +0200

On Fri, Jul 05, 2002 at 12:04:40PM +1000, Shao Zhang wrote:
> GB fonts works fine now,

fine. We should be more clear about iconv detection.

> but not big5 fonts. Fvwm crashes when I try to

This is fixed now (in the current cvs).

But, again the good way to display CJK is either:

- Use the appropriate locale and load font without specifying
the charset or with a charset which matches "the" locale charset.
- Or use iso10646-1 font (core or ttf) with the good set of
char and use StringEncoding=good_encoding when you a load font.

For example with Big5 (with a non "Big5 locale"), all ascii
characters will be replaced by a space (of course when fvwm
does not crash).

Regards, Olivier