Thai fonts won't type with recent X versions

Thai fonts won't type with recent X versions

Post by Chris Carle » Mon, 10 Dec 2001 09:50:41


I have installed Thai TTF fonts (from Thai Win98) onto Suse 7.3 with KDE
2.2.1 and X 4.1.0.

I have tried two different methods of getting the keyboard to switch to
the Thai layout.  Both methods work.  One is to put "th" in the
XF86Config file for Option "XkbLayout" "us".  The other is to leave the
"us" and use the KDE keyboard layout switcher.

The problem is that no matter what method I use to switch to the Thai
layout, the Thai characters don't show.  For example, I fire up kedit,
set the font to one of the Thai fonts, switch keyboard layout to Thai,
and type.  I just get question marks.

Now in the past I had Thai working with X versions 3.3.x.  I have
discovered that the file in the old X version /etc/X11/xkb/symbols/th is
different from the file in X 4.x.  If I put the old file onto the 4.1.0
system, then Thai fonts type OK!

But using the th file that comes with 4.1.0 the Thai characters only
show as question marks.

Using xev indicates that with the old file, latin character names appear
  when typing under the Thai keyboard layout.  But with the new th file,
Thai character names are generated by typing.  It must be that the Thai
font glyphs are mapped to latin character names that would have been
generated by the particular keys, instead of the actual Thai character
names.  Guessing here.  I would love to hear an expert on this subject
explain what is wrong here.  It seems that someone hacked a way to make
it work in the past, then it was done right with X 4.x, but that broke
it.  Doing it wrong produces the right result; doing it right gets the
wrong result.  Figures.

Here are the beginnings of the th files:

The OLD one that works:
// $XConsortium: th /main/3 1996/08/31 12:20:18 kaleb $
// $XFree86: xc/programs/xkbcomp/symbols/th,v 3.2 1997/07/26 12:59:09
dawes Exp $
partial default alphanumeric_keys
xkb_symbols "basic" {
     name[Group2]= "Thai";
     // The thai layout defines a second keyboard group and changes
     // the behavior of a few modifier keys.

     key <TLDE> { [], [  underscore,      percent         ]       };
     key <AE01> { [], [       aring,      plus            ]       };

The NEW one that doesn't work:
// $Xorg: th,v 1.3 2000/08/17 19:54:44 cpqbld Exp $
// $XFree86: xc/programs/xkbcomp/symbols/th,v 3.4 2001/01/17 23:45:59

dawes Exp $

partial default alphanumeric_keys
xkb_symbols "basic" {
     name[Group2]= "Thai";
     // The thai layout defines a second keyboard group and changes
     // the behavior of a few modifier keys.

     // converted to THai keysysms - Pablo Saratxaga

     key <TLDE> { [], [  underscore,      percent         ]       };
     key <AE01> { [], [ Thai_lakkhangyao,  plus           ]       };

If I hadn't kept this old file, I'd be really screwed.

Thanks for comments.

Christopher R. Carlen

Suse 7.3 Linux 2.4.10


1. Thai fonts and Thai keyboard layout under linux/kde2

Well, I don't know a program for it, but KDE itself will give you the
opportunity! Go to your Control Center by clicking at the "Start
Application" button and look for it in the list. Once it opened up, go to
Personalization and choose the Country & Language option. There you will
find Thai Language, the keyboard layout is at the "Keyboard layout" option
(who would have guessed?!)...

Good luck,
The answer is 42!

2. Install RH Linux7.3

3. Solaris 2.5 won't render extra Type-1 fonts

4. Mouse...IGNORE!!!! SORRY!!!!

5. GCC - Won't find types.h for /asm/types.h for ANYTHING

6. Linux on CD-ROM???

7. X won't start: can't open default font 'fixed'

8. Diamond Stealth64 and XF386

9. X won't start "could not find font 'fixed'"

10. what's the most recent version of linux on CD-ROM

11. using thai font

12. true-type font scaling problem with 'Courier New'

13. Staroffice for linux Thai Version