X Tutup
Skip to content

Refactor RendererAgg.draw_{mathtext,text,tex} to use same base algorithm#31085

Merged
QuLogic merged 4 commits intomatplotlib:text-overhaulfrom
QuLogic:render-glyphs
Feb 6, 2026
Merged

Refactor RendererAgg.draw_{mathtext,text,tex} to use same base algorithm#31085
QuLogic merged 4 commits intomatplotlib:text-overhaulfrom
QuLogic:render-glyphs

Conversation

@QuLogic
Copy link
Member

@QuLogic QuLogic commented Feb 5, 2026

PR summary

I pulled this out of #30725 because it was independent of that, and was the cause of the image changes there, so it might be easier to review this as a separate change. The test image changes are rather subtle effects on the edges of rotated text, and probably nothing to worry about.

PR checklist

@QuLogic QuLogic added this to the v3.11.0 milestone Feb 5, 2026
@github-project-automation github-project-automation bot moved this to Waiting for other PR in Font and text overhaul Feb 5, 2026
@QuLogic QuLogic moved this from Waiting for other PR to Ready for Review in Font and text overhaul Feb 5, 2026
@QuLogic QuLogic changed the title Refactor RendererAgg.{draw_mathtext,draw_text} to use same glyph drawing algorithm Refactor RendererAgg.draw_{mathtext,text} to use same glyph drawing algorithm Feb 5, 2026
@QuLogic
Copy link
Member Author

QuLogic commented Feb 5, 2026

Note, I have prepared a refactor including #30039 if you want to wait before/after that is merged.

@anntzer
Copy link
Contributor

anntzer commented Feb 5, 2026

Actually, let's get #30039 in first, given that you already did the necessary work to build on top of it; thanks!

@QuLogic QuLogic changed the title Refactor RendererAgg.draw_{mathtext,text} to use same glyph drawing algorithm Refactor RendererAgg.draw_{mathtext,text,tex} to use same base algorithm Feb 6, 2026
@QuLogic
Copy link
Member Author

QuLogic commented Feb 6, 2026

Now rebased to include the changes to draw_tex since #30039 went in. The test image changes are the same as before, since they were due to the first commit here. I'll leave this until tomorrow just in case there's anything you want to re-review here.

This makes it more similar to `draw_mathtext`, and is necessary for
colour fonts, where the previously-cached bitmap would have been
downgraded to black&white strokes by FreeType when copied. It should
also reduce the necessary code paths with the other text drawing methods
as well.
All the glyph drawing loop is the same, other than a flexible size in
the former.
All the glyph drawing loop is the same, other than a slight transform
difference with slant/extend in the former.
@QuLogic QuLogic merged commit c1d3c87 into matplotlib:text-overhaul Feb 6, 2026
35 of 37 checks passed
@QuLogic QuLogic deleted the render-glyphs branch February 6, 2026 22:26
@github-project-automation github-project-automation bot moved this from Ready for Review to Done in Font and text overhaul Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants

X Tutup