This document describes or points to requirements for the layout and presentation of text in languages that use the Thai script. The target audience is developers of Web standards and technologies, such as HTML, CSS, Mobile Web, Digital Publications, and Unicode, as well as implementers of web browsers, ebook readers, and other applications that need to render Thai text.

This document describes the basic requirements for Thai script layout and text support on the Web and in eBooks. These requirements provide information for Web technologies such as CSS, HTML and digital publications about how to support users of Thai scripts. Currently the document focuses on Thai as used for the Thai language. The information here is developed in conjunction with a document that summarises gaps in support on the Web for Thai.

The editor's draft of this document is being developed by the Southeast Asian Layout Task Force, part of the W3C Internationalization Interest Group. It is published by the Internationalization Working Group. The end target for this document is a Working Group Note.

Introduction

Contributors

The initial information in this document was provided by Richard Ishida, drawing on the structure and information in Thai Orthography Notes.

Information and clarifications were provided by Ben Mitchell, Danh Hong, Marc Durdin, and Martin Hosken as members of the W3C's Southeast Asia Language Enablement community.

See also the GitHub contributors list for the Southeast Asia Language Enablement project, and the discussions related to Thai.

About this document

The aim of this document is to describe the basic requirements for Thai script layout and text support on the Web and in eBooks. These requirements provide information for Web technologies such as CSS, HTML and digital publications, and for application developers, about how to support users of the Thai script. The document currently focuses on texts using the Thai language.

The document focuses on typographic layout issues. For a deeper understanding of the Thai script itself and how it works see Thai Orthography Notes, which includes topics such as: Phonology, Vowels, Vocalics, Consonants, Encoding choices, and Numbers.

Gap analysis

This document is pointed to by a separate document, Thai Gap Analysis, which describes gaps in support for Thai on the Web, and prioritises and describes the impact of those gaps on the user.

Wherever an unsupported feature is indentified through the gap analysis process, the requirements for that feature need to be documented. The gap reports will typically point back to this document for more information.

As gaps in support for Thai are captured, the gaps can be brought to the attention of the relevant spec developer or the browser implementator community. The progress of such work is tracked in the Gap Analysis Pipeline.

This document should contain no reference to a particular technology. For example, it should not say "CSS does/doesn't do such and such", and it should not describe how a technology, such as CSS, should implement the requirements. It is technology agnostic, so that it will be evergreen, and it simply describes how the script works. The gap analysis document is the appropriate place for all kinds of technology-specific information.

Other related resources

To complement any content authored specifically for this document, the sections in the document also point to related, external information, tests, GitHub discussions, etc.

The Language enablement index points to this document and others, and provides a central location for developers and implementers to find information related to various scripts.

The W3C also has a repository with discussion threads related to the Thai script, including requests from developers to the user community for information about how scripts/languages work, and a notification system that tracks issues in W3C working groups related to Southeast Asian scripts. See a list of unresolved questions for Thai experts. Each section below points to related discussions. See also the repository home page.

Thai Script Overview

The Thai orthography is an abugida. Consonant letters have an inherent vowel sound. Vowel signs are attached to the consonant to produce a different vowel.

Thai text runs left to right in horizontal lines.

Spaces separate phrases, rather than words.

Each onset consonant is associated with a high, mid, or low class related to tone. Tone is indicated by a combination of the consonant class, the syllable type (live/dead), plus any tone mark.

No conjuncts are used for consonant clusters.

Syllable-initial clusters and syllable-final consonant sounds are all written with ordinary consonant letters. It can therefore be difficult to algorithmically detect syllable boundaries.

An inherent vowel is pronounced o inside a closed syllable, a in an open syllable, and ɔː before a final -r. Non-inherent vowels are represented using vowel signs. Characters used to represent vowels and dipthongs include combining marks, vowel letters, and consonants. There are pre-base vowel glyphs, but Thai uses visual placement: only the vowel sign components that appear above or below the consonant are combining marks; the others are ordinary, spacing letters that are typed in the order seen.

There are no independent vowels, and standalone vowel sounds are written using vowel signs applied to U+0E2D THAI CHARACTER O ANG.

Thai has a large number of multipart vowels (including diphthongs) made from dedicated vowel characters and from consonants. Composite vowels can involve up to 4 glyphs (plus a tone mark), and glyphs can surround the base consonant(s) on up to 3 sides, eg. เกี๊ยะ kía̯ʔ geta (footwear)

Thai has vocalics.

Thai has native digits, and they are commonly used.

Text direction

Thai is written horizontally, left to right.

Glyph shaping & positioning

Fonts & font styles

Context-based shaping & positioning

Letterform slopes, weights, & italics

Typographic units

Characters & encoding

Grapheme/word segmentation & selection

Punctuation & inline features

Phrase & section boundaries

Quotations & citations

Emphasis & highlighting

Abbreviation, ellipsis & repetition

Inline notes & annotations

Other inline features

Line & paragraph layout

Line breaking & hyphenation

Text alignment & justification

Justification in Thai adjusts the space between phrases, but also makes certain adjustments to inter-character spacing.

Text spacing

Thai text doesn't appear to use inter-letter spacing in running text, however it is sometimes used in signage. (@mcdurdin) See an example.

The rules for where the separations appear are still not clear, however one might expect that it keeps together base + subjoined consonants, and base consonants + vowel signs.

The situation is less clear for spacing vowel-signs such as U+17B6 KHMER VOWEL SIGN AA, which are shown separated in the example linked to above.

Baselines, line height, etc.

Lists, counters, etc.

Styling initials

Page & book layout

tbd

Change log