Support for Brahmic scripts in OpenType font rendering
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:
- Buginese, Javanese, Sinhala, and Tibetan were implemented in different ways before the introduction of the USE, and migrated in different ways afterwards. See the notes on the individual rendering systems below.
- Some shaping systems let fonts for the main Indic scripts elect to be processed by the Universal Shaping Engine by using “Indic 3” script tags: Bengali (bng3), Devanagari (dev3), Gujarati (gjr3), Gurmukhi (gur3), Kannada (knd3), Malayalam (mlm3), Oriya (ory3), Tamil (tml3), Telugu (tel3).
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:
- HarfBuzz 1.0.0 (July 2015): Unicode 8.0
- HarfBuzz 1.3.0 (July 2016): Unicode 9.0
- HarfBuzz 1.6.0 (October 2017): Unicode 10.0
- HarfBuzz 1.8.0 (June 2018): Unicode 11.0
- HarfBuzz 2.4.0 (March 2019): Unicode 12.0
The Android Open Source Project uses snapshots of HarfBuzz as shown below. Licensees are not required to use the same versions.
- Android 4.3/4.4: HarfBuzz 0.9.14 with shaping engines up to Myanmar (mym2)
- Android 5.0/5.1: HarfBuzz 0.9.33 with Javanese and Buginese shaping engines
- Android 6.0: HarfBuzz 0.9.38
- Android 7.0/7.1: HarfBuzz 1.2.6 with Universal Shaping Engine, Unicode 8.0
- Android 8.0/8.1: HarfBuzz 1.4.2, Unicode 9.0
- Android 9.0: HarfBuzz 1.7.4, Unicode 10.0
- Android 10.0: HarfBuzz 2.3.0, Unicode 11.0
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:
- macOS 10.12 and iOS 10: Unicode 8.0
- macOS 10.13 and iOS 11: Unicode 9.0
- macOS 10.14 and iOS 12: Unicode 11.0
- macOS 10.15 and iOS 13: Unicode 12.1
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.
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.
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.
- Microsoft Typography: OpenType specification. Version 1.8.3, 2018.
- Microsoft Typography: OpenType shaping engine descriptions for Brahmic scripts: Bengali, Devanagari, Gujarati, Gurmukhi, Kannada, Khmer, Lao, Malayalam, Myanmar, Oriya, Tamil, Telugu, Thai, Universal.
- Apple Inc.: TrueType Reference Manual. For AAT shaping, see in particular the morx, kerx, and ankr tables.
- SIL International: Graphite.
Asian language support for Adobe Creative Cloud apps:
- Adobe: Adobe Illustrator User Guide: Composers for Asian scripts. 2018.
- Adobe: Adobe InDesign User Guide: South-East Asian Scripts. 2019.
- Adobe: Adobe Photoshop User Guide: Composer for Asian Scripts. 2018.