Skip to content

Disable loading of bitmap glyphs for raster outputs - #32631

Open
QuLogic wants to merge 1 commit into
matplotlib:mainfrom
QuLogic:no-bitmap-glyphs
Open

QuLogic wants to merge 1 commit into
matplotlib:mainfrom
QuLogic:no-bitmap-glyphs

Conversation

@QuLogic

@QuLogic QuLogic commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

PR summary

We don't yet support using them correctly, so they end up rendering as empty glyphs. For now, disable loading them so we always get the scalable glyph instead. As far as I can tell, vector outputs (i.e., those that call FT2Font.get_path() instead of using the image) are not affected by this problem.

I have tested this against SimSun.ttf with PNG, PDF, PS, and SVG output (the vector ones don't have the problem.) Our builtin fonts don't have any bitmap strikes, so I am working on producing one so that we can test this.

I have edited our builtin testing font with FontForge and added a bitmap strike at 25px (which is equal to 18pt @ 100dpi) On main, using that font produces:
Figure_1
whereas on this PR, there are no missing glyphs:
Figure_1a

Fixes #32063

AI Disclosure

None

PR quality check

  • Use an expressive title, e.g. "Fix title font property precedence"
  • New and changed code is tested
  • [n/a] Plotting related features are demonstrated in an example
  • [n/a] New features and API changes have release notes
  • [n/a] Documentation complies with general and docstring guidelines

We don't yet support using them correctly, so they end up rendering as
empty glyphs. For now, disable loading them so we always get the
scalable glyph instead. As far as I can tell, vector outputs (i.e.,
those that call `FT2Font.get_path()` instead of using the image) are not
affected by this problem.

Fixes matplotlib#32063
@QuLogic
QuLogic marked this pull request as ready for review December 4, 2026 20:10

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Font fallback bugs

1 participant