Unconfuse fontsize calculation#4696
Open
rambip wants to merge 37 commits intoManimCommunity:mainfrom
Open
Conversation
Updated text scaling and font size handling in text_mobject.py.
Refactor font size handling in SingleStringMathTex class to use initial font size for calculations.
Updated DEFAULT_FONT_SIZE_IN_WOLRD_SPACE value and corrected its description.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Refactor imports in tex_mobject.py to use wildcard import for constants.
Agent-Logs-Url: https://github.com/rambip/manim/sessions/3da47ac5-56e2-4f83-9bea-469050a8cdad Co-authored-by: rambip <62420525+rambip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rambip/manim/sessions/802ae0bf-ed97-478a-b7eb-923ac4efd2a2 Co-authored-by: rambip <62420525+rambip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rambip/manim/sessions/802ae0bf-ed97-478a-b7eb-923ac4efd2a2 Co-authored-by: rambip <62420525+rambip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rambip/manim/sessions/802ae0bf-ed97-478a-b7eb-923ac4efd2a2 Co-authored-by: rambip <62420525+rambip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rambip/manim/sessions/e8302477-8de0-4944-8d6d-bf2a4da1945f Co-authored-by: rambip <62420525+rambip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rambip/manim/sessions/e8302477-8de0-4944-8d6d-bf2a4da1945f Co-authored-by: rambip <62420525+rambip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rambip/manim/sessions/e8302477-8de0-4944-8d6d-bf2a4da1945f Co-authored-by: rambip <62420525+rambip@users.noreply.github.com>
…ests Add regression tests for EM dash world-space width in Text and MathTex
for more information, see https://pre-commit.ci
Change precision of width assertion for em dash in test.
Update test for em dash width with specific font.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Updated test for em dash width to select available fonts dynamically.
for more information, see https://pre-commit.ci
Author
|
I'm now happy with the implementation. All previous tests pass and I added a few tests to measure the size of the reference EM on the screen. It matches to at least two decimal points. and I ended up with a naming I'm actually happy with. |
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
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.
Overview: What does this pull request change?
Motivation and Explanation: Why and how do your changes improve the library?
This is my attempt to fix #4690 : clarify the fontsize calculation logic so that future contributors and maintainers can reason about it.
Links to added or changed documentation pages
N/A
Further Information and Comments
Existing tests should already cover this refactor, and I explain my reasoning in the issue. But it might be good to add tests clarifying what "DEFAULT_FONTSIZE_IN_WORLD_SPACE" is: just render a "—" in Text and Latex, and check size in world space. What do you think ?
@uwezi do you think it's clearer now ?