FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

pdf/ps: Track full character map in CharacterTracker by QuLogic · Pull Request #30566 · matplotlib/matplotlib · GitHub

Repository navigation

pdf/ps: Track full character map in CharacterTracker - #30566

Merged
tacaswell merged 1 commit into
matplotlib:text-overhaulfrom
QuLogic:full-charmap-tracking
Sep 17, 2025
Merged

tacaswell merged 1 commit into
matplotlib:text-overhaulfrom
QuLogic:full-charmap-tracking

Conversation

QuLogic commented Sep 16, 2025

Copy link
Copy Markdown
Member

PR summary

By tracking both character codes and glyph indices, we can handle producing multiple font subsets if needed by a file format.

This was split out of #30512, but based on #30335.

PR checklist

By tracking both character codes and glyph indices, we can handle
producing multiple font subsets if needed by a file format.
glyphs = self._character_tracker.used.get(filename)
if glyphs:
fonts[Fx] = self.embedTTF(filename, glyphs)
charmap = self._character_tracker.used.get((filename, 0))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

do we need to loop and add all the partitions?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Ah, this looks like more prep work as I see we never set subset size.

Copy link
Copy Markdown
Member

"power cycled" to drop the already merged commit from the diff.

if not mpl.rcParams['ps.useafm']:
for font_path, glyphs in ps_renderer._character_tracker.used.items():
if not glyphs:
for (font, subset_index), charmap in \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

but we do loop here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

PS is a little different from PDF in that it just dumps all the fonts in the CharacterTracker instance, while PDF has its own tracking of fonts, so it needs a bit more in-depth change (that continues on #30512.)

This change here doesn't modify any logic, but just changes the loop to work over the new structure of the .used attribute.

Copy link
Copy Markdown
Member

I am a bit confused by the sub-setting logic. I think I've lost track of "is implemented" vs "will be implemented".

Copy link
Copy Markdown
Member

We understand both the macos 13 and mypy failures as unrelated.

tacaswell merged commit 43d5d4e into matplotlib:text-overhaul Sep 17, 2025
55 of 62 checks passed
github-project-automation Bot moved this from In Progress to Done in Font and text overhaul Sep 17, 2025
QuLogic deleted the full-charmap-tracking branch September 17, 2025 01:37

QuLogic commented Sep 17, 2025

Copy link
Copy Markdown
Member Author

We understand both the macos 13 and mypy failures as unrelated.

Yes, I'll merge main after the macOS CI is fixed

wavebyrd pushed a commit to wavebyrd/matplotlib that referenced this pull request Mar 13, 2026
pdf/ps: Track full character map in CharacterTracker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL