Title: Type42 font embedding broken for fonts without glyph names · Issue #18307 · matplotlib/matplotlib · GitHub
Open Graph Title: Type42 font embedding broken for fonts without glyph names · Issue #18307 · matplotlib/matplotlib
X Title: Type42 font embedding broken for fonts without glyph names · Issue #18307 · matplotlib/matplotlib
Description: Bug report Bug summary Setting pdf.fonttype or ps.fonttype to 42 and using a font with no glyph names (i.e. for which FT_HAS_GLYPH_NAMES returns 0) results in non-displayed text. Code for reproduction Arial is a prominent font with no gl...
Open Graph Description: Bug report Bug summary Setting pdf.fonttype or ps.fonttype to 42 and using a font with no glyph names (i.e. for which FT_HAS_GLYPH_NAMES returns 0) results in non-displayed text. Code for reproduct...
X Description: Bug report Bug summary Setting pdf.fonttype or ps.fonttype to 42 and using a font with no glyph names (i.e. for which FT_HAS_GLYPH_NAMES returns 0) results in non-displayed text. Code for reproduct...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/18307
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Type42 font embedding broken for fonts without glyph names","articleBody":"\u003c!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--\u003e\r\n\u003c!--You can feel free to delete the sections that do not apply.--\u003e\r\n\r\n### Bug report\r\n\r\n**Bug summary**\r\n\r\nSetting `pdf.fonttype` or `ps.fonttype` to 42 and using a font with no glyph names (i.e. for which FT_HAS_GLYPH_NAMES returns 0) results in non-displayed text.\r\n\r\n**Code for reproduction**\r\n\r\n\u003c!--A minimum code snippet required to reproduce the bug.\r\nPlease make sure to minimize the number of dependencies required, and provide\r\nany necessary plotted data.\r\nAvoid using threads, as Matplotlib is (explicitly) not thread-safe.--\u003e\r\n\r\nArial is a prominent font with no glyph names (so it's not a completely obscure edge case...).\r\n\r\n```python\r\nfrom pathlib import Path\r\nrcParams.update({\"pdf.fonttype\": 42, \"ps.fonttype\": 42}\r\nfigtext(.5, .5, \"ab\", font=\"arial\")\r\nsavefig(\"/tmp/test.pdf\")\r\nsavefig(\"/tmp/test.ps\")\r\n```\r\n\r\n**Actual outcome**\r\n\r\nFiles are displayed as empty.\r\n\r\n**Expected outcome**\r\n\r\nText is shown.\r\n\r\n---\r\n\r\nAgain https://github.com/matplotlib/matplotlib/pull/18143 may be relevant here: perhaps fontTools can generate the glyph names table if needed?\r\n\r\n**Matplotlib version**\r\n\u003c!--Please specify your platform and versions of the relevant libraries you are using:--\u003e\r\n * Operating system: fedora\r\n * Matplotlib version: master\r\n * Python version: 38\r\n\r\n\u003c!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda--\u003e\r\n\u003c!--If you installed from conda, please specify which channel you used if not the default--\u003e\r\n\r\n","author":{"url":"https://github.com/anntzer","@type":"Person","name":"anntzer"},"datePublished":"2020-08-20T14:37:43.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/18307/matplotlib/issues/18307"}
| 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:644a7fd0-6ffc-2eec-5bee-2a02f9c73fb4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EAE2:34B0DF:2CD5330:3C7A095:6A53C207 |
| html-safe-nonce | 0cba37c2dbceec66223597d5c7ceef233818bfa2158fab54e512dc93b5299c39 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQUUyOjM0QjBERjoyQ0Q1MzMwOjNDN0EwOTU6NkE1M0MyMDciLCJ2aXNpdG9yX2lkIjoiOTEzMjUwMDQ1NjMyNDcxMDkxOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 367131324459bdc9e3675455dd8f30cdca956067636475e0e1a30630e12d19ef |
| hovercard-subject-tag | issue:682769835 |
| 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/18307/issue_layout |
| twitter:image | https://opengraph.githubassets.com/32ec48e8fd90c74a5398e4058a42c0a610bbadb6faf7ace4c360b93cf234fde8/matplotlib/matplotlib/issues/18307 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/32ec48e8fd90c74a5398e4058a42c0a610bbadb6faf7ace4c360b93cf234fde8/matplotlib/matplotlib/issues/18307 |
| og:image:alt | Bug report Bug summary Setting pdf.fonttype or ps.fonttype to 42 and using a font with no glyph names (i.e. for which FT_HAS_GLYPH_NAMES returns 0) results in non-displayed text. Code for reproduct... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | anntzer |
| 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 | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width