Thai on Amiga

MorphOS and AmigaOS do not have any specific facilities to support Thai language. The reason for this is that no Thai people use these operating systems and there are very few non native speakers. I want to use Thai.

Many aspects of using Thai on a computer are trivial. The biggest problem is font support: MorphOS does not use Unicode internally. In the future this will most definitely come but it is a big job. I am gently pushing for Thai support; every time a font feature is updated for MorphOS I report problems with Thai fonts and offer technical advice to MorphOS developers. I also participate in translating MorphOS to Thai; a native speaker should do translations but I am hoping my efforts will make it easier in the future.

MorphOS credits

At my prompting Detlef Würkner added localisation to AmigaOS 4 for Thai with a little assistance. Slowly, I am progressing towards my goal of Thai on Pegasos and Amiga.

Text Coding

In Thailand, TIS-620 coding is still the most commonly used format although there is sporadic and random support for Unicode. IMHO it is a bit of a mess. In MorphOS we can use TIS-620 because it is an 8 bit coding. Text coded in UTF-8 or escaped HTML can be converted using thaiconv. thaiconv can guess the coding but see my Thai email guide with screen shots from YAM for images of how the different codings may appear.

In MorphOS you will need to set the font to a Thai font in many places. MUI preferences are adjustable for just about every on screen GUI object so where you need a Thai font you will need to change the setting.

In summary all fonts, text, etc. will need to be in TIS-620.

Additional Codesets for Thai

Charset files for codesets.library. can be downloaded here: thai-codesets.lha. Extract and copy to LIBS:Charsets.

BareEd and Thai

BareEd supports proportional fonts therefore by abusing kerning information we can render tone markers and diacritics in roughly the correct place. My "Amiga Thai Fonts" have Thai characters in a TIS-620 coding and suitable kerning.

Joerg van de Loo kindly supports Thai in BareEd via such special fonts. I think my abuse of the font system caused several headaches for his font rendering but after several iterations he has got the best rendering possible for standard bitmap fonts, I have modified the fonts to be more consistent and hopefully the font code is a bit more robust too.

You still need to install a Thai keymap so that it is possible to type in Thai. I have been using this method to edit Thai documents, email, web pages etc for several years. Given that I had Joerg's ear, I suggested and then implemented code to enforce Thai letter sequence order which is used by BareEd. I regularly see Thai text with invalid sequence order posted on the Web, input by people using supposedly more modern operating systems.

Special features that support Thai:
  • Improved rendering of Thai fonts - developed using my Thai fonts and thus ensuring good quality display. This is essential as most text editors do not properly respect the negative kerning required by Thai fonts when using the standard Amiga font rendering system.
  • The cursor only moves between consonants and in-line vowels to avoid being lost in composing characters (i.e. tone markers, above and below vowels and diacritics).
  • Pressing delete can optionally delete the character to the right of the cursor or the character to the right plus all composing characters.
  • WTT 2 Standard compliant:
    • Invalid letter combinations can be prevented from being input, for example leading vowels must be followed by a consonant.
    • Invalid letter combinations are displayed such that it is much easier to see mistakes.
    • 3 levels of checking available (as per WTT): pass through, basic check and strict.
BareEd in TIS-620 mode
Editing an HTML file from in BareEd

Without these features I often typed Thai text that looked fine but only after closer inspection or viewing on other platforms I could see that there were mistakes. Often, this is because the other platform's software did not understand the Thai locale and the font rendering broke.

Depending on the font and the application, sometimes mistakes looked correct and sometimes they made the word unreadable. Using the WTT specification it is possible to ensure that texts are correct so that they can render properly and that mistakes look consistent across different software and platforms. Now these features are implemented in BareEd, I can rest assured that any mistakes are in my use of language and not in my typing.

BareEd editing the Thai word for water
Editing the Thai word for water

Guide to the above image: Left: BareEd before Thai support - a word has been entered with an invalid sequence of letters. Middle: BareEd with Thai support - in strict mode the sequence checker makes it impossible to type incorrect sequences so in this case the author was forced to type the correct letter order. Right: BareEd with Thai support - in pass through mode a space is inserted before invalid characters allowing the user to identify the mistake more easily. Without the extra space inserted by pass through mode, it is quite difficult to see the difference between correct and incorrect, however you may deliberately type invalid sequences in the rare case you need to.

Getting Started with BareEd and Thai

Using Thai with BareEd is easy. You just need to follow these steps:
  1. Using a Thai keymap, start BareEd.
  2. Select a Thai font, e.g. lhthai 24 point.
  3. Switch BareEd to TIS-620 mode.
  4. Select the level of stringency when checking Thai input.
Steps 2, 3 and 4 can be set by editing the icon tooltypes.

During the development of these new features it has been possible to spot ways to improve the quality of my Thai fonts; for example certain combinations of letters are not valid so this gave me space to draw better looking letters. Also, the fact that a complete Thai implementation was going to be realised encouraged me to draw all the glyphs that were missing from my fonts because they were very rare or never used.

Working together with Joerg, we now have a viable Thai text editor and better fonts. Please contact me (emptystate at yahoo dot co dot uk) if you need help using BareEd with Thai.

The sequence validator is available as a separate tool in my thaicheck program.

WTT 2 Standard References

Email Configuration

Using BareEd with YAM

BareEd with a Thai font can be used for reading and writing email. When you reply to an email you can choose an external editor such as BareEd.

In order to use BareEd as the outgoing mail editor, set the YAM configuration. Select the path to BareEd by clicking the file icon next to the External editor string gadget.

YAM config

Setting YAM MIME Header

When sending a Thai email you should set the MIME header to indicate the coding. If you have used BareEd as an external editor then if you have installed the codesets described above you can select TIS-620 from the Charset selector:

Setting coding in YAM

Setting the coding here will allow you to set coding on a per message basis. Alternatively, you can set the coding for every outgoing message - adjust the selector marked "Charset" in the Editor panel, in the configuration window shown in the previous screenshot.