Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
Bug summary
PDFs containing math fonts cause the following error message in Adobe Acrobat:Cannot extract the embedded font. Some characters may not display or print correctly.
Code for reproduction
importmatplotlib.pyplotaspltfig,ax=plt.subplots(1,1,figsize=[2,1])# use TrueTypeifFalse:plt.rcParams.update({'pdf.fonttype':42})ax.axis('Off')ax.text(0.5,0.5,'$\\alpha~\\beta~\\gamma$',ha='center')fig.savefig('Test.pdf')
Actual outcome
Expected outcome
The font seems to be displayed correctly, but apparently it is not correctly embedded.
Additional information
To reproduce this issure, open the PDF created by Matplotlib in Adobe Acrobat, navigate toDocument Properties > Fonts > OK. The error message is only displayed if one changes the zoom, switches pages, etc. The error message arises in recent versions of Adobe Acrobat on different operating systems.
The error message arises only for PDFs containing mathematical expressions, while PDFs with regular text cause no error message. However, the issue seems to arise independently of the actual font type and arises for the default fontdejavusans
and others such asstix
.
The issue furthermore arises for the default value ofpdf.fonttype
being Type 3. When switching to TrueType (causing much larger file sizes), the error message no longer arises.
Operating system
No response
Matplotlib Version
3.4.3
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
conda