Skip to content

Write() creates strokes that do not scale with font_size or scale #4220

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

Open
realhackcraft opened this issue Apr 17, 2025 · 2 comments · May be fixed by #4222
Open

Write() creates strokes that do not scale with font_size or scale #4220

realhackcraft opened this issue Apr 17, 2025 · 2 comments · May be fixed by #4222

Comments

@realhackcraft
Copy link

Description of bug / unexpected behavior

When calling the Write() animation, the cool effect (the growing stroke) appears to be hard-coded and not respect my font_size or the scale property of my MObject.

Expected behavior

The increased stroke width of the Write() effect scales down if the text is smaller.

How to reproduce the issue

Code for reproducing the problem
        Tex.set_default(font_size=9.6)
        half = Tex("text goes here \frac{1}{2}")
        self.play(Write(half))

Additional media files

Images/GIFs
Output.mp4

Logs

Terminal output rendering issue, so imo log is irrelevant.

System specifications

System Details
  • OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)): macOS 15.4
  • RAM: 8GB
  • Python version (python/py/python3 --version):Python 3.12.7
  • Installed modules (provide output from pip list):
Package                Version
---------------------- -----------
av                     13.1.0
beautifulsoup4         4.13.3
click                  8.1.8
cloup                  3.0.7
cython                 3.0.12
decorator              5.2.1
glcontext              3.0.0
isosurfaces            0.1.2
manim                  0.19.0
manimpango             0.6.0
mapbox-earcut          1.0.3
markdown-it-py         3.0.0
mdurl                  0.1.2
moderngl               5.12.0
moderngl-window        3.1.1
networkx               3.4.2
numpy                  2.2.4
pillow                 11.1.0
pycairo                1.27.0
pydub                  0.25.1
pyglet                 2.1.3
pyglm                  2.8.1
pygments               2.19.1
pyobjc-core            11.0
pyobjc-framework-cocoa 11.0
rich                   14.0.0
scipy                  1.15.2
screeninfo             0.8.1
skia-pathops           0.8.0.post2
soupsieve              2.6
srt                    3.5.3
svgelements            1.9.6
tqdm                   4.67.1
typing-extensions      4.13.1
watchdog               6.0.0
LaTeX details
  • LaTeX distribution (e.g. TeX Live 2020): TeX Live 2025

Additional comments

@uwezi
Copy link
Contributor

uwezi commented Apr 18, 2025

try

        Tex.set_default(font_size=9.6)
        half = Tex("text goes here \frac{1}{2}")
        self.play(Write(half, stroke_width=20))

and then adapt it to your needs...

Explanation: Write() is a descendant from DrawBorderThenFill which has some additional attributes, which Write() inherits. See
https://docs.manim.community/en/stable/reference/manim.animation.creation.DrawBorderThenFill.html

@realhackcraft
Copy link
Author

I see. It would be great if the width could be a factor of the font size or scale, but this will work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

Successfully merging a pull request may close this issue.

2 participants