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 — pdf: Simplify Type 3 font character encoding by QuLogic · Pull Request #30520 · matplotlib/matplotlib

Conversation

@QuLogic

@QuLogic QuLogic commented Sep 6, 2025

Copy link
Copy Markdown
Member

PR summary

For a Type 3 font, its encoding is entirely defined by its Encoding dictionary (which we create), so there's no reason to use a specific encoding like cp1252. Instead, switch to Latin-1, which corresponds exactly to the first 256 character codes in Unicode, and can be mapped directly with ord.

Split out of #30512.

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
pdf: Simplify Type 3 font character encoding
258de53
For a Type 3 font, its encoding is entirely defined by its `Encoding`
dictionary (which we create), so there's no reason to use a specific
encoding like `cp1252`. Instead, switch to Latin-1, which corresponds
exactly to the first 256 character codes in Unicode, and can be mapped
directly with `ord`.
@QuLogic QuLogic added this to the v3.11.0 milestone Sep 6, 2025
@QuLogic QuLogic added the backend: pdf label Sep 6, 2025
@QuLogic QuLogic added this to Font and text overhaul Sep 6, 2025
@github-project-automation github-project-automation Bot moved this to Waiting for other PR in Font and text overhaul Sep 6, 2025
@QuLogic QuLogic mentioned this pull request Sep 6, 2025
pdf: Improve text with characters outside embedded font limits #30512
Merged
4 tasks done
@QuLogic QuLogic moved this from Waiting for other PR to Ready for Review in Font and text overhaul Sep 6, 2025
anntzer
anntzer approved these changes Sep 8, 2025
View reviewed changes
timhoffm
timhoffm approved these changes Sep 8, 2025
View reviewed changes
@QuLogic
QuLogic merged commit bb37cf9 into matplotlib:text-overhaul Sep 8, 2025
@github-project-automation github-project-automation Bot moved this from Ready for Review to Done in Font and text overhaul Sep 8, 2025
@QuLogic
QuLogic deleted the pdf-simplify-type3 branch September 8, 2025 20:26
wavebyrd pushed a commit to wavebyrd/matplotlib that referenced this pull request Mar 13, 2026
@QuLogic
Merge pull request matplotlib#30520 from QuLogic/pdf-simplify-type3
e40e731
pdf: Simplify Type 3 font character encoding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@anntzer anntzer anntzer approved these changes
@timhoffm timhoffm timhoffm approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

backend: pdf

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 @anntzer @timhoffm
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 01402503 — 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.