Title: Fix that font files never pass the test on Win by almarklein · Pull Request #24641 · matplotlib/matplotlib · GitHub
Open Graph Title: Fix that font files never pass the test on Win by almarklein · Pull Request #24641 · matplotlib/matplotlib
X Title: Fix that font files never pass the test on Win by almarklein · Pull Request #24641 · matplotlib/matplotlib
Description: Hi! 👋 I am gratefully making use of MPL's font management code for our text rendering in PyGfx. While I was examining the code, I found what I think is a bug. The isfile() test is applied on the relative pathname and will thus always fail. This PR should fix that. I would expect that it should also test for the extension, but I'm not 100% sure so I did not add this yet. Diving a bit deeper, this bug has likely gone unnoticed because the code to detect fonts follows two paths on Windows: It checks the registry for known installed fonts in a small set of predefined directories. It detects font files in these same directories using os.listdir or os.walk. Why are these two paths followed? I can see how the second route can find fonts that are present but not known in the registry, but why check the registry at all then?
Open Graph Description: Hi! 👋 I am gratefully making use of MPL's font management code for our text rendering in PyGfx. While I was examining the code, I found what I think is a bug. The isfile() test is applied on th...
X Description: Hi! 👋 I am gratefully making use of MPL's font management code for our text rendering in PyGfx. While I was examining the code, I found what I think is a bug. The isfile() test is applied o...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/24641
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:8b1d780f-60c9-c016-9c99-f75788e78307 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CAE8:141904:17D6CF0:1F49539:6A51C77A |
| html-safe-nonce | 1c7ae0bc5ea65e5b9073244f33a1d5161c1005fa2131826bb4bb3396dc345711 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQUU4OjE0MTkwNDoxN0Q2Q0YwOjFGNDk1Mzk6NkE1MUM3N0EiLCJ2aXNpdG9yX2lkIjoiNDgwNzY2NTk5MjEwNzkzNTYxMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 25e6d46128384e10ff538db284c73592b2a961ee55dded2b318c5a1035708243 |
| hovercard-subject-tag | pull_request:1148770252 |
| 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/24641/files |
| twitter:image | https://avatars.githubusercontent.com/u/3015475?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/3015475?s=400&v=4 |
| og:image:alt | Hi! 👋 I am gratefully making use of MPL's font management code for our text rendering in PyGfx. While I was examining the code, I found what I think is a bug. The isfile() test is applied on th... |
| 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 |
| 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