Skip to content

Conversation

@QuLogic
Copy link
Member

@QuLogic QuLogic commented Jan 7, 2026

PR summary

These were released over the last couple of months but I didn't notice them. Note, I have included the new test images here, but this should not be merged until they are removed.

The main changes in HarfBuzz do appear to mostly be speedups and optimizations. Version 12 adds support for the new VARC table, but I don't think that's particularly widespread yet. There are various other bug fixes and rejections of invalid fonts in the smaller releases as well. The other useful change is that they've simplified the search for FreeType, so we can drop our patch for it.

The main change in FreeType is an improvement in the diacritics at small sizes. This is the cause of the mathtext test image changes.

Additionally, FreeType changed the way they use HarfBuzz (yes, there's a dependency loop there) that doesn't require the headers, which makes it possible to enable support. They do support dynamically loading HarfBuzz, but I don't want to run into issues loading the wrong library, so instead I've added a small patch that allows enabling support without explicitly linking HarfBuzz to FreeType. Then the ft2font extension library links to both and this resolves all symbols. Enabling HarfBuzz support improves auto-hinting in OpenType fonts. This causes the change in the Last Resort test image since that is an OpenType font.

To compare the test images on this PR with the current state of the text-overhaul branch, you can use this link https://github.com/QuLogic/matplotlib/compare/text-overhaul-figures..ft214 but unfortunately it also shows all the other images, so you need to look at the few images from this PR specifically.

PR checklist

Due to the circular dependency between FreeType and HarfBuzz, this
requires a small patch to make FreeType not look for HarfBuzz, allowing
it to come from the superproject linkage. While FreeType does support
dynamically loading HarfBuzz, this should be a bit safer at avoiding any
chance of mixing system with bundled libraries.
@QuLogic QuLogic added this to the v3.11.0 milestone Jan 7, 2026
@github-project-automation github-project-automation bot moved this to Waiting for other PR in Font and text overhaul Jan 7, 2026
@QuLogic QuLogic moved this from Waiting for other PR to In Progress in Font and text overhaul Jan 7, 2026
@QuLogic QuLogic moved this from In Progress to Done in Font and text overhaul Jan 7, 2026
@QuLogic QuLogic moved this from Done to Ready for Review in Font and text overhaul Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

2 participants