-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add tests for most of FT2Font, and fix some bugs #28765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The only externally-available API here is `draw_rect_filled` and conversion to NumPy arrays via the buffer protocol.
Also, ensure some internals are initialized/cleared.
Also, correct the reading of creation and modified dates.
`PyArray_SimpleNewFromData` does not copy its input data, and the `std::vector` is a local variable that disappears after the C++ method returns.
oscargus
approved these changes
Sep 3, 2024
QuLogic
added a commit
to QuLogic/matplotlib
that referenced
this pull request
Sep 6, 2024
Working on matplotlib#28765, I realized that we don't need an external font to test font fallback, as `cmr10`, and related, fonts have fairly low coverage compared to `DejaVu Sans`. Thus font fallback can easily be tested by starting with `cmr10`, and pulling additional characters from `DejaVu Sans`. In addition, this change increases unique characters in the figure to 587, which triggers some code paths for tables that are limited to 256 characters.
QuLogic
added a commit
to QuLogic/matplotlib
that referenced
this pull request
Sep 6, 2024
Working on matplotlib#28765, I realized that we don't need an external font to test font fallback, as `cmr10`, and related, fonts have fairly low cov 8000 erage compared to `DejaVu Sans`. Thus font fallback can easily be tested by starting with `cmr10`, and pulling additional characters from `DejaVu Sans`. In addition, this change increases unique characters in the figure to 491, which triggers some code paths for tables that are normally limited to 256 characters.
1 task
It looks like this PR is causing the code in 5f2a89a to fail to compile on the older OSX targets we use with errors that look like
|
No, that's been failing since it was merged; it's not related to this PR specifically. |
QuLogic
added a commit
to QuLogic/matplotlib
that referenced
this pull request
Oct 16, 2024
Working on matplotlib#28765, I realized that we don't need an external font to test font fallback, as `cmr10`, and related, fonts have fairly low coverage compared to `DejaVu Sans`. Thus font fallback can easily be tested by starting with `cmr10`, and pulling additional characters from `DejaVu Sans`. In addition, this change increases unique characters in the figure to 491, which triggers some code paths for tables that are normally limited to 256 characters.
QuLogic
added a commit
to QuLogic/matplotlib
that referenced
this pull request
Dec 3, 2024
Working on matplotlib#28765, I realized that we don't need an external font to test font fallback, as `cmr10`, and related, fonts have fairly low coverage compared to `DejaVu Sans`. Thus font fallback can easily be tested by starting with `cmr10`, and pulling additional characters from `DejaVu Sans`. In addition, this change increases unique characters in the figure to 491, which triggers some code paths for tables that are normally limited to 256 characters.
QuLogic
added a commit
to QuLogic/matplotlib
that referenced
this pull request
Dec 11, 2024
Working on matplotlib#28765, I realized that we don't need an external font to test font fallback, as `cmr10`, and related, fonts have fairly low coverage compared to `DejaVu Sans`. Thus font fallback can easily be tested by starting with `cmr10`, and pulling additional characters from `DejaVu Sans`. In addition, this change increases unique characters in the figure to 491, which triggers some code paths for tables that are normally limited to 256 characters.
QuLogic
added a commit
to QuLogic/matplotlib
that referenced
this pull request
Dec 18, 2024
Working on matplotlib#28765, I realized that we don't need an external font to test font fallback, as `cmr10`, and related, fonts have fairly low coverage compared to `DejaVu Sans`. Thus font fallback can easily be tested by starting with `cmr10`, and pulling additional characters from `DejaVu Sans`. In addition, this change increases unique characters in the figure to 491, which triggers some code paths for tables that are normally limited to 256 characters.
QuLogic
added a commit
to QuLogic/matplotlib
that referenced
this pull request
Dec 19, 2024
Working on matplotlib#28765, I realized that we don't need an external font to test font fallback, as `cmr10`, and related, fonts have fairly low coverage compared to `DejaVu Sans`. Thus font fallback can easily be tested by starting with `cmr10`, and pulling additional characters from `DejaVu Sans`. In addition, this change increases unique characters in the figure to 491, which triggers some code paths for tables that are normally limited to 256 characters.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR summary
I tried to cross-compare these against something external, like FontForge or
fonttools
, though a lot are just "make sure it keeps working the same way".I left out
FT2Font.get_ps_font_info
because it doesn't appear that any of shipped fonts would return anything butNone
.Additionally, this fixes a few bugs I've found:
FT2Font.set_text
is a NumPy array with a data pointer that was freed, meaning any reading of it would read an invalid pointer. Apparently, we never use this return value internally, so it's never been a problem, but it has existed since about forever.head
table fromFT2Font.get_sfnt_table
were signed, which is incorrect, as they should still be positive now, given that the epoch is some time in 1901. I'm not sure if we want to consider changing these todatetime
s instead, but that would be an API change, so I didn't do that.I want to also add some more tests for fallbacks, but haven't finished that yet.
PR checklist