Title: New FreeType wrapper. by anntzer · Pull Request #9763 · matplotlib/matplotlib · GitHub
Open Graph Title: New FreeType wrapper. by anntzer · Pull Request #9763 · matplotlib/matplotlib
X Title: New FreeType wrapper. by anntzer · Pull Request #9763 · matplotlib/matplotlib
Description: A FreeType wrapper rewrite based on pybind11. See #5414 (which sadly appears to be abandoned) for the motivation. Also implements (essentially) a MEP14-style API (see the Layout class), which should make it fairly easy (based on my experience with mplcairo) to support complex text layout (Indic scripts #8765; Right-to-left languages) (if we accept to bring in new (optional?) dependencies). The layout class should also make mathtext rendering (a bit) faster: the current implementation requires the parser to go twice through the string (once just to compute the extents of result, once with the actual rendering); this implementation just asks the parser to pass a list of positioned glyphs and rectangles (single pass) and does the sizing itself (with an iteration over the glyphs/rectangles, rather than an additional parsing round). This requires a C++17 compiler, but such compilers are now directly available on conda. Note, however, that Matplotlib's setupext.py does not play well with non-system compilers (#9737) so you can effectively only test this PR locally with a modern system compiler (this is also why the PR is marked [ci skip]). Solving #9737 is probably a strict prerequisite for this PR. The new wrapper weights <1000 lines of code, which is ~3x shorter than the old ones. Adaptation of the codebase to the new wrapper is mostly complete. Non-antialiased text rendering is currently missing (but should be easy to implement). Although I tried to reproduce the (dubious) hinting_factor option that currently exists, I haven't actually managed to make the text layout as bad as ft2font sometime does (cf. the wiggly baselines mentioned in #5414) :-), and I don't think it's really worth trying to do that -- but that means that test images will need to be updated. Unlike #5414, I haven't moved the wrapper to a library separate from matplotlib, because I'd rather take advantage of the FreeType-related build scripts (including local_freetype) rather than replicating them.
Open Graph Description: A FreeType wrapper rewrite based on pybind11. See #5414 (which sadly appears to be abandoned) for the motivation. Also implements (essentially) a MEP14-style API (see the Layout class), which sho...
X Description: A FreeType wrapper rewrite based on pybind11. See #5414 (which sadly appears to be abandoned) for the motivation. Also implements (essentially) a MEP14-style API (see the Layout class), which sho...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/9763
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:db7c4d94-edc6-d2e5-b623-4ec787773fa2 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | ABB8:316C3E:82AD38:AE49A6:6A51A9B8 |
| html-safe-nonce | a51539e5607b2217fc20b3f7b7e16d7a3ed16962f17d701cd0d9c05b93d7b377 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQkI4OjMxNkMzRTo4MkFEMzg6QUU0OUE2OjZBNTFBOUI4IiwidmlzaXRvcl9pZCI6IjM4NTY3MjMxODQ4ODE5MTI4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | abf9c6c6005a58aa6993646e7436a8a0a97c1ac9e4791a461733c7480e0d4498 |
| hovercard-subject-tag | pull_request:152146961 |
| 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/9763/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 | A FreeType wrapper rewrite based on pybind11. See #5414 (which sadly appears to be abandoned) for the motivation. Also implements (essentially) a MEP14-style API (see the Layout class), which sho... |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width