Sorry, you need to enable JavaScript to visit this website.


Chromium is an ‘upstream’ open source browser and web engine project that contributes significantly to the growing Chrome ecosystem. Chromium’s code is utilized in important products and other open source projects including the Chrome browser, Chrome OS, Android Open Source Platform, the rendering engine Blink and the web app run-time project Crosswalk.

Intel OTC hosted Google engineers for coding camp on Non-Latin Text Improvements in Blink

BY 01 Staff (not verified) ON Oct 03, 2014

As we announced in the previous blog post, Intel OTC Finland hosted a coding camp focused on hacking Blink's font subsystem from 23.9. until 26.9.2014. The OTC Finland web technologies team was very happy to welcome Emil A. Eklund and Behdad Esfahbod for a 4 day hacking session where great progress was made in the following areas.

A Single Shaper on All Platforms

Our long-term goal is to unify the two font code paths in Blink, the so called simple and complex paths. One of the obstacles on the path to this unification was that on the Mac platform, Blink was still using CoreText as a shaper. A shaper is a library that processes text for correct glyph selection and placement. Usually, non-Latin languages such as Indic ones, Khmer or Arabic require shaping to be legible. HarfBuzz is an open source library that serves this purpose.

In Blink, unifying the text code path and further performance improvements were blocked by moving Mac to HarfBuzz, same as Emil previously enabled HarfBuzz on Windows.

In our coding camp, we worked together to finally land my patch on switching Mac to HarfBuzz as well, which marks the conclusion of a multi-year migration process, away from system libraries for shaping, towards a common shaping library as part of Blink, used on all platforms. A couple of shaping related rendering issues were fixed in the process.

The advantages of a common shaping library are: consistent rendering results across platforms, the same API towards the shaper on all platforms, control over the shaping process and being able to fix bugs in it without waiting for an operating system upgrade from the OS vendor, and the possibility of performance improvements by optimizing the full stack.

Cleanup in the Font Subsystem

Now that the shaper was the same on all platforms, we were able to further merge Mac specific code with code that was previously already used on other platforms. This means less platform specific code which means that future improvements to the font and layout subsystem will benefit all Chrome platforms at the same time.

Refactored GlyphBuffer

We took advantage of the common shaper across platforms by doing a first refactoring. GlyphBuffer is the data structure that receives information about glyph advances and offsets from the SimpleShaper or HarfBuzzShaper. Emil refactored the GlyphBuffer so that we could remove previous inconsistencies in the code base and simplify glyph drawing, a step long overdue. It vastly improves readability and allows us to maintain the code much more easily.


Improved Vertical Text support

In our cleanup spree, we also went ahead and worked on replacing the legacy "opentype vertical" implementation by using HarfBuzz. This is one important step in moving towards a unified font code path. Previously, vertical text was processed by the simple path, at the maintenance cost of about 300 lines of redundant code in OpenTypeVertical.cpp. Also, this change fixes issues with CSS3 text-orientation in vertical layout. After the patch lands, these issues will be fixed.

Figuring out the vertical origin and ideographic baseline :-)

Helsinki nightlife, a productive workshop and exciting next steps

After full days of coding and reasoning about the intricacies of glyph drawing, we headed from Intel's Espoo office to downtown Helsinki for food, local beers and drinks and some Northern socialising. We all concluded it was a week of great progress and team work, well worth repeating. We continue to aim for unifiying the simple and complex code path, and further reap the benefits of now having a common shaper. Again I'd like to thank Emil and Behdad for travelling here and look forward to our next workshop.


Dominik Röttsches, Software Engineer in Intel OTC Finland, Twitter: @abrax5


Creative Commons License
Performance Improvements in Chrome's Non-Latin Text Rendering is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.