-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1, figsize=[2, 1])
# use TrueType
if False: 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 to Document 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 font dejavusans
and others such as stix
.
The issue furthermore arises for the default value of pdf.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