Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Globally or Locally change manim default font color for Tex and Text

Manim Community v0.15.1

I am new to Manim.
I have been trying to change the font color of both Tex and Text objects without having to set the color for each Tex or Text object individually.

How do I change the font color for all Tex and Text objects within a scene or globally?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Here are some solutions that I believe I tried, but came up with nothing:

https://github.com/3b1b/manim/issues/1145

Change Text Colour Manim Community

I think this all has something to do with the following from Manim:
https://docs.manim.community/en/stable/installation/troubleshooting.html?highlight=config#config

Here is a code example I have:

from manim import *
class My_made_Up_Scene_Name(Scene):
    def construct(self):
        text_1 = Text("Text_1", font = "Arial", font_size = 50)

Where would I insert a scene-wide change of font color?

>Solution :

You can use the set_default method:

def construct(self):
    Text.set_default(font="Arial", font_size=50)
    text_1 = Text("Hello world!")
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading