Khmer Layout Requirements (Draft)

W3C Group Draft Note

More details about this document
This version:
https://www.w3.org/TR/2024/DNOTE-khmr-lreq-20240630/
Latest published version:
https://www.w3.org/TR/khmr-lreq/
Latest editor's draft:
https://w3c.github.io/sealreq/khmer/
History:
https://www.w3.org/standards/history/khmr-lreq/
Commit history
Editor:
Richard Ishida (W3C)
Feedback:
GitHub w3c/sealreq (pull requests, new issue, open issues)

Abstract

This document describes or points to requirements for the layout and presentation of text in languages that use the Khmer 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 Khmer text.

Status of This Document

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 the basic requirements for Khmer 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 Khmer scripts. Currently the document focuses on Khmer as used for the Khmer language. The information here is developed in conjunction with a document that summarises gaps in support on the Web for Khmer.

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.

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.

Some links on this page point to repositories or pages to which information will be added over time. Initially, the link may produce no results, but as issues, tests, etc. are created they will show up.

Links that have a gray color led to no content the last time this document was updated. They are still live, however, since relevant content could be added at any time. When the document is updated, links that now point to results will have their live colour restored.

1. Introduction

1.1 Contributors

The initial information in this document was provided by Richard Ishida, drawing on the structure and information in Cambodian (Khmer) 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 Khmer.

1.2 About this document

The aim of this document is to describe the basic requirements for Khmer 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 Khmer script. The document currently focuses on texts using the Cambodian language.

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

1.3 Gap analysis

This document is pointed to by a separate document, Khmer Gap Analysis, which describes gaps in support for Khmer 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 Khmer 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.

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 Khmer 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 Khmer experts. Each section below points to related discussions. See also the repository home page.

2. Khmer Script Overview

The script is an abugida, ie. like most Brahmi-influenced scripts, each consonant carries with it an inherent vowel. The sound following a consonant can be modified by attaching vowel signs to the consonant when writing.

Khmer text runs left to right in horizontal lines. Words are not separated by spaces, however words may be separated by zero-width space characters (ZWSP). Spaces are used as phrase separators.

The orthography is based around, and segmented into, orthographic syllables, which may not match phonological syllables directly.

A key feature of Khmer is that there are a large number of vowel sounds, and only a few vowel signs; and there are a large number of consonant letters for only a small number of consonant sounds. This led to a system where there are generally two consonant signs for a given sound, each belonging to one of two classes (or registers). So to determine the pronunciation of an inherent vowel or a vowel sign one first determines which class of consonant it follows. For example, using the two symbols for the sound k, is kɑː neck, and is kɔː mute. Other factors may also affect the sound, such as stress, vowel harmony, and diacritics.

Clusters of consonant letters are very common at the beginning of a word, but such clusters also occur medially in multisyllable words, and occasionally at the end of a word (though the second consonant at the word end is usually not pronounced). Clusters are indicated by stacked consonants. Subjoined forms are created using an invisible coeng character. Stacks do not span word boundaries.

Word-final consonant sounds (typically 8 consonants and characters) use ordinary code points without an inherent vowel. Because there are no spaces or other word dividers, it is difficult to detect boundaries algorithmically. Two word-final sounds (m and h) can be produced using combining marks.

Khmer has pre-base glyphs and circumgraphs, 2 of which can decompose into multipart vowels. It also has a good number of multipart vowels (made from combinations of vowel signs, and consonants/diacritics). Multipart vowels can involve up to 3 glyphs, but only surround the base consonant(s) on 2 sides.

Standalone vowel sounds are typically written using vowel signs applied to U+17A2 KHMER LETTER QA, but there is also an incomplete set of independent vowels.

3. All topics

4. Text direction

Khmer is written horizontally, left to right.

5. Glyph shaping & positioning

5.1 Fonts & font styles

5.2 Context-based shaping & positioning

5.3 Letterform slopes, weights, & italics

6. Typographic units

6.1 Characters & encoding

6.2 Grapheme/word segmentation & selection

7. Punctuation & inline features

7.1 Phrase & section boundaries

7.2 Quotations & citations

7.3 Emphasis & highlighting

7.4 Abbreviation, ellipsis & repetition

7.5 Inline notes & annotations

7.6 Text decoration & other inline features

8. Line & paragraph layout

8.1 Line breaking & hyphenation

8.2 Text alignment & justification

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

8.3 Text spacing

Cambodian 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.

8.4 Baselines, line height, etc.

8.5 Lists, counters, etc.

8.6 Styling initials

9. Page & book layout

tbd

A. Change log