Title: [MNT]: Add more tests for `FT2Font.load_char` · Issue #27115 · matplotlib/matplotlib · GitHub
Open Graph Title: [MNT]: Add more tests for `FT2Font.load_char` · Issue #27115 · matplotlib/matplotlib
X Title: [MNT]: Add more tests for `FT2Font.load_char` · Issue #27115 · matplotlib/matplotlib
Description: Summary In #26989 I could remove the lines warning that a glyph was missing without breaking any tests: matplotlib/src/ft2font.cpp Lines 582 to 585 in 112a225 bool was_found = load_char_with_fallback(ft_object_with_glyph, final_glyph_ind...
Open Graph Description: Summary In #26989 I could remove the lines warning that a glyph was missing without breaking any tests: matplotlib/src/ft2font.cpp Lines 582 to 585 in 112a225 bool was_found = load_char_with_fallba...
X Description: Summary In #26989 I could remove the lines warning that a glyph was missing without breaking any tests: matplotlib/src/ft2font.cpp Lines 582 to 585 in 112a225 bool was_found = load_char_with_fallba...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/27115
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[MNT]: Add more tests for `FT2Font.load_char`","articleBody":"### Summary\r\n\r\nIn #26989 I could remove the lines warning that a glyph was missing without breaking any tests:\r\nhttps://github.com/matplotlib/matplotlib/blob/112a2257387b72490f7ab0e0b428a2abd2c39374/src/ft2font.cpp#L582-L585\r\nhttps://github.com/matplotlib/matplotlib/blob/112a2257387b72490f7ab0e0b428a2abd2c39374/src/ft2font.cpp#L594-L596\r\n\r\nI didn't remove the warnings cause I don't think we test what [Ft2Font.load_char](https://matplotlib.org/devdocs/api/ft2font.html#matplotlib.ft2font.FT2Font.load_char) does when given a missing glyph. It's used in three places in the library: \r\n* mathtext: https://github.com/matplotlib/matplotlib/blob/978b402159bd40663bcf74d3beef62b009010083/lib/matplotlib/_mathtext.py#L329-L333\r\n* textpath: https://github.com/matplotlib/matplotlib/blob/978b402159bd40663bcf74d3beef62b009010083/lib/matplotlib/textpath.py#L163-L167\r\n* backend_pdf: https://github.com/matplotlib/matplotlib/blob/978b402159bd40663bcf74d3beef62b009010083/lib/matplotlib/backends/backend_pdf.py#L661-L664\r\n\r\n### Proposed fix\r\n\r\nMinimally, there should be at least two tests of how `load_char` /the methods calling it handle missing glyphs - mathtext may be a good start. There should be one test for each codepath that triggers a missing glyph error. It would probably also be good to add some more tests for TextPath -\u003e it mostly seems to be tested via gallery examples. ","author":{"url":"https://github.com/story645","@type":"Person","name":"story645"},"datePublished":"2023-10-17T04:14:19.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/27115/matplotlib/issues/27115"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6f344fa8-a6a0-79c2-1358-978123d2e2bb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CB06:176010:72C85E:999D35:6A530389 |
| html-safe-nonce | b1ddf6ca4093baa34252c9d12c0f99df9203598aa2261525db7387df013ca129 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjA2OjE3NjAxMDo3MkM4NUU6OTk5RDM1OjZBNTMwMzg5IiwidmlzaXRvcl9pZCI6Ijg1ODk5OTUwNjY5MjMzNTI5NjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5998cdb03a2c129535daf3ade1c753eccc2455508ea12ffe84bb445469857896 |
| hovercard-subject-tag | issue:1946502506 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/matplotlib/matplotlib/27115/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7bc5d95dbd71dbea185fcb277b0e75a85f0a4947b0bce1e52fa3856c683a6c3c/matplotlib/matplotlib/issues/27115 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7bc5d95dbd71dbea185fcb277b0e75a85f0a4947b0bce1e52fa3856c683a6c3c/matplotlib/matplotlib/issues/27115 |
| og:image:alt | Summary In #26989 I could remove the lines warning that a glyph was missing without breaking any tests: matplotlib/src/ft2font.cpp Lines 582 to 585 in 112a225 bool was_found = load_char_with_fallba... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | story645 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| 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 | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width