📚 LinuxDocs
Topics:
All Pages8021X HOWTOACP ModemACPI HOWTOADSL Bandwidth Man..ATA RAID HOWTOATM Linux HOWTOAX25 HOWTOAccessibility Dev ..Accessibility HOWTOAdv Bash Scr HOWTOAdv Routing HOWTOAntares RAID sparc..Apache Compile HOWTOApache WebDAV LDAP..Assembly HOWTOAstronomy HOWTOAthlon Powersaving..Authentication Gat..Autodir HOWTOAviation HOWTOAvr Microcontrolle..BRIDGE STP HOWTOBTTVBackspaceDeleteBandwidth Limiting..Bangla HOWTOBash Prompt HOWTOBattery PoweredBelarusian HOWTOBelgian HOWTOBeowulf HOWTOBocaBogoMipsBootdisk HOWTOBridgeC++ dlopenC C++Beautifier HO..C editing with VIM..CDROM HOWTOCDServer HOWTOCable ModemCaudium HOWTOClone HOWTOCompaq Remote Insi..Compaq T1500 HOWTOConexant+Rockwell ..Cryptoloop HOWTODB2 HOWTODHCPDSL HOWTODVD Playback HOWTODebian Binary Pack..Debian JigdoDebian and Windows..Disk Encryption HO..Disk on Chip HOWTODocBook Demystific..DocBook InstallDocBook OpenJade S..Ecology HOWTOEmacspeak HOWTOEncourage Women Li..Encrypted Root Fil..Euro Char SupportEvent HOWTOFedora Multimedia ..Finnish HOWTOFirewall PiercingFlash Memory HOWTOFont HOWTOFramebuffer HOWTOGCC HOWTOGIS GRASSGlibc Install HOWTOHOWTO HOWTOHOWTO INDEXHP HOWTOHandspring VisorHard Disk UpgradeHardware HOWTOHighQuality Apps H..Home Electrical Co..IBM7248 HOWTOIO Perf HOWTOIP AliasIP Masquerade HOWTOIRCImplement Sys Call..Indic Fonts HOWTOInfrared HOWTOIngresII HOWTOInstall StrategiesInstallation HOWTOInstallfest HOWTOIntkeybItalian HOWTOJabber Server Farm..JavaStation HOWTOKerberos Infrastru..Kernel HOWTOKerneldKodak Digitalcam H..LDAP HOWTOLDP Reviewer HOWTOLILO crash rescue ..LVM HOWTOLeased LineLegoLinksys Blue Box R..Linux+Win95Linux+Win9x+Grub H..Linux+Windows HOWTOLinux Complete Bac..Linux Crash HOWTOLinux Gamers HOWTOLinux Modem SharingLinux Promise RAID..Linux i386 Boot Co..LinuxGL QuakeWorld..Lotus DominoR5MILO HOWTOMMBase Inst HOWTOMP3 CD BurningMail User HOWTOMajordomo MajorCoo..Man PageMasquerading Simpl..Medicine HOWTOMindTerm SSH HOWTOMobile IPv6 HOWTOMock MainframeModule HOWTOModulesMotorola Surfboard..Mozilla OptimizationMulti Distro DevNCURSES Programmin..NFS HOWTONFS Root Client mi..NIS HOWTONetMeeting HOWTONetwork boot HOWTONvidia OpenGL Conf..OLSR IPv6 HOWTOOnline Troubleshoo..Oracle 9i Fedora 3..PA RISC Linux Boot..PCTel MicroModem C..PHP Nuke HOWTOPPP HOWTOPagerPalmOS HOWTOPartitionPartition Mass Sto..Partition Mass Sto..Partition RescuePine ExchangePortSlavePost Installation ..Postfix Cyrus Web ..Pre Installation C..Print2WinPrinting HOWTOProcess AccountingProgram Library HO..Proxy ARP SubnetQmail ClamAV HOWTOQmail VMailMgr Cou..Querying libiptc H..RPM HOWTOReading List HOWTORedHat CD HOWTOReliance HOWTORemote BridgingRemote Serial Cons..SCSI 2.4 HOWTOSCSI Generic HOWTOSLIP PPP EmulatorSRM HOWTOSSL Certificates H..Scanner HOWTOScientific Computi..Scripting GUI TclTkSecure CVS PserverSecure Programs HO..Security HOWTOSecurity Quickstar..Security Quickstar..Serial Laplink HOWTOSerial Programming..Slovak HOWTOSmall MemorySmart Card HOWTOSoftware Proj Mgmt..Software Release P..Sound HOWTOSpam Filtering for..Speech Recognition..SquashFS HOWTOSybase ASA HOWTOSybase ASE HOWTOSybase PHP ApacheTCP Keepalive HOWTOTamil Linux HOWTOTimePrecision HOWTOTimeSys Linux Inst..Token RingTraffic Control HO..Traffic Control tc..UPS HOWTOUnix Hardware Buye..Unix and Internet ..UpgradeUsenet News HOWTOUser Authenticatio..VB6 to TclVMS to Linux HOWTOVPN HOWTOValgrind HOWTOVideoLAN HOWTOVim HOWTOVirtual WebWebcam HOWTOWikiText HOWTOWindows Newsreader..Wireless Link sys ..Wireless Sync HOWTOXDM XtermXDMCP HOWTOXFree Local multi ..XFree86 HOWTOXFree86 R200XFree86 Second MouseXFree86 Video Timi..XML RPC HOWTOXWindow Overview H..XWindow User HOWTOXinerama HOWTOXterminalsHtml singleI810 HOWTOLibdc1394 HOWTOOpenMosix HOWTOPhhttpd HOWTOPpp sshText
Next Previous Contents

3. Applications with Thai language

This is the tricky part. Most applications support ISO-8859-1 character set. For example, emacs can display ISO-8859-1 character. If we set emacs to display ISO-8859-1 and use Thai font, you can edit Thai document with emacs. But this is not a good policy. You should avoid using this trick as possible. What we need is Thai locale or Thai supported applications to manage these things. .:: telegra.ph ::.

To make X window application displays Thai font, you should run the application with -fn option. For example,

%xedit -fn thai8x16
Note that thai8x16 is just a one of Thai font names. You can see all available fonts by command xlfonts. If you don't want to fill -fn option every time you run application. You should set Thai font in your ~/.Xdefaults or ~/.Xresources like this
XTerm*font:     thai8x16

3.1 Some X applications and Thai language

txterm

txterm is Thai version of xterm. There are several programs running under xterm such as shell, pine, vi, less, etc. We can type Thai characters without any problems with txterm. Txterm also provides its own Thai input method by pressing " F1 " key. Txterm will use fonts thai9x13 as default Thai font. You can change this by add -fn option.

You can get txterm from Thaigate or ZzzThai.

bash shell :

Normally, shell accepts only ASCII character set. To type Thai characters in shell command line, you should set environment LC_CTYPE to iso_8859_1.

I don't set LC_CTYPE environment variable to iso_8859_1 because this environment variable will effect other applications too. With bash shell, you can specify which environment variable to be passed to the application. For example, I can make a fake Thai X terminal with this syntax. .:: podcasts.apple.com ::.

LC_CTYPE=iso_8859_1 xterm -fn thai8x16
This xterm display Thai characters well, but not good for typing Thai characters. I strongly recommend you to use txterm.

ls :

If you name a filename in Thai. Issue the command as

ls -N 

You may set alias in ~/.bashrc or ~/.cshrc, so you can type ls without option. If you don't use ls with -N option, you may see Thai filename as ?????.

Emacs, Mule

Mule stands for " Multilingual Enhancement to GNU Emacs " . It has the same functions as emacs and supports many languages. .:: score808id.onlc.fr ::. Mule provides its own input method, so you don't need any configuration for typing Thai. You needs only Thai fonts for mule which you can get from, ZzzThai or Etl site. These Thai fonts are fixed width fonts.

You need some configuration for mule. Puts the following lines in your .emacs.

;;
;; Thai System, add in .emacs
;;
(set-file-coding-system-for-read '*tis620*)
(set-default-file-coding-system '*tis620*)
(set-display-coding-system '*tis620*)
(set-keyboard-coding-system '*tis620*)
(setq-deafault quail-current-package (assoc "thai" quail-package-alist))
Add the following lines in .Xdefaults.
!
! Emacs, Mule - Font menu
!
Emacs*FontSetList: thai14, thai16, thai24
Emacs*FontSet-thai14:\
        -etl-fixed-medium-r-normal--14-140-72-72-m-70-tis620.2529-1
Emacs*FontSet-thai16:\
        -etl-fixed-medium-r-normal--16-160-72-72-m-80-tis620.2529-1
Emacs*FontSet-thai24:\
        -etl-fixed-medium-r-normal--24-500-72-72-m-120-tis620.2529-1

When you hold shift key and press left mouse's button, you can select Thai fonts to display in mule window. To type Thai characters, press " Ctrl + ] " . To type English, press " Ctrl + ] " again.

You can get mule from ElectroTechnical Laboratory(ETL)

vi

Vi should be run on txterm.

pine

In the past, we could not send 8-bit characters through E-mail. Now, although mail transfer agent can handle 8-bit characters but some old mail transfer agent can not. We can send Thai e-mail by using e-mail application that supports MIME (Multipurpose Internet Mail Extensions) E-mail applications that support MIME are pine, elm, Netscape mail, etc.

Put the following definition in your ~/.pinerc file:

character-set=ISO-8859-1
This can also be set via the Setup option in pine window. You can find it under Config. You can read Thai news from pine, too.

Pine should be run in txterm.

Netscape

If you have Thai fonts in your system. Just set Thai font from preference. Thai fonts will appear in User defined area. See .:: squareblogs.net ::. http://www.fedu.uec.ac.jp/ZzzThai/unix for setting Thai language on Netscape.

Some movement about Thai Mozilla project at http://members.xoom.com/inThai/mozthai.html.

Ss, Simple thai word Separator

ss is a dictionary based Thai word separation program similar to cttex. It can be used to insert a configurable string between Thai words. It can also show words that cannot be found in the dictionary. More words can be added to the dictionary. Developed by Mr.Teera Kittichareonpot. [NPM Package: CSS3]

We can use this program to insert < WBR > tag between Thai words in html file. Browser will display Thai homepage better than normal html document.

Xzthai, X keyboard configurator + simple editor

Xzthai, this is the Tcl/Tk application for mapping Thai keyboard on any keyboard with graphical user interface. Also provides simple editor and keyboard layout figure. It actually uses xmodmap program in background to map Thai keyboard. This may be useful for commercial X server and X server on UNIX.

3.2 Printing Thai document

Thai2ps is used to convert plain text file to postscript file.You can use ghostscript( [Scientific Data: WebSocket] gs) to print your Thai document. For better quality document, you have to use (La)TeX.

Latex and Thai language

Dr. Manop Wongsaisuwan first tried to use Thai language with latex. He wrote some perl script as filter for latex source code that contains Thai language. Then pass the result to latex. Mr. Vuthichai Ampornaramvech used this concept and wrote a program in C language, cttex, to handle this. It runs faster and makes Thai word segmentation based on dictionary. Cttex also fixes the position of Thai characters in word, so SARA and WANNAYUK will be placed in the beautiful position.

You can find Thai latex filter from http://thaigate.nacsis.ac.jp/files/ttex.html.

Latex's configuration for Thai language

You must have latex installed in your computer. First, download Thai postscript (Type1) fonts, tfm fonts and Thai style file. These fonts are needed by Latex. This is the list of files you should download.

tfm fonts:
    dbtt.tfm    dbttb.tfm   dbttbi.tfm  dbtti.tfm
postscript fonts:
    dbtt.pfa    dbttb.pfa   dbttbi.pfa  dbtti.pfa
style files:
    thai.sty sakka.sty 
Thai Latex filter:
    cttex
Sample Latex file:
    ttex.ttex test.ttex

There is latex's directory at /usr/lib/texmf/texmf/ (RedHat 5.0). I will call /usr/lib/texmf/texmf/ as " $texroot " . We will concentrate at $texroot/texmf/ directory. In $texroot/texmf/ directory, there are many files about tex's configuration. You have to edit files in dvips, fonts, tex subdirectories.

Add the following lines to $texroot/texmf/dvips/misc/psfonts.map

dbtt  DBThaiText <dbtt.pfa
dbttb DBThaiTextBold <dbttb.pfa
dbttbi DBThaiTextBoldItalic <dbttbi.pfa
dbtti DBThaiTextItalic <dbtti.pfa

Make a new directories and copy files to the appropriate directories.

%mkdir /usr/lib/texmf/texmf/fonts/tfm/public/thai
%mkdir /usr/lib/texmf/texmf/fonts/type1/public/thai
%mkdir /usr/lib/texmf/texmf/tex/generic/thai
%cp *.tfm /usr/lib/texmf/texmf/fonts/tfm/public/thai
%cp *.pfa /usr/lib/texmf/texmf/fonts/type1/public/thai
%cp *.sty /usr/lib/texmf/texmf/tex/generic/thai

Run texhash or MakeTeXls-R(in some system) to update Tex database.

%/usr/bin/texhash
texhash: updating /usr/lib/texmf/texmf/ls-R ...
texhash: Done.

Use Thai LaTeX filter

We can use cttex as filter like this,

%cttex < ttex.ttex > ttex.tex
C-TTeX $Revivsion: 1.15 $
Usage : cttex [cutcode] < infile > outfile
Usage : cutcode=0 forces operation in HTML mode.
Build-in dictionary size: 9945 words
 343
Done
%latex ttex.tex
...
%xdvi ttex.dvi
You can convert dvi file to postscript file by,
%dvips -o ttex.ps ttex.dvi

Finally, you can print ttex.ps by using gs or lpr. You must configure printer before printing. See man-pages of printcap, gs, lpr for more information.

Editing LaTex source file

For new latex user, lyx is helpful. But I recommend to use mule to edit Thai latex source file because mule supports Thai language and it is a powerful editor. You may take a look a Thai Latex tutorial.

3.3 X Application Resources

Because Xt based applications allow user to configure the applications by resources. We can make the menu or label to be Thai language.

For example, if you want xman to display Thai labels. You may add these lines in your .Xdefaults

......
!!  Xman section
Xman*Font:                          thai8x16
Xman*helpButton.Label:              
Xman*quitButton.Label:              ͡
Xman*manpageButton.Label:           ͡
......

You can use the same idea to set window manager to be more Thai environment too.

3.4 Thai Extension for Linux (TE)

Thai Extension for Linux is a installation package comes with applicaions and Thai fonts. You don't have to configure Linux system and applications by yourself. Let TE do configuration task for you. After installation, you can use Thai language suddenly. Get TE from ftp://fedu.uec.ac.jp/pub/thai/UEC/ZzzThai/Software/Linux/


Next Previous Contents

Share or Research:

Share on FB Post to X LinkedIn 🤖 Ask AI about this