René's URL Explorer Experiment


Title: New FreeType wrapper. by anntzer · Pull Request #9763 · matplotlib/matplotlib · GitHub

Open Graph Title: New FreeType wrapper. by anntzer · Pull Request #9763 · matplotlib/matplotlib

X Title: New FreeType wrapper. by anntzer · Pull Request #9763 · matplotlib/matplotlib

Description: A FreeType wrapper rewrite based on pybind11. See #5414 (which sadly appears to be abandoned) for the motivation. Also implements (essentially) a MEP14-style API (see the Layout class), which should make it fairly easy (based on my experience with mplcairo) to support complex text layout (Indic scripts #8765; Right-to-left languages) (if we accept to bring in new (optional?) dependencies). The layout class should also make mathtext rendering (a bit) faster: the current implementation requires the parser to go twice through the string (once just to compute the extents of result, once with the actual rendering); this implementation just asks the parser to pass a list of positioned glyphs and rectangles (single pass) and does the sizing itself (with an iteration over the glyphs/rectangles, rather than an additional parsing round). This requires a C++17 compiler, but such compilers are now directly available on conda. Note, however, that Matplotlib's setupext.py does not play well with non-system compilers (#9737) so you can effectively only test this PR locally with a modern system compiler (this is also why the PR is marked [ci skip]). Solving #9737 is probably a strict prerequisite for this PR. The new wrapper weights <1000 lines of code, which is ~3x shorter than the old ones. Adaptation of the codebase to the new wrapper is mostly complete. Non-antialiased text rendering is currently missing (but should be easy to implement). Although I tried to reproduce the (dubious) hinting_factor option that currently exists, I haven't actually managed to make the text layout as bad as ft2font sometime does (cf. the wiggly baselines mentioned in #5414) :-), and I don't think it's really worth trying to do that -- but that means that test images will need to be updated. Unlike #5414, I haven't moved the wrapper to a library separate from matplotlib, because I'd rather take advantage of the FreeType-related build scripts (including local_freetype) rather than replicating them.

Open Graph Description: A FreeType wrapper rewrite based on pybind11. See #5414 (which sadly appears to be abandoned) for the motivation. Also implements (essentially) a MEP14-style API (see the Layout class), which sho...

X Description: A FreeType wrapper rewrite based on pybind11. See #5414 (which sadly appears to be abandoned) for the motivation. Also implements (essentially) a MEP14-style API (see the Layout class), which sho...

Opengraph URL: https://github.com/matplotlib/matplotlib/pull/9763

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:db7c4d94-edc6-d2e5-b623-4ec787773fa2
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idABB8:316C3E:82AD38:AE49A6:6A51A9B8
html-safe-noncea51539e5607b2217fc20b3f7b7e16d7a3ed16962f17d701cd0d9c05b93d7b377
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQkI4OjMxNkMzRTo4MkFEMzg6QUU0OUE2OjZBNTFBOUI4IiwidmlzaXRvcl9pZCI6IjM4NTY3MjMxODQ4ODE5MTI4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacabf9c6c6005a58aa6993646e7436a8a0a97c1ac9e4791a461733c7480e0d4498
hovercard-subject-tagpull_request:152146961
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/9763/files
twitter:imagehttps://avatars.githubusercontent.com/u/1322974?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1322974?s=400&v=4
og:image:altA FreeType wrapper rewrite based on pybind11. See #5414 (which sadly appears to be abandoned) for the motivation. Also implements (essentially) a MEP14-style API (see the Layout class), which sho...
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
release7aed05249554b889eb33d002851a973eebcc7e91
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/pull/9763/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fpull%2F9763%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%2F9763%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/9763/files
Reloadhttps://github.com/matplotlib/matplotlib/pull/9763/files
Reloadhttps://github.com/matplotlib/matplotlib/pull/9763/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/9763/files
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/9763/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 409 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
anntzerhttps://github.com/anntzer
matplotlib:mainhttps://github.com/matplotlib/matplotlib/tree/main
anntzer:ft2https://github.com/anntzer/matplotlib/tree/ft2
Conversation 26 https://github.com/matplotlib/matplotlib/pull/9763
Commits 1 https://github.com/matplotlib/matplotlib/pull/9763/commits
Checks 0 https://github.com/matplotlib/matplotlib/pull/9763/checks
Files changed https://github.com/matplotlib/matplotlib/pull/9763/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/9763/files
New FreeType wrapper. https://github.com/matplotlib/matplotlib/pull/9763/files#top
Show all changes 1 commit https://github.com/matplotlib/matplotlib/pull/9763/files
95a9f28 New FreeType wrapper. anntzer Nov 12, 2017 https://github.com/matplotlib/matplotlib/pull/9763/commits/95a9f28b5480d1c3658d37145e9f4e313c69899a
Clear filters https://github.com/matplotlib/matplotlib/pull/9763/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/9763/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/9763/files
.appveyor.yml https://github.com/matplotlib/matplotlib/pull/9763/files#diff-e1ab4c3cec24f841948eb867754d4ad0b9b6d11eaa6b5bfbe0357aceb0a49eff
config.yml https://github.com/matplotlib/matplotlib/pull/9763/files#diff-78a8a19706dbd2a4425dd72bdab0502ed7a2cef16365ab7030a5a0588927bf47
.travis.yml https://github.com/matplotlib/matplotlib/pull/9763/files#diff-6ac3f79fc25d95cd1e3d51da53a4b21b939437392578a35ae8cd6d5366ca5485
font_indexing.py https://github.com/matplotlib/matplotlib/pull/9763/files#diff-de6734a2e78612c45b5acc223ccb3e2e4d851f0d145d315dbc7f8ab35b3c0dd6
ftface_props.py https://github.com/matplotlib/matplotlib/pull/9763/files#diff-f50b0010ad41d20cc2a51e8e21c6f30f7ac86cfa5ad9d25ee2a932d61e0dee1c
font_table_ttf_sgskip.py https://github.com/matplotlib/matplotlib/pull/9763/files#diff-89b2de6f5477c6d5d4e67b6f61866bd84193a015a877c48f51bfbff131772026
backend_agg.py https://github.com/matplotlib/matplotlib/pull/9763/files#diff-0a415dbb618fcfb73e6191c735f6e5a91f530d4a29b8886afdfd56604892de61
backend_pdf.py https://github.com/matplotlib/matplotlib/pull/9763/files#diff-a81af365fe6fc7525d863103afd81bb197d895d19f9f9fb9814a0594fbeda75c
backend_ps.py https://github.com/matplotlib/matplotlib/pull/9763/files#diff-af28be596077d9f4ceda7df2faa04acb7a8e26e40f8f12adc0f04dede0493659
backend_svg.py https://github.com/matplotlib/matplotlib/pull/9763/files#diff-3f7115dd582045209a3ca182f43c29176d759914b187efec3991883c2487009e
contour.py https://github.com/matplotlib/matplotlib/pull/9763/files#diff-b3f136a845ae5b7383fbc2be280c64af12352a6583ace9658cc4f6e2479df4a3
font_manager.py https://github.com/matplotlib/matplotlib/pull/9763/files#diff-aca801331b4c856bff720af0575b9ad63f402c893abd7d939e5547ba961ee324
mathtext.py https://github.com/matplotlib/matplotlib/pull/9763/files#diff-1576a5f502008fa76ebeab602a6814b8d8e79f5fbc374f9134157daa66dd5a87
decorators.py https://github.com/matplotlib/matplotlib/pull/9763/files#diff-634eb58f2970e77b1feabc7824a5d757378ee8c3174867d1c7a1481a833637f3
test_mathtext.py https://github.com/matplotlib/matplotlib/pull/9763/files#diff-17f9692b77108a62b59c71825d8461488729ef280f56785d3ad55ce3a86044d8
textpath.py https://github.com/matplotlib/matplotlib/pull/9763/files#diff-574862438bd94ff599818f86767104b56673fa6df2ecb067a1254c842f281f4d
setup.py https://github.com/matplotlib/matplotlib/pull/9763/files#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7
setupext.py https://github.com/matplotlib/matplotlib/pull/9763/files#diff-113dbd0ff67f6e8e817884a3e98962eec6856df1fb826932442487e374b827f0
_ft2.cpp https://github.com/matplotlib/matplotlib/pull/9763/files#diff-fc814085ffea9d0f61eb2affd6ba1d54c15e857e975d17796732b6113a4fe25c
_ft2.h https://github.com/matplotlib/matplotlib/pull/9763/files#diff-86db7b4fbdb08074aa471d962ebfbbbe4b8fc5ed3821679dde76f6ae3c7ec88e
_layout.cpp https://github.com/matplotlib/matplotlib/pull/9763/files#diff-447916367760033b3275f1ca1868cfda2564b1f8e51c9997947e9a8c35aff635
_layout.h https://github.com/matplotlib/matplotlib/pull/9763/files#diff-5b97d2543da5c6dcd46e99dd49769a4a22abac9d7a51083a8f3ad25d5b6d39a6
_util.cpp https://github.com/matplotlib/matplotlib/pull/9763/files#diff-552bb53e56fa3332c2db624ec14c674659936caec4a3a578c2a138c25d94c144
_util.h https://github.com/matplotlib/matplotlib/pull/9763/files#diff-b48bc91c822c87b42acf6daabf63eff89f4c70629d285e1cf8e40ee51b98f4d9
.appveyor.ymlhttps://github.com/matplotlib/matplotlib/pull/9763/files#diff-e1ab4c3cec24f841948eb867754d4ad0b9b6d11eaa6b5bfbe0357aceb0a49eff
View file https://github.com/anntzer/matplotlib/blob/95a9f28b5480d1c3658d37145e9f4e313c69899a/.appveyor.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/9763/{{ revealButtonHref }}
https://github.com/matplotlib/matplotlib/pull/9763/files#diff-e1ab4c3cec24f841948eb867754d4ad0b9b6d11eaa6b5bfbe0357aceb0a49eff
https://github.com/matplotlib/matplotlib/pull/9763/files#diff-e1ab4c3cec24f841948eb867754d4ad0b9b6d11eaa6b5bfbe0357aceb0a49eff
https://github.com/matplotlib/matplotlib/pull/9763/files#diff-e1ab4c3cec24f841948eb867754d4ad0b9b6d11eaa6b5bfbe0357aceb0a49eff
.circleci/config.ymlhttps://github.com/matplotlib/matplotlib/pull/9763/files#diff-78a8a19706dbd2a4425dd72bdab0502ed7a2cef16365ab7030a5a0588927bf47
View file https://github.com/anntzer/matplotlib/blob/95a9f28b5480d1c3658d37145e9f4e313c69899a/.circleci/config.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/9763/{{ revealButtonHref }}
https://github.com/matplotlib/matplotlib/pull/9763/files#diff-78a8a19706dbd2a4425dd72bdab0502ed7a2cef16365ab7030a5a0588927bf47
https://github.com/matplotlib/matplotlib/pull/9763/files#diff-78a8a19706dbd2a4425dd72bdab0502ed7a2cef16365ab7030a5a0588927bf47
https://github.com/matplotlib/matplotlib/pull/9763/files#diff-78a8a19706dbd2a4425dd72bdab0502ed7a2cef16365ab7030a5a0588927bf47
https://github.com/matplotlib/matplotlib/pull/9763/files#diff-78a8a19706dbd2a4425dd72bdab0502ed7a2cef16365ab7030a5a0588927bf47
.travis.ymlhttps://github.com/matplotlib/matplotlib/pull/9763/files#diff-6ac3f79fc25d95cd1e3d51da53a4b21b939437392578a35ae8cd6d5366ca5485
View file https://github.com/anntzer/matplotlib/blob/95a9f28b5480d1c3658d37145e9f4e313c69899a/.travis.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/9763/{{ revealButtonHref }}
https://github.com/matplotlib/matplotlib/pull/9763/files#diff-6ac3f79fc25d95cd1e3d51da53a4b21b939437392578a35ae8cd6d5366ca5485
https://github.com/matplotlib/matplotlib/pull/9763/files#diff-6ac3f79fc25d95cd1e3d51da53a4b21b939437392578a35ae8cd6d5366ca5485
https://github.com/matplotlib/matplotlib/pull/9763/files#diff-6ac3f79fc25d95cd1e3d51da53a4b21b939437392578a35ae8cd6d5366ca5485
https://github.com/matplotlib/matplotlib/pull/9763/files#diff-6ac3f79fc25d95cd1e3d51da53a4b21b939437392578a35ae8cd6d5366ca5485
https://github.com/matplotlib/matplotlib/pull/9763/files#diff-6ac3f79fc25d95cd1e3d51da53a4b21b939437392578a35ae8cd6d5366ca5485
https://github.com/matplotlib/matplotlib/pull/9763/files#diff-6ac3f79fc25d95cd1e3d51da53a4b21b939437392578a35ae8cd6d5366ca5485
https://github.com/matplotlib/matplotlib/pull/9763/files#diff-6ac3f79fc25d95cd1e3d51da53a4b21b939437392578a35ae8cd6d5366ca5485
examples/misc/font_indexing.pyhttps://github.com/matplotlib/matplotlib/pull/9763/files#diff-de6734a2e78612c45b5acc223ccb3e2e4d851f0d145d315dbc7f8ab35b3c0dd6
View file https://github.com/anntzer/matplotlib/blob/95a9f28b5480d1c3658d37145e9f4e313c69899a/examples/misc/font_indexing.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/9763/{{ revealButtonHref }}
https://github.com/matplotlib/matplotlib/pull/9763/files#diff-de6734a2e78612c45b5acc223ccb3e2e4d851f0d145d315dbc7f8ab35b3c0dd6
examples/misc/ftface_props.pyhttps://github.com/matplotlib/matplotlib/pull/9763/files#diff-f50b0010ad41d20cc2a51e8e21c6f30f7ac86cfa5ad9d25ee2a932d61e0dee1c
View file https://github.com/anntzer/matplotlib/blob/95a9f28b5480d1c3658d37145e9f4e313c69899a/examples/misc/ftface_props.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/9763/{{ revealButtonHref }}
examples/text_labels_and_annotations/font_table_ttf_sgskip.pyhttps://github.com/matplotlib/matplotlib/pull/9763/files#diff-89b2de6f5477c6d5d4e67b6f61866bd84193a015a877c48f51bfbff131772026
View file https://github.com/anntzer/matplotlib/blob/95a9f28b5480d1c3658d37145e9f4e313c69899a/examples/text_labels_and_annotations/font_table_ttf_sgskip.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/9763/{{ revealButtonHref }}
https://github.com/matplotlib/matplotlib/pull/9763/files#diff-89b2de6f5477c6d5d4e67b6f61866bd84193a015a877c48f51bfbff131772026
https://github.com/matplotlib/matplotlib/pull/9763/files#diff-89b2de6f5477c6d5d4e67b6f61866bd84193a015a877c48f51bfbff131772026
https://github.com/matplotlib/matplotlib/pull/9763/files#diff-89b2de6f5477c6d5d4e67b6f61866bd84193a015a877c48f51bfbff131772026
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/9763/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.