Title: Request to support PostScript-flavoured (CFF) OpenType fonts in PDF backend · Issue #2869 · matplotlib/matplotlib · GitHub
Open Graph Title: Request to support PostScript-flavoured (CFF) OpenType fonts in PDF backend · Issue #2869 · matplotlib/matplotlib
X Title: Request to support PostScript-flavoured (CFF) OpenType fonts in PDF backend · Issue #2869 · matplotlib/matplotlib
Description: I would like to request support for OpenType fonts. I have the main text written with Lucida and I'm unable to get the font on the graphs match the ones in the text. I'm using the latest matplotlib with Python 3.3 on Mac OS X 10.7. When ...
Open Graph Description: I would like to request support for OpenType fonts. I have the main text written with Lucida and I'm unable to get the font on the graphs match the ones in the text. I'm using the latest matplotlib...
X Description: I would like to request support for OpenType fonts. I have the main text written with Lucida and I'm unable to get the font on the graphs match the ones in the text. I'm using the latest ma...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/2869
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Request to support PostScript-flavoured (CFF) OpenType fonts in PDF backend","articleBody":"I would like to request support for OpenType fonts. I have the main text written with Lucida and I'm unable to get the font on the graphs match the ones in the text.\n\nI'm using the latest matplotlib with Python 3.3 on Mac OS X 10.7. When I try to use any give OpenType font\n\n```\nmatplotlib.rcParams['font.family'] = 'Any Name Of OpenType Font'\n```\n\nthis is what I get:\n\n```\nTraceback (most recent call last):\n File \"test.py\", line 26, in \u003cmodule\u003e\n plt.savefig('test.pdf')\n File \"/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib/pyplot.py\", line 571, in savefig\n res = fig.savefig(*args, **kwargs)\n File \"/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib/figure.py\", line 1448, in savefig\n self.canvas.print_figure(*args, **kwargs)\n File \"/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib/backend_bases.py\", line 2192, in print_figure\n **kwargs)\n File \"/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib/backends/backend_pdf.py\", line 2476, in print_pdf\n file.close()\n File \"/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib/backends/backend_pdf.py\", line 528, in close\n self.writeFonts()\n File \"/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib/backends/backend_pdf.py\", line 631, in writeFonts\n fonts[Fx] = self.embedTTF(realpath, chars[1])\n File \"/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib/backends/backend_pdf.py\", line 1106, in embedTTF\n return embedTTFType3(font, characters, descriptor)\n File \"/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib/backends/backend_pdf.py\", line 892, in embedTTFType3\n filename.encode(sys.getfilesystemencoding()), glyph_ids)\nRuntimeError: TrueType font is missing table\n```\n\nThe weird thing is that my colleagues get a different warning (complaining that font substitution isn't supported and then some garbled output).\n\nThe problem is that apparently backend_pdf.py is only taking\ninto account:\n- *.afm fonts\n- something with dvi info (which came from TeX)\n- everything else is treated as TTF, so it goes though ttconv which apparently isn't able to handle PostScript-flavoured fonts\n\nThe interactive display and PNG work just fine, but I would like to have vector graphics.\n\nI then tried to fetch a TrueType version of Lucida from Java, but that one behaves weird enough that I'm unable to use it (I'll open a new issue for that). I also experienced something very very odd – fonts from those fonts are rendered on our high end laser printer as if they were high resolution bitmap images, somewhat fuzzy. Fonts from gnuplot graphics and the rest of text is crisp clear, while text from pyplot graphs is somewhat smoothed at the edges, it looks like rasterized or weirdly hinted font.\n\nAn alternative would be to render the text labels through TeX, but I don't know how to set it up for (OpenType) Lucida fonts. (I know how to set it up outside of matplotlib.)\n\nA slightly related issue is #1366. It would be great if pyplot supported OpenType Math fonts indeed, like Latin Modern Math, XITS Math, TeX Gyre Math (basically Helvetica, Times, Palatino, Bookman), Lucida Bright Math, Cambria, ...\n","author":{"url":"https://github.com/mojca","@type":"Person","name":"mojca"},"datePublished":"2014-03-05T23:21:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/2869/matplotlib/issues/2869"}
| 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:c8487583-506b-0298-6edb-bfbbc36e42e2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8564:B6D9A:4F7761:6ABAAC:6A5264E2 |
| html-safe-nonce | 0f58ac4e1a5084ed58f2ace2d410f2188611da86078eb8923f57e609512e8c63 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTY0OkI2RDlBOjRGNzc2MTo2QUJBQUM6NkE1MjY0RTIiLCJ2aXNpdG9yX2lkIjoiMzI2MzA5NDE5Nzk2NDY2MTk4NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f1f12a1faf4fe264e66b8ac464035f51cc4411f15166863211db54bf60fe1987 |
| hovercard-subject-tag | issue:28835919 |
| 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/2869/issue_layout |
| twitter:image | https://opengraph.githubassets.com/72a8523472d61037feb90a9f0cf9c9c4dfea2c2e5401cd1a06554ba37dcfc406/matplotlib/matplotlib/issues/2869 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/72a8523472d61037feb90a9f0cf9c9c4dfea2c2e5401cd1a06554ba37dcfc406/matplotlib/matplotlib/issues/2869 |
| og:image:alt | I would like to request support for OpenType fonts. I have the main text written with Lucida and I'm unable to get the font on the graphs match the ones in the text. I'm using the latest matplotlib... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mojca |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width