Thai fonts

For example, there is a font name "phaisarn.psf". Put it in
/usr/lib/kbd/consolefonts/ directory. Then, you can load the new
font from Linux console by command

%setfont phaisarn.psf

Keyboard layout

You can set keyboard behavior as you like by using loadkeys
command. Usually, you use loadkeys to load the file located in
/usr/lib/kbd/keytables. You can create a US/Thai keyboard-map file and save it
in this directory. Here is a sample.

Thai fonts

You can obtain Thai fonts in bdf format or
pcf format from internet. You can also use scalable fonts such as Type1 or
TrueType fonts. But I will not describe about these.

Installing Thai fonts

You must log in as root. Let's put Thai fonts in
/usr/X11R6/lib/X11/fonts/misc/, this is a default font path. Change directory to
/usr/X11R6/lib/X11/fonts/misc/ and run command

%mkfontdir
%xset fp rehash

If you put Thai fonts in different directory, you must use xset to add
the new font path. Please see man-page for further information.
You can check the new fonts by running command xlsfonts and see whether
there are Thai fonts or not. If you can not see any Thai fonts from this
command, you may need to restart X window.

Thai keyboard layoutThere are two ways to map Thai keyboard on X window, using X KeyboardExtension (XKB) and using xmodmap. Please select how you map Thai keyboard. Irecommend using XKB.

XKB and Thai keyboard layout.

Beginning with XFree86 3.1.2D, you can use the new X11R6.1 XKEYBOARD
extension to manage the keyboard layout. This is
very helpful.

During X server configuration with xf86config you will be asked
about XKB, if you want to to set Thai keyboard layout for your system,
say yes. There are a list of pre-configured keymaps. Choose Standard
101-key, Thai encoding.

XF86Setup is the graphical X server configuration utility for XFree86 X server.
It is easier than traditional xf86config. You can
select a keyboard layout easily with this tool.

Ther are many choices of keyboard switch key to select. The default is
LeftAlt+RightShift switch to Thai and LeftAlt+LeftShift switch to US. You can
type Thai characters in any applications which support ISO-8859-1 character
set, but don't forget to use Thai fonts with those applications too.

I found that pre-configured keymaps that came with XFree86-3.2
is not correct. You may not be able to type
THO THUNG which located at " 5 key " . To fix this problem, you should
add the line

There are also XKB extension utilities such as setxkbmap,
xkbcomp, etc. Please see man-page for more information. I recommend to
use xkbvled. The leds will be on when you are using Thai keyboard so you
can know your keyboard's status.

The following is part of XF86Config file
about keyboard section. If you want to configure the keyboard by hand, change
the content of /usr/X11R6/lib/X11/XF86Config as an example
below. This configuration uses the default toggle key.

If you use XKB extension, Thai keyboard mapping with xmodmap may not work.
See XF86Config man-page for mor information.

Thai keyboard layout with xmodmap

You can use the utility xmodmap to map Thai keyboard.
Normally xmodmap is used to load a keyboard configured file.
For most Linux distributions,
when you start X window with startx, X server will find .Xmodmap in
/usr/X11R6/lib/X11/xinit/ first. If .Xmodmap does not exist, X
server will find .Xmodmap in your home directory. Please see the content of
/usr/X11R6/lib/X11/xinit/xinitrc.

The following is the sample of .Xmodmap for Thai Kedmanee
keyboard layout.

XF86ModeLock is the special keysym for XFree86 X server. If you
don't add this keysym, you have to hold the scroll lock key while you
are typing Thai characters. Note that if you use commercial X server, some
keycodes are different. You may have to map keyboard by yourself.
See man-pages of X and xev for further information.

Note: If you are using XFree86 version 3.1.2D or later, you need to
add the line XkbDisable in keyboard section of
XF86Config file. You may config the keyboard section
like the following sample.