Title: Implement Font-Fallback in Matplotlib by aitikgupta · Pull Request #20740 · matplotlib/matplotlib · GitHub
Open Graph Title: Implement Font-Fallback in Matplotlib by aitikgupta · Pull Request #20740 · matplotlib/matplotlib
X Title: Implement Font-Fallback in Matplotlib by aitikgupta · Pull Request #20740 · matplotlib/matplotlib
Description: PR Summary This PR modifies the internal structure of FT2Font (the interface between fonts and Matplotlib) in favor of implementing Font Fallback for Matplotlib, and allow Agg backend to use the new codepath. It builds on the previous PR: #20549, which was the 'first-step', i.e., "parsing multiple families".. this PR implements using those families for font fallback. This would help us in multi-language support, for example (Previous / After): ^the fonts are chosen such that the difference is visually noticeable. A flowchart explaining the text rendering algorithm with font fallback: Here's the script: import matplotlib.pyplot as plt # "Authentic" is a fancy font, whereas "SimHei" is a CJK font plt.rcParams['font.family'] = ['Authentic', 'SimHei'] plt.rcParams['font.size'] = 30 plt.figtext(0.18, 0.45, "There are 多个汉字 in between!") plt.show() Fixes #18883, #15260 PR Checklist Has pytest style unit tests (and pytest passes). Is Flake 8 compliant (run flake8 on changed files to check). New features are documented, with examples if plot related. Documentation is sphinx and numpydoc compliant (the docs should build without error). Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all). New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there). API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
Open Graph Description: PR Summary This PR modifies the internal structure of FT2Font (the interface between fonts and Matplotlib) in favor of implementing Font Fallback for Matplotlib, and allow Agg backend to use the ne...
X Description: PR Summary This PR modifies the internal structure of FT2Font (the interface between fonts and Matplotlib) in favor of implementing Font Fallback for Matplotlib, and allow Agg backend to use the ne...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/20740
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:20cd587f-f3a9-51f6-9076-2fa65d46bcef |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D994:1B00D1:169313B:1DDCDC2:6A51C7A9 |
| html-safe-nonce | 611113fa8e6e9d0459d057b6b7553af329b461c2ad712199203ebbed62db021b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTk0OjFCMDBEMToxNjkzMTNCOjFERENEQzI6NkE1MUM3QTkiLCJ2aXNpdG9yX2lkIjoiMTc4MTQ5MzU1MjE2MjkxNjI2NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b27d0dc9c3eb62ac9131c15d735076a374ebec6449d08c0b97ff166bbcf18efb |
| hovercard-subject-tag | pull_request:696573446 |
| 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/20740/files |
| twitter:image | https://avatars.githubusercontent.com/u/43996118?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/43996118?s=400&v=4 |
| og:image:alt | PR Summary This PR modifies the internal structure of FT2Font (the interface between fonts and Matplotlib) in favor of implementing Font Fallback for Matplotlib, and allow Agg backend to use the ne... |
| 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