Skip to content
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

MarkupText: Use Cairo to handle gradients #1062

Closed
PhilippImhof opened this issue Feb 27, 2021 · 5 comments
Closed

MarkupText: Use Cairo to handle gradients #1062

PhilippImhof opened this issue Feb 27, 2021 · 5 comments
Assignees
Labels
enhancement Additions and improvements in general

Comments

@PhilippImhof
Copy link
Member

Enhancement proposal

When using gradients in MarkupText we have Pango render the text to an SVG. We then load the SVG into a SVGMobject and apply the gradient to the characters. This has two major drawbacks:

  • the gradient is done on a per-character basis, i.e. every character has one solid color; the quality of the gradient therefore depends largely on the length of the text to which it is applied
  • with ligatures, the number of paths does not correspond to the number of characters, so the user will have to specify an offset to compensate for this, e.g. fl counts for two characters but might be rendered as a single glyph
  • similar problems arise with underline, double underline, overline and strikethrough, because those lines will also be sub-paths of the SVGMobject
@PhilippImhof PhilippImhof added the enhancement Additions and improvements in general label Feb 27, 2021
@naveen521kk
Copy link
Member

I would like to have this issue in the other repo https://github.com/ManimCommunity/ManimPango, and the issue here should be about SVGMobject supporting them.

@PhilippImhof
Copy link
Member Author

OK fine for me, because in this case (contrary to the other one) we will probably not need to change the markup class. I will take care of it later.

@PhilippImhof
Copy link
Member Author

Closing the issue. It is moved to ManimCommunity/ManimPango#33

@naveen521kk
Copy link
Member

you could have used Transfer Issue button :)

@PhilippImhof
Copy link
Member Author

Oh that's neat. Didn't even notice it. They should have made it even smaller :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Additions and improvements in general
Projects
None yet
Development

No branches or pull requests

2 participants