A story of Devanagari script
How the world’s fourth major writing system came from the 3rd century BCE to your desktop
Since version 7.2 ONLYOFFICE Docs has HarfBuzz library integrated in its font engine, which enables the use of ligatures — font elements present in many writing systems, such as Bengali, Sinhala, Devanagari, and others.
In this article, we are diving deeper into the evolution of ligatures in writing, on the example of perhaps the most culturally prominent Indic script, Devanagari.
What is Devanagari
Devanagari, sometimes also called Nagari, is a left-to-right writing system used in over 120 languages, including, for instance, Hindi, Marathi, Sanskrit, Nepali, and Sherpa. It is most commonly used in languages of India, Fiji, South Africa, and Nepal and is the fourth most widely adopted writing system worldwide, after Latin, Chinese, and Arabic.
The script belongs to a type called abugida, where the writing is segmental and based on consonant-vowel pairings. At the same time, in both written and digital texts in Devanagari the word bodies themselves are built using ligatures.
A brief history of the script
Devanagari takes its roots in Brahmi script that existed in the 3rd century BCE. Its evolutionary predecessor is Nagari which also gave birth to Nandinagari. Among the discovered pieces of text in Nagari script, the earliest belongs to the 1st to 4th century CE and has been discovered in Gujarat, India.
The earliest evidence of using modern standardized Devanagari is presumed to exist by around 1000 CE. Some of related versions have also been discovered outside India — in Sri Lanka, Myanmar, and Indonesia.
As for the primary use, in the beginning, Devanagari has been used by religiously educated people for recording and exchange of information.
The appearance of the horizontal bar that constitutes the ligatures is thought to take place in 992 CE, with evidence found in the Kutila inscription of Bareilly. Kutila script contains an early version of Devanagari. Its evolution and use point at the common ancestry between Devanagari and Bengali-Asamese, both of which also use ligatures to compose words.
Composition of letters and words
The order of letters in Devanagari is based on phonetic principles. It considers the manner and the place of articulation of the associated consonants and vowels, therefore it is easy to understand how a spoken word is written, and how to pronounce a written one.
Letters in Devanagari usually form syllables with conjunct letters composed of two or more original letters. For example, the word “Devanagari” is written in the following way:
Symbols used to write consonants in their original form represent a consonant sound and a vowel “a”. Extra elements are added to the ligatures to express other sounds. Extra elements are used not only for vowel sounds, but also for consonant sounds to determine how they must be pronounced in a particular word.
The words in Devanagari are written using ligatures, forming a continuous “garland” of letters:
Fonts used for typing in Devanagari
Devanagari is supported by several coding schemes, including Indian Script Code for Information Interchange (ISCII) and Unicode.
Typing in Devanagari is possible with multiple Unicode typefaces that also support ligatures. Here are some of them:
- Akshar
- Annapuma
- Arial
- CDAC-Gist Surekh
- CDAC-Gist
- Yogesh
- Chandas
- Gargi
- Gurumaa
- Jaipur
- Jana
- Kalimati
- Kanjirowa
- Lohit Devanagari
- Mangal
- Kokila
- Raghu
- Sanskrit2003
- Santipur OT
- Siddhanta
- Thyaka
There’s a standard keyboard layout created for Devanagari and 12 other scripts used in Indian languages called InScript. The keyboard was developed and standardized by the government of India initially for ISCII standard, and adapted for Unicode.
Using Devanagari in ONLYOFFICE Docs
Starting from version 7.2, a font engine in ONLYOFFICE Docs was updated to support ligatures and therefore all Left-To-Right writing systems that use them including Devanagari, Bengali, Sinhala, Tibetan, Burmese, and many others.
The existing algorithms couldn’t provide full support for all mechanics of text rendering present in the Unicode writing systems. When it comes to letter conjunctions, rendering those letters was possible if there was a Unicode symbol present in the library for each separate letter and the resulting glyph. However, if rendering of the letter associated with a single Unicode parameter depends on its position in a word, like in Arabic, a challenge lies in building of such clusters, as the Unicode navigation alone is not enough.
The solution was found in the integration of the HarfBuzz in ONLYOFFICE Docs 7.2, a library for text shaping that helps convert Unicode to glyph indices and positions in fonts developed using OpenType and other technologies.
It allowed us to enable the shaper necessary for supporting features of multiple writing systems, including text clustering and ligatures. It was built in both the font engine of ONLYOFFICE Docs and the native mobile applications.
Introduction of ligatures is also a big step towards enabling Right-To-Left writing systems like Arabic in ONLYOFFICE. As the developer team says, “80% of work towards RTL is done”.
Summary
Input and rendering of digital text in applications doesn’t always consist of navigation around Unicode alone, as it does not comprehend all the methods of text shaping in all writing systems.
Some of them, like Devanagari script used for writing in multiple Indic languages, do not only include systems of glyphs associated with sounds or words. Devanagari script also implies dependencies between those elements and assumes certain rules for rendering the letters and words.
These require additional scrutiny and integration of libraries to support features such as text clustering and ligatures, as well as use of specific fonts.
Since version 7.2 of ONLYOFFICE Docs, input in Devanagari and other Left-To-Right systems containing such mechanics is possible with integration of HarfBuzz and introduction of these new methods of text shaping.