manim/tests/test_text_mobject.py
Laith Bahodi 110d89f404
Use height to determine font_size instead of the _font_size attribute. (#1985)
* fix set_value and add some docs

* improve font_size property for tex/text_mobject.py

* add tests

* add more font_size tests

* round test_set_value_size)

* scale based on self._font_size

* add changing_font_size test

* rewrite test and add test i forgot to add

* improve hacky solution that didn't work

* add change font_size test for tex_mobject.py

* improve tests

* split into separate test

* remove component of old test

* fix docs

* simplify the setter
2021-08-31 22:44:25 +00:00

13 lines
397 B
Python

import pytest
from manim.mobject.svg.text_mobject import MarkupText, Text
def test_font_size():
"""Test that Text and MarkupText return the
correct font_size value after being scaled."""
text_string = Text("0").scale(0.3)
markuptext_string = MarkupText("0").scale(0.3)
assert round(text_string.font_size, 5) == 14.4
assert round(markuptext_string.font_size, 5) == 14.4