Skip to content

pdf: Simplify Type 3 font character encoding#30520

Merged
QuLogic merged 1 commit intomatplotlib:text-overhaulfrom
QuLogic:pdf-simplify-type3
Sep 8, 2025
Merged

pdf: Simplify Type 3 font character encoding#30520
QuLogic merged 1 commit intomatplotlib:text-overhaulfrom
QuLogic:pdf-simplify-type3

Conversation

@QuLogic
Copy link
Copy Markdown
Member

@QuLogic QuLogic commented Sep 6, 2025

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

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
@github-project-automation github-project-automation bot moved this to Waiting for other PR in Font and text overhaul Sep 6, 2025
@QuLogic QuLogic moved this from Waiting for other PR to Ready for Review in Font and text overhaul Sep 6, 2025
@QuLogic QuLogic merged commit bb37cf9 into matplotlib:text-overhaul Sep 8, 2025
39 checks passed
@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
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

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants