Lontar

Support for Brahmic scripts in OpenType font rendering

Norbert Lindenberg
November 17, 2019

Support for Brahmic scripts in OpenType font renderers can vary, not only between operating systems, but also between browsers and applications.

Rendering text in a Brahmic script requires transforming a linear sequence of Unicode characters into a two-dimensional arrangement of glyphs. This includes mapping the Unicode characters to an initial sequence of glyphs, reordering glyphs (for example, to move a vowel before its base consonant so it renders to the left), replacing glyph sequences with other sequences (for example, to form conjuncts or to select alternate glyphs depending on the context), and positioning the glyphs relative to each other. This process is called shaping. There are several mechanism that support shaping, including Apple Advanced Typography and Graphite, but OpenType shaping is the most widely supported.

Correct shaping with an OpenType-based font depends on the interaction of a rendering system with tables in the font. Some behaviors are implemented by the rendering system, some by the font, and some by the rendering system but under control of the font.

The interaction is documented in a number of shaping engine descriptions. Many of these are specific to one script, but the Universal Shaping Engine (USE, /juː ɛs iː/) attempts to support all scripts not supported by dedicated shaping engines (it is known to fail for the Tai Tham script). The relation between scripts and shaping engines is not entirely fixed:

Rendering systems and operating systems

DirectWrite, Uniscribe, and Windows

Uniscribe was Microsoft’s original OpenType rendering system; its name shows up in several of the OpenType shaping engine specifications. With Windows 7, Microsoft introduced the DirectWrite API as a successor to the Uniscribe API. Both APIs share a common shaping implementation. Recent additions to the set of supported shaping engines are Myanmar in Windows 8.0, Buginese and Javanese in Windows 8.1, and the Universal Shaping Engine in Windows 10. The introduction of the Universal Shaping Engine affected several of the other shaping engines: It obsoleted the Buginese, Javanese, Sinhala, and Tibetan shaping engines as well as several previously undocumented shaping engines, and it assumed the implementation of the GSUB presentation forms features and all GPOS features in Myanmar shaping.

The implementation of the USE in Windows 10 November 2019 Update has been updated based on Unicode 12.1.

HarfBuzz and Android

The open-source HarfBuzz shaping system is used in the Android operating system, in various Linux systems, as well as in numerous other software systems. The most recent additions to the set of supported shaping engines are Myanmar (mym2), available from HarfBuzz 0.9.13 (February 2013), Javanese and Buginese from HarfBuzz 0.9.23 (October 2013), and the Universal Shaping Engine from HarfBuzz 1.0.0 (July 2015). Javanese and Buginese switched to the USE in HarfBuzz 1.3.0 (July 2016). Tibetan switched from an earlier separate implementation to the USE in HarfBuzz 2.0.0 (October 2018). Sinhala is implemented by the Indic shaper. “Indic 3” script tags are supported from HarfBuzz 2.0.0 (October 2018).

Support for Unicode versions in the USE in HarfBuzz is as follows:

The Android Open Source Project uses snapshots of HarfBuzz as shown below. Licensees are not required to use the same versions.

CoreText and Apple operating systems

Apple’s CoreText rendering system is used in all of Apple’s platforms: macOS, iOS, iPadOS, watchOS, and tvOS. With the September 2016 platform releases, macOS 10.12, iOS 10, watchOS 3, and tvOS 10, CoreText added the Myanmar and Universal shaping engines. At the same time, it started supporting the “Indic 3” script tags. CoreText did not support Buginese, Javanese, Sinhala, or Tibetan shaping in OpenType before introducing the USE.

Support for Unicode versions in the USE in CoreText is as follows:

Lipika

Adobe’s Lipika shaping system provides the support for some scripts in some of their Creative Cloud applications. Among Brahmic scripts, Lipika supports only the main Indic scripts, and some of them only at the old level 1: Bengali (bng2), Devanagari (dev2), Gujarati (gujr), Gurmukhi (guru), Kannada (knd2), Malayalam (mlm2), Oriya (ory2), Tamil (tml2), Telugu (tel2).

Browsers and applications

Browsers and applications may embed their own shaping system, so that their behavior differs from the operating system that they run on.

Browsers

Web applications get OpenType shaping support either from a HarfBuzz library embedded in the browser or from the operating system. On iOS, all browsers have to use the WebKit framework and CoreText. Firefox (at least the builds provided by Mozilla) and Chrome on any platform other than iOS embed their own copies of HarfBuzz, so that web applications may get good shaping support even on some rather old operating system – for example, scripts supported by the USE work within these browsers even on old versions of Android that don’t provide the USE. Safari always uses the CoreText rendering system of the operating system. Edge on Windows has so far been based on EdgeHTML and the DirectWrite rendering system of Windows; with the transition to Chromium it is switching to embedding HarfBuzz.

Adobe Creative Cloud applications

The Adobe Creative Cloud applications InDesign, Illustrator, and Photoshop provide support for Brahmic scripts only if the user selects the right “Composer” or “Layout”: “World Ready Composer” in InDesign, “Middle Eastern & South Asian Composer” in Illustrator, and “Middle Eastern and South Asian Layout” in Photoshop. All three support the main scripts of India through the Lipika shaping system; Illustrator and Photoshop have since fall 2018, and InDesign since fall 2019, also supported Khmer, Lao, Myanmar, Sinhala, and Thai through HarfBuzz.

Acknowledgments

I’d like to thank Andrew Glass, Behdad Esfahbod, Dominik Röttsches, Jonathan Kew, Menasse Zaudou, Muthu Nedumaran, Myles Maxfield, Ned Holbrook, Seigo Nonaka, and several others for providing or reviewing the information in this article.

References

Shaping technologies:

Release histories:

Asian language support for Adobe Creative Cloud apps: