Title: Add missing decode() in svg font embedding path. by anntzer · Pull Request #10046 · matplotlib/matplotlib · GitHub
Open Graph Title: Add missing decode() in svg font embedding path. by anntzer · Pull Request #10046 · matplotlib/matplotlib
X Title: Add missing decode() in svg font embedding path. by anntzer · Pull Request #10046 · matplotlib/matplotlib
Description: Otherwise, rcParams["svg.fonttype"] = "svgfont"; title("foo"); savefig("/tmp/test.svg") fails (on Py3) with File ".../backend_svg.py", line 86, in escape_attrib s = s.replace("&", "&") TypeError: a bytes-like object is required, not 'str' The encoding of entry 1, 0, 0, 4 in the sfnt table is macroman (https://www.freetype.org/freetype2/docs/reference/ft2-truetype_tables.html#TT_MAC_ID_XXX). Note that after the fix is applied, the resulting svg file still appears to be unopenable by inkscape, so the fix is not complete, but hopefully a step in the correct direction. Of course, this suggests that the svg.fonttype = svgfont codepath is untested, which is another problem :p In practice it appears that the svg font standard isn't that popular or well supported, see https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/SVG_fonts. PR Summary PR Checklist Has Pytest style unit tests Code is PEP 8 compliant New features are documented, with examples if plot related Documentation is sphinx and numpydoc compliant Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there) Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way
Open Graph Description: Otherwise, rcParams["svg.fonttype"] = "svgfont"; title("foo"); savefig("/tmp/test.svg") fails (on Py3) with File ".../backend_svg.py", line 86, ...
X Description: Otherwise, rcParams["svg.fonttype"] = "svgfont"; title("foo"); savefig("/tmp/test.svg") fails (on Py3) with File "...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/10046
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:896b522f-074f-a15a-b185-f13effadaf9f |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E684:17A166:B407E:FB736:6A535FB8 |
| html-safe-nonce | 8d043a4e79bb0ebaf6bfed0d51356176f29b40dcaefa4cf6b69b7bb406dfead7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjg0OjE3QTE2NjpCNDA3RTpGQjczNjo2QTUzNUZCOCIsInZpc2l0b3JfaWQiOiIzMjUwODI5Nzk0Mjk2OTQ2NjE2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fba3b3374c69f965c30a5a0a10a435c42677842a9be6bb8da771e3dc5f5ade02 |
| hovercard-subject-tag | pull_request:159253536 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/matplotlib/matplotlib/pull/10046/files |
| twitter:image | https://avatars.githubusercontent.com/u/1322974?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1322974?s=400&v=4 |
| og:image:alt | Otherwise, rcParams["svg.fonttype"] = "svgfont"; title("foo"); savefig("/tmp/test.svg") fails (on Py3) with File ".../backend_svg.py", line 86, ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| 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