HarfBuzz 8.0 Released - Introduces Shaper For WebAssembly Within Font Files

Written by Michael Larabel in Desktop on 9 July 2023 at 05:57 AM EDT. 28 Comments
DESKTOP
HarfBuzz 8.0 was released on Saturday as the newest feature release for this text shaping library used by many open-source software projects from GUI toolkits to desktop environments and other prominent applications.

It's just been a few months since HarfBuzz 7.0 was released while HarfBuzz 8.0 has debuted this weekend with more exciting changes. HarfBuzz 8.0 introduces a new, experimental WebAssembly "WASM" shaper that yields more flexibility for OpenType/AAT/Graphite shaping via allowing WASM to be embedded inside the font file.

HarfBuzz's new documentation around this WebAssembly shaper explains:
If the standard OpenType shaping engine doesn't give you enough flexibility, Harfbuzz allows you to write your own shaping engine in WebAssembly and embed it into your font! Any font which contains a Wasm table will be passed to the WebAssembly shaper.
...
The Harfbuzz shaping engine, unlike its counterparts CoreText and DirectWrite, is only responsible for a small part of the text rendering process. Specifically, Harfbuzz is purely responsible for shaping; although Harfbuzz does have APIs for accessing glyph outlines, typically other libraries in the free software text rendering stack are responsible for text segmentation into runs, outline scaling and rasterizing, setting text on lines, and so on.

Harfbuzz is therefore restricted to turning a buffer of codepoints for a segmented run of the same script, language, font, and variation settings, into glyphs and positioning them. This is also all that you can do with the WASM shaper; you can influence the process of mapping a string of characters into an array of glyphs, you can determine how those glyphs are positioned and their advance widths, but you cannot manipulate outlines, variations, line breaks, or affect text layout between texts of different font, variation, language, script or OpenType feature selection.

HarfBuzz 8.0 also adds subsetting support for beyond-64k / VarComposites fonts, new APIs, and a variety of performance optimizations. The HarfBuzz 8.0 release notes detail "many big speed optimizations" including up to 89% faster performance for loading variable fonts for shaping, up to 88% faster in small subset of large fonts, over 50% faster in loading the Roboto font for shaping, and many other double digit percentage speed-ups.

HarfBuzz logo


Downloads and more details on the HarfBuzz 8.0 release via GitHub.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week