Title: [Bug]: Math fonts (Type 3) incorrectly embedded in PDF? · Issue #21797 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Math fonts (Type 3) incorrectly embedded in PDF? · Issue #21797 · matplotlib/matplotlib
X Title: [Bug]: Math fonts (Type 3) incorrectly embedded in PDF? · Issue #21797 · matplotlib/matplotlib
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, a...
Open Graph 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 reproductio...
X 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 reproductio...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/21797
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Math fonts (Type 3) incorrectly embedded in PDF?","articleBody":"### Bug summary\n\nPDFs containing math fonts cause the following error message in Adobe Acrobat: _Cannot extract the embedded font. Some characters may not display or print correctly._\n\n### Code for reproduction\n\n```python\nimport matplotlib.pyplot as plt\r\n\r\nfig, ax = plt.subplots(1, 1, figsize=[2, 1])\r\n\r\n# use TrueType\r\nif False: plt.rcParams.update({'pdf.fonttype': 42})\r\n\r\nax.axis('Off')\r\nax.text(0.5, 0.5, '$\\\\alpha~\\\\beta~\\\\gamma$', ha='center')\r\n\r\nfig.savefig('Test.pdf')\n```\n\n\n### Actual outcome\n\n\r\n\n\n### Expected outcome\n\nThe font seems to be displayed correctly, but apparently it is not correctly embedded.\n\n### Additional information\n\nTo reproduce this issure, open the PDF created by Matplotlib in Adobe Acrobat, navigate to _Document Properties \u003e Fonts \u003e 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.\r\n\r\nThe 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`.\r\n\r\nThe 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.\n\n### Operating system\n\n_No response_\n\n### Matplotlib Version\n\n3.4.3\n\n### Matplotlib Backend\n\n_No response_\n\n### Python version\n\n_No response_\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\nconda","author":{"url":"https://github.com/andreas-brugger","@type":"Person","name":"andreas-brugger"},"datePublished":"2021-11-29T13:46:46.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":21},"url":"https://github.com/21797/matplotlib/issues/21797"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e5568d12-8b69-0afe-e939-2e4fb713220b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B378:1D8CC3:11B7811:1810F79:6A52132F |
| html-safe-nonce | bfb2bc919d09716d94c94f7058e236bfef155eb2a69b4dfd358fba4e4fbe293f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMzc4OjFEOENDMzoxMUI3ODExOjE4MTBGNzk6NkE1MjEzMkYiLCJ2aXNpdG9yX2lkIjoiNjAzNjkyOTMzNzgxMDM1OTA4NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8db991e2870285057bfa4eaf58dcdb9ad5c189c0e65b7841401dc430534dd4b0 |
| hovercard-subject-tag | issue:1066058214 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/21797/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f353bf8f3b7404c0180d19e51da312913bb22d69c0a694f211c03a5f276aea7b/matplotlib/matplotlib/issues/21797 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f353bf8f3b7404c0180d19e51da312913bb22d69c0a694f211c03a5f276aea7b/matplotlib/matplotlib/issues/21797 |
| og:image:alt | 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 reproductio... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andreas-brugger |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width