Title: Added get_font_names() to fontManager by ojeda-e · Pull Request #21799 · matplotlib/matplotlib · GitHub
Open Graph Title: Added get_font_names() to fontManager by ojeda-e · Pull Request #21799 · matplotlib/matplotlib
X Title: Added get_font_names() to fontManager by ojeda-e · Pull Request #21799 · matplotlib/matplotlib
Description: PR Summary Added list of available fonts. Changes in this PR allows the user to find a list of available fonts by running: matplotlib.font_manager.get_font_list(). Edit: Fixes #21761. PR Checklist Tests and Styling Has pytest style unit tests (and pytest passes). Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all). Documentation New features are documented, with examples if plot related. New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there). [N/A] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there). Documentation is sphinx and numpydoc compliant (the docs should build without error). Comments About get_font_list() I added get_font_list() as a method in FontManager. However, for convenience, I also added it as global function. In this way, although the method itself belongs to FontManager (matplotlib.font_manager.fontManager.get_font_list()) , is easily accessible one level up at matplotlib.font_manager.get_font_list(). Test Units Although I was considering the use of a fixture to extract all the fonts from scratch but ended up skipping it. In the spirit of best practices, the addition of a fixture should be for usability across different unit tests, which in this case does not occur. The unit test is a bit long for my preference, but I tried my best to overcome the limitations. Documentation I added a note in the tutorial page text_props.py where there is a reference about fonts. I am not sure about adding plots here to illustrate the different font options. I could add a section if the reviewers consider it appropriate. New features Didn't add new features as I am not entirely sure this change is substantial enough to be added to the list of new features. I can add it later otherwise. Finally, as a general comment, I would like to point out that the code in font_manager.py could be further improved as well as the unit tests associated with it. I guess because the last changes in this part of the library were added quite some time ago. I also understand the limitations when testing fonts across different platforms, though. Anyway, If there is interest in the enhancement of this component of matplotlib I can offer some help, but that's another discussion. Let's start here, will be happy to improve/change whatever is necessary. Thanks.
Open Graph Description: PR Summary Added list of available fonts. Changes in this PR allows the user to find a list of available fonts by running: matplotlib.font_manager.get_font_list(). Edit: Fixes #21761. PR Checklist ...
X Description: PR Summary Added list of available fonts. Changes in this PR allows the user to find a list of available fonts by running: matplotlib.font_manager.get_font_list(). Edit: Fixes #21761. PR Checklist ...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/21799
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:6a51a219-6cfe-ec2a-9455-ff9e35117d5d |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C802:37AF14:12B677C:1AFC4BA:6A57B1C8 |
| html-safe-nonce | efc2ce9ba0789884544c6d092a2c4bf578013fedb7db77b817167c1bdd074894 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODAyOjM3QUYxNDoxMkI2NzdDOjFBRkM0QkE6NkE1N0IxQzgiLCJ2aXNpdG9yX2lkIjoiNzcxMjU5NDE5ODIzMTc1NzI1NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 59d6d52a0d924772e48dc843d6ecf651e07bde64a657fff450dfd0900cc1c443 |
| hovercard-subject-tag | pull_request:790749270 |
| 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/21799/files |
| twitter:image | https://avatars.githubusercontent.com/u/27988163?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/27988163?s=400&v=4 |
| og:image:alt | PR Summary Added list of available fonts. Changes in this PR allows the user to find a list of available fonts by running: matplotlib.font_manager.get_font_list(). Edit: Fixes #21761. PR Checklist ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 899c314dfde9abcf8fc1fe8c04f09866b347ea06f43166d653afc482795c9fca |
| 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 | 67aa73f3bba9e68b2de0ebe01c65fcd120461cba |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width