pdf/ps: Track full character map in CharacterTracker#30566
pdf/ps: Track full character map in CharacterTracker#30566tacaswell merged 1 commit intomatplotlib:text-overhaulfrom
Conversation
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)) |
There was a problem hiding this comment.
do we need to loop and add all the partitions?
There was a problem hiding this comment.
Ah, this looks like more prep work as I see we never set subset size.
|
"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 \ |
There was a problem hiding this comment.
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.
|
I am a bit confused by the sub-setting logic. I think I've lost track of "is implemented" vs "will be implemented". |
|
We understand both the macos 13 and mypy failures as unrelated. |
Yes, I'll merge |
pdf/ps: Track full character map in CharacterTracker
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