Skip to content

TexText does not display #2358

Open
Open
@bigboyconst

Description

@bigboyconst

Description of the bug

Whenever I try to use a TexText object in manimgl, regardless of what I do and what parameters I try to set, the text never shows up on screen.

I tried to dig through the source code but found nothing that immediately jumped out to me.

Code:
Here's an example I made with some extra information and me trying to set as many parameters explicitly to make sure no default values were the root cause.

from manimlib import *
from manimlib.scene.interactive_scene import *

class ShowBrokenText(InteractiveScene):
    def construct(self):
        broken_text = TexText("Hello, World!", font_size=48)
        # Try to explicitly set text parameters
        broken_text.set_stroke(color=WHITE, width=1, opacity=1)
        broken_text.set_color(WHITE, opacity=1)
        broken_text.set_fill(WHITE, 1)
        broken_text.set_flat_stroke()

        broken_center_dot = Dot(broken_text.get_center()).set_color(RED)

        # This one works fine
        working_text = Text("Hello, World!", font_size=48).next_to(broken_text, DOWN)
        working_center_dot = Dot(working_text.get_center()).set_color(GREEN)

        self.add(broken_text, working_text, broken_center_dot, working_center_dot)

What is displayed:
This specific code displays the Text object below where the TexText object should be, and two dots indicating their centers. The dots confirm that it's not because the TexText object is placed off screen for some reason.

One thing that may end up pointing towards the source of the issue is that when the text is added, it starts initially near the bottom of the screen, but the moment that my cursor hovers over the window, the text jumps up to the middle of the screen (as it should).

Additional context

I'm using ManimGL v1.7.2, running on Windows 11, and programming through VSCode. I'm also running on Python 3.11.9 since I was getting errors when I tried using manimgl on 3.13.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions