Copyright © 2018-2024 World Wide Web Consortium. W3C® liability, trademark and permissive document license rules apply.
This document describes and prioritises gaps for the support of the Thai script on the Web and in eBooks. In particular, it is concerned with text layout. It checks that needed features are supported in W3C specifications, such as HTML and CSS and those relating to digital publications. It also checks whether the features have been implemented in browsers and ereaders.
This section describes the status of this document at the time of its publication. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/.
This document describes and prioritises gaps for the support of the Thai script on the Web and in eBooks. In particular, it is concerned with text layout. It checks that needed features are supported in W3C specifications, in particular HTML and CSS and those relating to digital publications. It also checks whether the features have been implemented in browsers and ereaders. It is linked to from the language matrix that tracks Web support for many languages.
The editor's draft of this document is being developed in the GitHub repository Southeast Asian Language Enablement (sealreq), with contributors from the W3C Internationalization Interest Group. It is published by the Internationalization Working Group. The end target for this document is a Working Group Note.
This document was published by the Internationalization Working Group as a Group Draft Note using the Note track.
Group Draft Notes are not endorsed by W3C nor its Members.
This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
The W3C Patent Policy does not carry any licensing requirements or commitments on this document.
This document is governed by the 03 November 2023 W3C Process Document.
This document was created by Richard Ishida.
See also the GitHub contributors list for the Southeast Asian Language Enablement project, and the discussions related to the Thai script.
The W3C needs to make sure that the needs of scripts and languages around the world are built in to technologies such as HTML, CSS, SVG, etc. so that Web pages and eBooks can look and behave as people expect around the world.
This page documents difficulties that people encounter when trying to use languages written in the Thai script on the Web.
Having identified an issue, it investigates the current status with regards to web specifications and implementations by user agents (browsers, e-readers, etc.), and attempts to prioritise the severity of the issue for web users.
This document not only describes gaps, it also attempts to prioritise them in terms of the impact on the local user. The prioritisation is indicated by colour.
Key:
It is important to note that these colours do not indicate to what extent a particular feature is broken. They indicate the impact of a broken or missing feature on the content author or end user.
Basic styling is the level that would be generally accepted as sufficient for most Web pages. Advanced level support would include additional features one might expect to include in ebooks or other advanced typographic formats. There may be features of a script or language that are not supported on the Web, but that are not generally regarded as necessary (usually archaic or obscure features). In this case, the feature can be described here, but the status should be marked as OK.
The decision as to what priority level is assigned to a described gap is down to the experts doing the gap analysis. It may not always be straightforward to decide. If a given section in this document refers to more than one feature that is broken, each with different impacts on Web users, the priority for the section should be the lowest denominator.
A cell can be scored as OK if the feature in question is specified in an appropriate specification, and is supported by user agents. A specification that is in CR or later and has two implementations in 'major' browsers will count. This means that the feature may not be supported in all browsers yet. (At some point in the future we may try to distinguish, visually, whether support is available in a specification but still pending in major browsers or applications.)
See also General page layout & progression for features such as column layout, page turning direction, etc. that are affected by text direction.
Are the script requirements for vertically oriented text met? What about if you mix vertical text with scripts that are normally only horizontal? Do you need a switch to use different characters in vertical vs. horizontal text? Does the browser support short runs of horizontal text in vertical lines (tate-chu-yoko in Japanese) as expected? Is the orientation of characters and the directional ordering of characters supported as needed?
If this script runs right-to-left, are there any issues when handling that? Is bidirectional text adequately supported? What about numbers and expressions? Do the Unicode bidi controls and HTML markup provide the support needed? Is isolation of directional runs problematic?
Do the standard fallback fonts used in browsers (eg. serif, sans-serif, cursive, etc.) match expectations? Are special font or OpenType features needed for this script that are not available?
Does the script in question require additional user control features to support alterations to the position or shape of glyphs, for example adjusting the distance between the base text and diacritics, or changing the glyphs used in a systematic way? Do you need to be able to compose/decompose conjuncts, or show characters that are otherwise hidden, etc?
This covers ways of modifying the glyphs, such as for italicisation, bolding, oblique, etc. Do italic fonts lean in the right direction? Is synthesised italicisation problematic? Are there other problems relating to bolding or italicisation - perhaps relating to generalised assumptions of applicability?
If this script is cursive (eg. Arabic, N’Ko, Syriac, etc), are there problems or needed features related to the handling of cursive text? Do cursive links break if parts of a word are marked up or styled? Do Unicode joiner and non-joiner characters behave as expected?
Does your script need special text transforms that are not supported? Does your script convert letters to uppercase, capitalised and lowercase alternatives according to your typographic needs? Do you need to to convert between half-width and full-width presentation forms?
Are there any character repertoire issues preventing use of this script on the Web? Do variation selectors need attention? Are there any other encoding-related issues?
This is about how text is divided into graphemes, words, sentences, etc., and behaviour associated with that. Do Unicode grapheme clusters appropriately segment character units for your script? When you double- or triple-click on the text, is the expected range of characters highlighted? When you move through the text with the cursor, or backspace, etc. do you see the expected behaviour? (Some of the answers to these questions may be picker up in other sections, such as line-breaking, or initial-letter styling.)
Are there specific problems related to punctuation or the interaction of the text with punctuation (for example separation of punctuation from previous text, but allowing no line break between)? Are there issues related to handling of abbreviation, ellipsis, or iteration? Are there problems related to bracketing information or demarcating things such as proper nouns, etc?
Languages: th 2
This issue is probably also applicable to other languages.
In principle, Thai uses large spaces between sentences, and small spaces in other places (eg. for separating sub clauses).
There is no standard way to achieve the different width spaces, and the reduction of multiple white-space on the Web to a single space has not caused major objections. Still, it would be useful to propose a standard approach, so that people would have the means to easily make the difference when they want (eg. to by regularly providing additional keys on a keyboard), and to facilitate parsing and segmentation of natural language text.
It appears that some people use U+2003 EM SPACE for the wider space. Apparently, minority languages using the Khmer script do the same (although they also appear to use U+2006 SIX-PER-EM SPACE for the smaller space, which doesn't appear to be a requirement here).
See this discussion thread: Variable sized spaces in Thai
Specs: Specifications currently offer no advice on this topic.
Need to check whether the necessary white-space rules apply to EM SPACE.
Tests & results:
interactive test, Font support for EM SPACE
Shows that no Thai fonts on Mac OS X or Windows 10 have a glyph for EM SPACE, with the exception of Arial Unicode MS and Tahoma.
Priority: As mentioned before, people writing Thai are getting by without the wide space at the moment, but don't know how best to produce one when they want. Usage is likely to be associated with careful typography much of the time, so advanced priority seems appropriate.
Are there any issues when dealing with quotations marks, especially when nested? Should block quotes be indented or handled specially?
Thai uses the same quote marks as English, so it avoids some of the issues that other writing systems encounter.
How are emphasis and highlighting achieved? If lines or marks are drawn alongside, over or through the text, do they need to be a special distance from the text itself? Is it important to skip characters when underlining, etc? How do things change for vertically set text?
What characters or other methods are used to indicate abbreviation, ellipsis & repetition?
The ruby spec currently specifies an initial subset of requirements for fine-tuning the typography of phonetic and semantic annotations of East Asian text, including furigana, pinyin and zhuyin fuhao systems. Is is adequate for what it sets out to do? What other controls will be needed in the future? What about other types of inline annotation, such as warichu? (For referent-type notes such as footnotes, see below.)
This is about ways of marking text (see also specific sections dedicated to quotations and inline notes/annotations). Is it possible to express emphasis or highlight content as expected? Bold, italic and under-/over-lines are not always appropriate, and some scripts have their own unique ways of doing things, that are not in the Western tradition at all. Text delimiters mark certain items or sections off from the main text, such as book names in Chinese, quotations, head markers in Tibetan, etc, and often involve the use of punctuation. Is there any behaviour that isn't well supported, such as overlines for numeric digits in Syriac? Are there issues about the positioning or use of underlines? Some aspects related to the drawing of lines alongside or through text involve local typographic considerations. Do underlines need to be broken in special ways for this script? Do you need support for additional line shapes or widths? Does the distance or position of the lines relative to the text need to vary in ways that are not achievable? Are lines correctly drawn relative to vertical text?
If the script has its own set of number digits, are there any issues in how they are used? Does the script or language use special format patterns that are problematic (eg. 12,34,000 in India)? What about date/time formats and selection - and are non-Gregorian calendars needed? Do percent signs and other symbols associated with number work correctly, and do numbers need special decorations, (like in Ethiopic or Syriac)? How about the management of personal names, addresses, etc. in web pages: are there issues?
Does the browser capture the rules about the way text in your script wraps when it hits the end of a line? Does line-breaking wrap whole 'words' at a time, or characters, or something else (such as syllables in Tibetan and Javanese)? What characters should not appear at the end or start of a line, and what should be done to prevent that?
Languages: th 2
ๆ [U+0E46 THAI CHARACTER MAIYAMOK] should not wrap to the beginning of a line, even if surrounded by spaces. Space before the maiyamok is mandated by the writing style guide of the Royal Institute, which is considered to be the official Thai language style guide, and is used by government officials. The same guide also requires a space before maiyamok.
Specs: This level of detail is not described in the CSS specs. However, it may be useful to add a note to the spec to say that occasionally characters like this need special handling, especially when following a space.
Tests & results: interactive test, Maiyamok doesn't wrap to a new line alone, even if separated from the previous word by a space Gecko, Blink, and WebKit, all fail the test.
Priority: Marking as advanced, since the undesirable behaviour isn't a major problem.
When text in a paragraph needs to have flush lines down both sides, does it follow the rules for your script? Does the script need assistance to conform to a grid pattern? Does your script allow punctuation to hang outside the text box at the start or end of a line? Where adjustments are need to make a line flush, how is that done? Do you shrink/stretch space between words and/or letters? Are word baselines stretched, as in Arabic? What about paragraph indents, or the need for logical alignment keywords, such as start/end, rather than left/right?
Languages: th 2
Since Thai doesn't use spaces around words, but instead uses them to separate phrases or sentences, justification in Thai primarily adjusts the blank spaces between phrases, rather than expanding the text between words or syllables.
It may also, however, need to make certain adjustments to inter-character spacing. If a run of text without spaces is longer than the line length, the line will wrap after the last word that fits on the line. This leaves a gap at the line end that can be several characters long. Justification should then add space between the letters on the line to make the last character flush with the right edge of the line box. This character-based spacing is most common in narrow columns, such as newsprint, however it is also sometimes applied to a line with spaces to reduce the large gaps produced by justification within the line.
Specs:
css-text-3 describes mentions that this behaviour may apply for Thai, but doesn't specify how Thai justification should happen, leaving that to the browser implementers. It does however provide an inter-character
value for the text-justify
property, which should produce the desired result.
Tests & results:
Interactive test, Multiple lines of Thai text with no spaces will be justified by spacing between letters with text-justify set to auto
Gecko, Blink, and Webkit all fail to produce the expected behaviour, regardless of the fact that the language is set to Thai.
Interactive test, Multiple lines of Thai text with no spaces will be justified by spacing between letters with text-justify set to inter-character
Gecko does produce what's expected, but Blink, and Webkit both fail.
Interactive test, In Thai, text-justify:inter-character splits SARA AA and NIKAHIT apart, and leaves tone marks above the latter
Gecko doesn't do what's expected. Blink and Webkit are not relevant, since they don't implement inter-character spacing for Thai.
Priority: Marked as advanced on the assumption that full justification is only really needed for certain types of text. A priority of basic could be applied if feedback is received from the community that this is needed for general authoring.
Some scripts create emphasis or other effects by spacing out the words, letters or syllables in a word. Are there requirements for this script/language that are unsupported? (For justification related spacing, see below.)
Languages: th lo 2
This issue applies to all languages that use letter-spacing.
Currently browsers that apply letter-spacing do so by adding a space after every letter in the text that is tracked. This results in a superfluous space at the end of the range, which creates an inappropriate gap before the following text. Letter spacing at the end of a line makes the line look misaligned in justified or right-justified text. It also has implications for text that has other styling, such as an outline or a coloured background, at the same time as being stretched.
For more details, see this GitHub issue, which is being used to track this gap. Please add any discussion there, and not to this issue.
Does the browser support requirements for baseline alignment between mixed scripts and in general?
The CSS Counter Styles specification describes a limited set of simple and complex styles for counters to be used in list numbering, chapter heading numbering, etc.The rules plus more counter styles (totalling around 120 for over 30 scripts) are listed in the document Ready-made Counter Styles. Do these cover your needs? Are the details correct? Are there other aspects related to counters and lists that need to be addressed?
Does the browser or ereader correctly handle special styling of the initial letter of a line or paragraph, such as for drop caps or similar? How about the size relationship between the large letter and the lines alongide? where does the large letter anchor relative to the lines alongside? is it normal to include initial quote marks in the large letter? is the large letter really a syllable? etc. Are all of these things working as expected?
How are the main text area and ancilliary areas positioned and defined? Are there any special requirements here, such as dimensions in characters for the Japanese kihon hanmen? The book cover for scripts that are read right-to-left scripts is on the right of the spine, rather than the left. Is that provided for? When content can flow vertically and to the left or right, how do you specify the location of objects, text, etc. relative to the flow? For example, keywords 'left' and 'right' are likely to need to be reversed for pages written in English and page written in Arabic. Do tables and grid layouts work as expected? How do columns work in vertical text? Can you mix block of vertical and horizontal text correctly? Does text scroll in the expected direction? Other topics that belong here include any local requirements for things such as printer marks, tables of contents and indexes.
Does the script have special requirements for character grids or tables?
Does your script have special requirements for footnotes, endnotes or other necessary annotations of this kind in the way needed for your culture? (There is a section above for purely inline annotations, such as ruby or warichu. This section is more about annotation systems that separate the reference marks and the content of the notes.)
Are vertical form controls well supported? In right-to-left scripts, is it possible to set the base direction for a form field? Is the scroll bar on the correct side? etc.
Sometimes a script or language does things that are not common outside of its sphere of influence. This is a loose bag of additional items that weren't previously mentioned. This section may also be relevant for observations related to locale formats (such as number, date, currency, format support).
There are many other CSS modules which may need review for script-specific requirements, not to mention the SVG, HTML, Speech, MathML and other specifications. What else is likely to cause problems for worldwide deployment of the Web, and what requirements need to be addressed to make the Web function well locally?