GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Remove forced fallback from FT2Font::load_char by QuLogic · Pull Request #30627 · matplotlib/matplotlib

Conversation

@QuLogic

@QuLogic QuLogic commented Oct 3, 2025

Copy link
Copy Markdown
Member

PR summary

The only thing that expected this to work is Type 3 fonts in the PDF backend, but only to avoid an error when loading a range of characters (not all of which would be used.) This would introduce an odd behaviour in that load_char could never fail even if the glyph never existed. You would instead end up with the null glyph from the last font.

As of #30512, Type 3 fonts use load_glyph instead of load_char, with a glyph that we know exists (because it's from the limited subset character map we've created), or 0 for the null glyph. Thus no fallback is needed, and we can instead warn if not found, as the code seems to have originally intended.

PR checklist

  • [n/a] "closes #0000" is in the body of the PR description to link the related issue
  • new and changed code is tested
  • [n/a] Plotting related features are demonstrated in an example
  • [n/a] New Features and API Changes are noted with a directive and release note
  • [n/a] Documentation complies with general and docstring guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@QuLogic QuLogic added this to the v3.11.0 milestone Oct 3, 2025
@QuLogic QuLogic added this to Font and text overhaul Oct 3, 2025
@QuLogic QuLogic added the Maintenance label Oct 3, 2025
@github-project-automation github-project-automation Bot moved this to Waiting for other PR in Font and text overhaul Oct 3, 2025
@QuLogic QuLogic moved this from Waiting for other PR to Ready for Review in Font and text overhaul Oct 3, 2025
@github-actions github-actions Bot added the topic: text/fonts label Oct 3, 2025
@QuLogic
Remove forced fallback from FT2Font::load_char
a47bd3f
The only thing that expected this to work is Type 3 fonts in the PDF
backend, but only to avoid an error when loading a range of characters
(not all of which would be used.) This would introduce an odd behaviour
in that `load_char` could never fail even if the glyph never existed.
You would instead end up with the `null` glyph from the last font.
@QuLogic
QuLogic force-pushed the no-force-fallback branch from 39c8238 to a47bd3f Compare October 23, 2025 08:34
@QuLogic QuLogic added the status: needs review label Oct 24, 2025
tacaswell
tacaswell approved these changes Nov 6, 2025
View reviewed changes
ksunden
ksunden approved these changes Nov 6, 2025
View reviewed changes
@tacaswell
tacaswell merged commit ad0b47a into matplotlib:text-overhaul Nov 6, 2025
3 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-project-automation github-project-automation Bot moved this from Ready for Review to Done in Font and text overhaul Nov 6, 2025
@QuLogic
QuLogic deleted the no-force-fallback branch November 20, 2025 20:42
wavebyrd pushed a commit to wavebyrd/matplotlib that referenced this pull request Mar 13, 2026
@tacaswell
Merge pull request matplotlib#30627 from QuLogic/no-force-fallback
4c67f7a
Remove forced fallback from FT2Font::load_char
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tacaswell tacaswell tacaswell approved these changes
@ksunden ksunden ksunden approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

Maintenance status: needs review topic: text/fonts

Projects

Font and text overhaul
Status: Done

Milestone

v3.11.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@QuLogic @tacaswell @ksunden
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.