You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Manim Text class, if override the text2svg method use pycairo:
deftext2svg(self):
# anti-aliasingsize=self.size*10lsh=self.lsh*10ifself.font=='':
raiseException("text font can not be empty")
# file_name as a writable file object file_name=BytesIO()
surface=cairo.SVGSurface(file_name, 600, 400)
context=cairo.Context(surface)
context.set_font_size(size)
context.move_to(START_X, START_Y)
Manim creates the SVG file using ManimPango and later parses it. It should anyway save the file because Manim wants to Cache the SVG file for the future as well as the SVG parser doesn't support parsing file object directly (maybe you can make an issue about that in other repo).
In case, you are asking for use in any other project you should possibly wait until #28.
In Manim Text class, if override the text2svg method use pycairo:
It can manipulate SVG in memory.
Here is the reference:
pycairo svgsurface
surface.c
The text was updated successfully, but these errors were encountered: