You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, ImageFont, FreeTypeFont and TransposedFont have type hints saying that getbbox() accepts bytearray, and ImageFont does as well for getlength(). However, if you try and use them, FreeTypeFont raises errors, and ImageFont returns zero width.
#9908 suggests removing the bytearray type hints.
This PR is the alternative, to start supporting that functionality instead.
I don't have a strong preference for which way we go. #9908 does have to adjust one of our tests when removing the type hints. That test was added in #3907.
Merging this PR will degrade performance by 26.18%
3 warnings
⚠️2 benchmarks are dominated by system calls
System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.
⚠️5 benchmarks with a significant change ran on different hardware
Their base and head results were measured on machines with a different CPU, core count or memory, so the changes might not come from the code. Run base and head on the same runner type.
⚠️5 benchmarks with a significant change ran in a different software environment
Their base and head results were measured with a different OS or toolchain, such as compiler, runtime or library versions, so the changes might come from this difference rather than from the code. Open an affected benchmark to see what changed.
No successful run was found on main (e188fea) during the generation of this report, so 9f8a597 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
This branch has not been deployed
No deployments
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
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.
Currently,
ImageFont,FreeTypeFontandTransposedFonthave type hints saying thatgetbbox()accepts bytearray, and ImageFont does as well forgetlength(). However, if you try and use them,FreeTypeFontraises errors, andImageFontreturns zero width.#9908 suggests removing the bytearray type hints.
This PR is the alternative, to start supporting that functionality instead.
I don't have a strong preference for which way we go. #9908 does have to adjust one of our tests when removing the type hints. That test was added in #3907.