Title: Font advance width by mdboom · Pull Request #4031 · matplotlib/matplotlib · GitHub
Open Graph Title: Font advance width by mdboom · Pull Request #4031 · matplotlib/matplotlib
X Title: Font advance width by mdboom · Pull Request #4031 · matplotlib/matplotlib
Description: Fix #253. This changes the text bounding box calculation to use advance width of the character, rather than the bounding box of the control points. It also fixes a long-standing bug in kerning in that (a) the conversion from 26.6 fixed point to floating-point was incorrect, and (b) the sign was backwards. This PR needs a couple of things to push it over the finish line: Virtually every test with text in it now fails, but from the spot-checking I've done, they've improved for the better. I'd suggest updating every image with any text, even if the difference isn't enough for the test to fail, just to reset the baseline correctly. The Abel font @sgmentzer used in #253 is a good one to catch this kind of error because the difference between advance width and control point bounding box is so large and because the kerning is so extreme. It might make sense to make a test or two based on it -- but then we have some technical issues to solve about how to get it. (It's under SIL Open Font License, so we can just incorporate it, but that might be overkill).
Open Graph Description: Fix #253. This changes the text bounding box calculation to use advance width of the character, rather than the bounding box of the control points. It also fixes a long-standing bug in kerning in t...
X Description: Fix #253. This changes the text bounding box calculation to use advance width of the character, rather than the bounding box of the control points. It also fixes a long-standing bug in kerning in t...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/4031
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:2fa5e0b6-f2e8-297d-0c2b-6945391667ec |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B410:2256F6:1B97BE3:262333D:6A5488D1 |
| html-safe-nonce | 25ba20d50befdc9fbe66222ec82fe836f49ca13e00c08c689452c394e1890db8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDEwOjIyNTZGNjoxQjk3QkUzOjI2MjMzM0Q6NkE1NDg4RDEiLCJ2aXNpdG9yX2lkIjoiNzkxMjkwMzAyMzU5MTc3NDI1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e5932d8e5cbfca014dc66ca9759c0b0b209ff8a8608036632a8439e6b1b756cf |
| hovercard-subject-tag | pull_request:27949913 |
| 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/4031/files |
| twitter:image | https://avatars.githubusercontent.com/u/38294?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/38294?s=400&v=4 |
| og:image:alt | Fix #253. This changes the text bounding box calculation to use advance width of the character, rather than the bounding box of the control points. It also fixes a long-standing bug in kerning in t... |
| 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 | 03ccb116376fd46e8ba2a4cdc541e35f13f70734 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width