SourceForge logo
SourceForge logo
Menu

[matplotlib-devel] TTF subsetting in PDF

From: Michael D. <md...@st...> - 2007年07月10日 15:17:41
I just committed changes that add TTF subsetting to the PDF backend. It 
is completely analogous to the font subsetting recently added to the PS 
backend.
I have added a configuration option, pdf.fonttype, to choose either 
"Type3" or "Truetype" font output. This may be removed in the future 
once the "Type3" stuff has been sufficiently tested.
Some results:
fonts_demo_kw.py: 201744 -> 37326
mathtext_demo.py: 129306 -> 26179
unicode_demo.py: 45303 -> 20084
over all demos in backend_driver.py: 5856001 -> 3390460
The differences aren't as dramatic as with Postscript, but IMHO they are 
still large enough to be worthwhile.
Again, please help by testing with your own favorite PDF tools.
Gory details about composite characters follow -->
In this new code, composite characters (such as a character composed of 
a letter and an accent) aren't handled as they should be. According to 
the PDF spec, a PDF-1.2 (Acrobat 3.x) Type 3 font can reference other 
glyphs with the "Do" command, to avoid duplicating the components of a 
composite glyph. I was able to get this to work with Acrobat 7, but 
xpdf-3.0 and ggv 2.8.0 both choked on the file. Therefore, I decided to 
err on the side of compatibility by including each component of a 
composite character inline where it is used. This makes the PDF files 
larger than they would otherwise have to be. However, it should only be 
a real problem if a plot contains an inordinate amount of different 
accented characters.
Cheers,
Mike

View entire thread

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /