Skip to content

Commit b9c87f1

Browse files
jkseppanQuLogic
andcommitted
Type-1 subsetting
This reduces pdf file sizes when usetex is active, at the cost of some complexity in the code. We implement a charstring bytecode interpreter to keep track of subroutine calls in font programs. Give dviread.DviFont a fake filename attribute and a get_fontmap method for character tracking. In backend_pdf.py, refactor _get_subsetted_psname so it calls a method _get_subset_prefix, and reuse that to create tags for Type-1 fonts. Mark the methods static since they don't use anything from the instance. Recommend merging to main to give people time to test this, not to a 3.10 point release. Closes matplotlib#127. Co-Authored-By: Elliott Sales de Andrade <[email protected]>
1 parent 6db18d5 commit b9c87f1

10 files changed

Lines changed: 533 additions & 43 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Type 1 fonts are now subsetted in PDF output
2+
--------------------------------------------
3+
4+
When using the usetex feature with the PDF backend, Type 1 fonts are embedded
5+
in the PDF output. These fonts used to be embedded in full, but they are now
6+
subsetted to only include the glyphs that are actually used in the figure.

0 commit comments

Comments
 (0)