2025Q3 Fonts Quarterly

behdad
October 15, 2025

I spent most of this quarter on improving HarfRust performance and correctness, to the extent that it is production-ready, as well as misc. work:

CFF2ToCFF improvements

Instancing avar2 fonts and other tooling

Roboto Delta performance tuning

Released Variable Composites / Components (VARC table)

HarfBuzz AMA

HarfBust: a font software puzzle for the curious

HarfBuzz miscellaneous speedups

HarfRust shaping speedups

Acknowledgements

CFF2ToCFF improvements

A while back I wrote two modules in FontTools, to convert between CFF2 and CFF fonts. The code was quite brittle and failed in many cases. So I spent some time bringing the CFF2ToCFF converter into better shape. The converter can be invoked using fonttools cffLib.CFF2ToCFF. The FontTools instancer can also invoke the converter when instantiating CFF2 fonts, if called with --downgrade-cff2. (PR)

Instancing avar2 fonts and other tooling

The avar2 technology allows for variation axes to affect each other during the normalization phase, before actual variations are applied. This allows schemes like parametric axes or higher-order interpolation to be used in the variable font design, reducing total number of masters and font file size.

Because the avar2 mapping mechanism is generic, it is hard to reason about and modify it. This complicates partial instancing (reducing and changing the variable design space) of a binary font, and I am still trying to get my head around how to do that. However, many use-cases just need to be able to instantiate an avar2 font into static fonts. So I implemented that.

I also added a few tools to help font designers design their avar2 mappings (that go in the .designspace file), in the fonttools varLib.avar module / command prefix.

Roboto Delta performance tuning

Roboto Delta is one of the leading avar2 font experiments. The font was designed to have an slnt axis that conditionally swapped glyphs with their slanted versions. Measurement showed that this slowed the font, compared to two separate variable fonts, one for upright and one for slant. As a result, the family is to be split in two.

Released Variable Composites / Components (VARC table)

HarfBuzz 12.0.0 graduated the VARC technology from experimental to enabled by default. Details.

HarfBuzz AMA

Motivated to put together a HarfBuzz FAQ, we did a Reddit ask me anything post, which gathered tens of comments. In response to one of the questions, I wrote down key moments in HarfBuzz’s development & adoption over the past 20 years, as well as the biggest WTF moment of all.

HarfBust: a font software puzzle for the curious

To explore how various shaping engines differ in handling of corrupt font tables, I put together a puzzle called HarfBust. See for yourself here. So far no one has cracked it in full. I am offering a HarfBuzz hoodie to anyone who offers a full explanation. I will release the solution in a few weeks time.

HarfBuzz miscellaneous speedups

HarfRust shaping speedups

When we announced HarfRust last quarter, it came with the caveat that HarfRust was 2x to 4x slower than HarfBuzz on a variety of benchmarks. This quarter, I spent time addressing that issue, by porting various optimizations and caches from HarfBuzz to HarfRust.

To start, I wrote down a summary of various OpenType and AAT caching schemes in HarfBuzz:

I also wrote down how to test HarfRust correctness & performance using the HarfBuzz test / perf suites.

Then I ported those caches and algorithms to HarfRust one by one. To keep track of progress, I put together a spreadsheet of speedup over time for a few benchmarks: HarfRust performance dashboard (2025):

This brought down the HarfRust performance down to less than 25% slower than HarfBuzz. Some of the remaining differences, especially for the fastest benchmarks like Roboto, are the overhead of the hb-harfrust integration layer (about 6% in this case), which are not captured in the chart above.

When all the porting of HB’s optimizations to HR was done, I looked into more optimization opportunities in HR, which almost always resulted in a corresponding optimization in HB as well.

For the following reasons, it is unlikely that HR performance can ever exceed HB performance:

If HR is inherently slower than HB, that will be problematic for porting Chrome to HR, since Chrome has a general no-slowdown policy. This made me curious about HarfBuzz’s performance improvements that I have performed over the last few years, so I put together a chart of the HarfBuzz performance dashboard to track speedups of four benchmarks, over the past four years:

As we can see, HarfBuzz shaping has become more than 3x faster for Roboto (default Latin font on Android) over the past four years, which is quite impressive for an implementation that has been around for over 18 years!

So my argument is that shaping in HarfBuzz is so fast, that we should afford a little regression in speed in exchange for the safety benefits of the Rust language.

Acknowledgements

I like to thank Google Fonts for financially supporting my work. I am grateful for the help of Chad Brokaw, handholding me while I pretended to know Rust.