René's URL Explorer Experiment


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

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:2fa5e0b6-f2e8-297d-0c2b-6945391667ec
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB410:2256F6:1B97BE3:262333D:6A5488D1
html-safe-nonce25ba20d50befdc9fbe66222ec82fe836f49ca13e00c08c689452c394e1890db8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDEwOjIyNTZGNjoxQjk3QkUzOjI2MjMzM0Q6NkE1NDg4RDEiLCJ2aXNpdG9yX2lkIjoiNzkxMjkwMzAyMzU5MTc3NDI1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmace5932d8e5cbfca014dc66ca9759c0b0b209ff8a8608036632a8439e6b1b756cf
hovercard-subject-tagpull_request:27949913
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/pull/4031/files
twitter:imagehttps://avatars.githubusercontent.com/u/38294?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/38294?s=400&v=4
og:image:altFix #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_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git
octolytics-dimension-user_id215947
octolytics-dimension-user_loginmatplotlib
octolytics-dimension-repository_id1385122
octolytics-dimension-repository_nwomatplotlib/matplotlib
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1385122
octolytics-dimension-repository_network_root_nwomatplotlib/matplotlib
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release03ccb116376fd46e8ba2a4cdc541e35f13f70734
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/pull/4031/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fpull%2F4031%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fpull%2F4031%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=matplotlib%2Fmatplotlib
Reloadhttps://github.com/matplotlib/matplotlib/pull/4031/files
Reloadhttps://github.com/matplotlib/matplotlib/pull/4031/files
Reloadhttps://github.com/matplotlib/matplotlib/pull/4031/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/4031/files
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/4031/files
Notifications https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Fork 8.4k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Star 23k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Code https://github.com/matplotlib/matplotlib
Issues 1.1k https://github.com/matplotlib/matplotlib/issues
Pull requests 408 https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality 0 https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
Code https://github.com/matplotlib/matplotlib
Issues https://github.com/matplotlib/matplotlib/issues
Pull requests https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fmatplotlib%2Fmatplotlib%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib%2Fissues%2Fnew%2Fchoose
tacaswellhttps://github.com/tacaswell
matplotlib:masterhttps://github.com/matplotlib/matplotlib/tree/master
mdboom:font-advance-widthhttps://github.com/mdboom/matplotlib/tree/font-advance-width
Conversation 22 https://github.com/matplotlib/matplotlib/pull/4031
Commits 3 https://github.com/matplotlib/matplotlib/pull/4031/commits
Checks 0 https://github.com/matplotlib/matplotlib/pull/4031/checks
Files changed https://github.com/matplotlib/matplotlib/pull/4031/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/4031/files
Font advance width https://github.com/matplotlib/matplotlib/pull/4031/files#top
Show all changes 3 commits https://github.com/matplotlib/matplotlib/pull/4031/files
c6d0183 Fix #253: Use advance width to calculate text bounding box mdboom Jan 27, 2015 https://github.com/matplotlib/matplotlib/pull/4031/commits/c6d01835816ace3204212d072da1ac3af2b54997
3afdaf0 Update baseline images with text mdboom Jan 27, 2015 https://github.com/matplotlib/matplotlib/pull/4031/commits/3afdaf067e0cfd50dfec804253d21ad645438484
f8dc710 Update docstring mdboom Jan 27, 2015 https://github.com/matplotlib/matplotlib/pull/4031/commits/f8dc710ce6b71e2f07f37d08d6110e0d7d1e3e48
Clear filters https://github.com/matplotlib/matplotlib/pull/4031/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/4031/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/4031/files
CHANGELOGhttps://github.com/matplotlib/matplotlib/pull/4031/files#diff-ecec88c33adb7591ee6aa88e29b62ad52ef443611cba5e0f0ecac9b5725afdba
View file https://github.com/mdboom/matplotlib/blob/f8dc710ce6b71e2f07f37d08d6110e0d7d1e3e48/CHANGELOG
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/4031/{{ revealButtonHref }}
https://github.com/matplotlib/matplotlib/pull/4031/files#diff-ecec88c33adb7591ee6aa88e29b62ad52ef443611cba5e0f0ecac9b5725afdba
lib/matplotlib/backends/backend_agg.pyhttps://github.com/matplotlib/matplotlib/pull/4031/files#diff-0a415dbb618fcfb73e6191c735f6e5a91f530d4a29b8886afdfd56604892de61
View file https://github.com/mdboom/matplotlib/blob/f8dc710ce6b71e2f07f37d08d6110e0d7d1e3e48/lib/matplotlib/backends/backend_agg.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/4031/{{ revealButtonHref }}
https://github.com/matplotlib/matplotlib/pull/4031/files#diff-0a415dbb618fcfb73e6191c735f6e5a91f530d4a29b8886afdfd56604892de61
https://github.com/matplotlib/matplotlib/pull/4031/files#diff-0a415dbb618fcfb73e6191c735f6e5a91f530d4a29b8886afdfd56604892de61
lib/matplotlib/tests/baseline_images/test_arrow_patches/boxarrow_test_image.pnghttps://github.com/matplotlib/matplotlib/pull/4031/files#diff-b2fcda7893bc31f31708de27e6d71fa2bbfb89ac9d1d2c3313d8aefc4a93afe5
View file https://github.com/mdboom/matplotlib/blob/f8dc710ce6b71e2f07f37d08d6110e0d7d1e3e48/lib/matplotlib/tests/baseline_images/test_arrow_patches/boxarrow_test_image.png
Open in desktop https://desktop.github.com
Reload?https://github.com/matplotlib/matplotlib/pull/4031/files
lib/matplotlib/tests/baseline_images/test_axes/axhspan_epoch.pdfhttps://github.com/matplotlib/matplotlib/pull/4031/files#diff-03468e6badb7dc3ed6bb8b454e70151354961f79dd40b3f559f001cddd1b7cef
View file https://github.com/mdboom/matplotlib/blob/f8dc710ce6b71e2f07f37d08d6110e0d7d1e3e48/lib/matplotlib/tests/baseline_images/test_axes/axhspan_epoch.pdf
Open in desktop https://desktop.github.com
lib/matplotlib/tests/baseline_images/test_axes/axhspan_epoch.pnghttps://github.com/matplotlib/matplotlib/pull/4031/files#diff-68e6110caca575f7ab3723f4dc8525e5e4e820feaa48ad4df51cb2ba00fa78b0
View file https://github.com/mdboom/matplotlib/blob/f8dc710ce6b71e2f07f37d08d6110e0d7d1e3e48/lib/matplotlib/tests/baseline_images/test_axes/axhspan_epoch.png
Open in desktop https://desktop.github.com
Reload?https://github.com/matplotlib/matplotlib/pull/4031/files
lib/matplotlib/tests/baseline_images/test_axes/axhspan_epoch.svghttps://github.com/matplotlib/matplotlib/pull/4031/files#diff-fcc6e99bfc515303c4f2e810f39a2aee4d6a8ddd12ff11fcaf016c8db7d8bb13
View file https://github.com/mdboom/matplotlib/blob/f8dc710ce6b71e2f07f37d08d6110e0d7d1e3e48/lib/matplotlib/tests/baseline_images/test_axes/axhspan_epoch.svg
Open in desktop https://desktop.github.com
Reload?https://github.com/matplotlib/matplotlib/pull/4031/files
lib/matplotlib/tests/baseline_images/test_axes/axvspan_epoch.pdfhttps://github.com/matplotlib/matplotlib/pull/4031/files#diff-c194d29d888259c2c327f9911ebe5449dcb7e74774115848c139e2831cda0005
View file https://github.com/mdboom/matplotlib/blob/f8dc710ce6b71e2f07f37d08d6110e0d7d1e3e48/lib/matplotlib/tests/baseline_images/test_axes/axvspan_epoch.pdf
Open in desktop https://desktop.github.com
lib/matplotlib/tests/baseline_images/test_axes/axvspan_epoch.pnghttps://github.com/matplotlib/matplotlib/pull/4031/files#diff-a0fe7f54e5d956872b8258ff0e8b2b217e51204bca90ab8b02a4c47b394d5664
View file https://github.com/mdboom/matplotlib/blob/f8dc710ce6b71e2f07f37d08d6110e0d7d1e3e48/lib/matplotlib/tests/baseline_images/test_axes/axvspan_epoch.png
Open in desktop https://desktop.github.com
Reload?https://github.com/matplotlib/matplotlib/pull/4031/files
lib/matplotlib/tests/baseline_images/test_axes/axvspan_epoch.svghttps://github.com/matplotlib/matplotlib/pull/4031/files#diff-b713cbd50faff37006a94ba1b1ca93d7bf733314bc11438fe513363f4b31d952
View file https://github.com/mdboom/matplotlib/blob/f8dc710ce6b71e2f07f37d08d6110e0d7d1e3e48/lib/matplotlib/tests/baseline_images/test_axes/axvspan_epoch.svg
Open in desktop https://desktop.github.com
Reload?https://github.com/matplotlib/matplotlib/pull/4031/files
lib/matplotlib/tests/baseline_images/test_axes/boxplot.pdfhttps://github.com/matplotlib/matplotlib/pull/4031/files#diff-bd15c572bb769165427dd376f66df605d76237b204e7c251754c870769a0b5f7
View file https://github.com/mdboom/matplotlib/blob/f8dc710ce6b71e2f07f37d08d6110e0d7d1e3e48/lib/matplotlib/tests/baseline_images/test_axes/boxplot.pdf
Open in desktop https://desktop.github.com
lib/matplotlib/tests/baseline_images/test_axes/boxplot.pnghttps://github.com/matplotlib/matplotlib/pull/4031/files#diff-8d0f500ed7f5a11208f122e19239484a3cdff10eb2a8294e66ca1b353f4f79ef
View file https://github.com/mdboom/matplotlib/blob/f8dc710ce6b71e2f07f37d08d6110e0d7d1e3e48/lib/matplotlib/tests/baseline_images/test_axes/boxplot.png
Open in desktop https://desktop.github.com
Reload?https://github.com/matplotlib/matplotlib/pull/4031/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/4031/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.