Devanagari Layout Requirements

W3C Group Draft Note

More details about this document
This version:
https://www.w3.org/TR/2024/DNOTE-deva-lreq-20240709/
Latest published version:
https://www.w3.org/TR/deva-lreq/
Latest editor's draft:
https://w3c.github.io/iip/devanagari/
History:
https://www.w3.org/standards/history/deva-lreq/
Commit history
Editor:
(W3C)
Feedback:
GitHub w3c/iip (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 Devanagari 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 Devanagari 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 Devanagari 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 Devanagari script languages. Currently the document focuses on the Devanagari script as used for Hindi and Marathi. The information here is developed in conjunction with a document that summarises gaps in support on the Web for Devanagari.

The editor's draft of this document is being developed by the Indian 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.

To make it easier to track comments, please raise separate issues or emails for each comment, and point to the section you are commenting on using a URL.

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 version of this document was prepared by Richard Ishida.

Thanks to the following people who contributed information that is used in this document (contributors' names listed in in alphabetic order): Akshat Joshi, Alolita Sharma, Vivek Pani.

See also the GitHub contributors list for the Indian Language Enablement project, and the discussions related to Devanagari script.

1.2 About this document

The aim of this document is to describe the basic requirements for Devanagari 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 Devanagari script. The document currently focuses on texts using the Hindi and Marathi languages.

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

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.

1.3 Gap analysis

This document should be used alongside a separate document, Devanagari Gap Analysis, which describes gaps in support for Devanagari on the Web, and prioritises and describes the impact of those gaps on the user.

Gap reports are brought to the attention of spec and browser implementers, and are tracked via the Gap Analysis Pipeline. (Filter it for Devanagari)

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 document 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 Devanagari 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 the Devanagari script. See a list of unresolved questions for Indian script experts. Each section below points to related discussions. See also the repository home page.

2. Devanagari Script Overview

The Devanagari script is an abugida. Consonant letters have an inherent vowel sound. Combining vowel signs are attached to the consonant to indicate that a different vowel follows the consonant.

Devanagari text runs left-to-right in horizontal lines. Words are separated by spaces. There is no case distinction.

Orthographic syllables (as opposed to phonetic syllables) play a significant role in Devanagari. An orthographic syllable starts at the beginning of any cluster of consonants and incorporates the whole cluster plus any following vowels and diacritics. A phonetic syllable may begin and end within a consonant conjunct.

Languages written with the Devanagari script often have aspirated forms of stops and a set of retroflex consonants. These are all represented separately in the orthography.

Consonant letters may be supplemented by repertoire extensions for non-native sounds by applying the nukta diacritic to characters.

Consonant clusters at any location are normally indicated using the virama between consonants. This results in a large number of conjunct forms expressed using half-forms, stacked consonants, and ligated glyphs. Occasionally, a visible virama is used. As part of a cluster, RA typically has special forms.

Word-final consonant sounds may be represented by dedicated combining marks (anusvara & visarga), but are generally ordinary consonants that are not marked by a virama. An elided inherent vowel is not always marked. In Hindi, the inherent vowel of a penultimate consonant in a word of 3 syllables that ends in a non-inherent vowel is usually elided, and not marked as such.

Standalone vowel sounds are typically written using independent vowels, one for each vowel sound, including the inherent vowel.

Vowel nasalisation is typically indicated using a diacritic.

There is a set of native number digits. Punctuation is mostly ASCII, but dandas may be used for phrase boundaries.

The Unicode Devanagari block contains more characters than other indic scripts, partly because it serves as a pivot script for transliterations of other scripts.

3. All topics

4. Text direction

Text is normally written horizontally, left to right.

4.1 Vertical text

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

6.2.1 Grapheme boundaries

The basic unit for working with Devanagari text is the orthographic syllable, ie. one consonant or a sequence of consonants with halant between, plus optional additional combining characters (such as vowel-signs).

In Devanagari an orthographic syllable that forms a conjunct should be treated as an indivisible unit of text for most editing operations. Figure 1 shows a Devanagari word with a conjunct at the end, and the expected segmentation.

हिन्दी  →  हि+न्दी

Figure 1 Expected minimal units (right) during segmentation of the word हिन्‌दी hindī.

If, however, a conjunct is not formed and the halant is visible, the first consonant plus halant would be treated as separate from the second consonant, and the vowel-sign would appear to the left of the second consonant (see Figure 2).

हिन्‌दी  →  हि+न्‌+‌दी

Figure 2 Expected segmentation of the word हिन्दी hindī when there is no conjunct.

Note that in Devanagari an orthographic syllable may be longer than a Unicode grapheme cluster, if it forms a conjunct. Figure 3 shows a Devanagari word with a conjunct at the end, and the segmentation that would result from applying Unicode grapheme clusters only.

हिन्‌दी  → हि+न्‌+‌दी

Figure 3 Segmentation of the word हिन्दी hindī with a conjunct when using Unicode grapheme clusters.

For Devanagari, applications need to provide tailored extensions to correctly segment the text. Such tailoring needs to be able to distinguish between sequences that are displayed as conjuncts, and those where the halant is visible.

6.2.2 Word boundaries

Words are separated by spaces.

Devanagari has hyphenated words – mainly conjoined nouns, eg. लाभ-हानि lābʰ-hāni profit-loss, and माता-पिता mātā-pitā parents. i

7. Punctuation & inline features

7.1 Phrase & section boundaries

7.1.1 Phrase boundaries: Danda & double danda

U+0964 DEVANAGARI DANDA, is used for sentence final punctuation.

There are two alternative approaches to the use of spaces with danda:

  1. No space character appears between the end of the phrase and the danda glyph, but the advance width of the danda in a font should open a small gap before it. The danda is then typically followed by a single space.
  2. A space is allowed before and after the danda in order to balance the space before and after it. In this case, the danda must still be kept from wrapping to a new line on its own; it should wrap with the previous word and space together.

These same principles apply to U+0965 DEVANAGARI DOUBLE DANDA.

The double danda should be written using the dedicated Unicode character, and not by combining two single dandas.

The double danda is sometimes used to set apart section or verse numbering, in which the number is placed between pairs of double dandas. To obtain the correct spacing, the character sequence is usually <double danda, space, numeral(s), double danda>.

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

Underlining is not traditional feature of Devanagari text

8. Line & paragraph layout

8.1 Line breaking & hyphenation

The primary break opportunities for line breaking are at inter-word spaces.

If a line is broken inside a word, any consonant clusters should be kept intact unless they are separated by visible halant characters.

Line breaking should not move a danda or double danda to the beginning of a new line, even if they are preceded by a space character. These punctuation characters should behave in the same way as a full stop does in English text.

8.2 Text alignment & justification

8.3 Text spacing

8.4 Baselines, line height, etc.

8.5 Lists, counters, etc.

8.6 Styling initials

9. Page & book layout

tbd