-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add machinery for png-only, single-font mathtext tests. #19261
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
Conversation
horizontalalignment='center', verticalalignment='center') | ||
|
||
|
||
font_tests = list(filter(lambda x: x[1] is not None, enumerate(font_tests))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this filtering should stay right below the definition of font_tests
, because it's only a helper to sanetize the list (namely, to skip deleted tests).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added another commit (actually, a first commit) to factor out test skipping for all of mathtext_rendering
, mathtext_rendering_lightweight
, and mathfont_rendering
.
Just pytest.skip()ping them in the baseline_images fixture will avoid having to duplicate the logic in the upcoming png-only tests.
(For the sqrt test added below, each font adds ~2k to the size of the baseline image file.)
86f97b2
to
7f7fad9
Compare
@@ -114,6 +114,7 @@ | |||
# default) and only png outputs, in order to minimize the size of baseline | |||
# images. | |||
lightweight_math_tests = [ | |||
r'$\sqrt[ab]{123}$', # github issue #8665 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's up with the ab
alignment? It doesn't appear to follow the baseline to me, but align to top instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only appears with text.hinting = "none" (which is used by tests, but is not the default otherwise). I suspect this is just one of the vertical alignments problems mentioned in #5414.
Also manually testing with a large text size (e.g. 48) allows verifying that there is no top-alignment.
Thanks for doing this. Can't wait for it to be released, mainly for "noninteger bases in mathtext sqrt" which I ran in to recently. |
Alternate for #19201. png turns out to be heavier than svg-without-font embedding, but if we stick to a single font it's cheaper that testing all 5 fonts in svg. (For the sqrt test added below, each font adds ~2k to the size of the baseline image file.)
PR Summary
PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).