ManimCommunity / ManimCommunity/manim
Rendering rtl text with gradient or t2g keywords on Text object
- Dominant language
- Python
- Stars
- 40.9k
- Forks
- 3.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Description
## Description of bug / unexpected behavior
When passing a gradient or t2g arg to a Text object with a text from a rtl language it crashes
## Expected behavior
Get an object able to render
## How to reproduce the issue
Code for reproducing the problem
Uncomment the sections to get each of the errors. The gradient yield a silent error when rendering on screen, the t2g raises an error.
```py
%%manim -qm -v WARNING LaTeXMathFonts
class LaTeXMathFonts(Scene):
def construct(self):
hebrew_text = Text(
text="שלום עולם",
font="Times New Roman",
# t2g={
# '[1:-1]':(RED,BLUE),
# } BUG
# gradient = (RED, BLUE, GREEN) BUG
)
self.add(hebrew_text)
```
## Additional comments
It should simply render with the gradients color, use John Doe insted for the text argument to see the expected result
Contributor guide
Research direction
Start by running the provided Python reproduction with the Hebrew Text object, testing the gradient and t2g cases separately. Trace the Text rendering path for right-to-left text and compare it with the working “John Doe” example; done means both cases render without crashing and preserve the requested gradient colors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100