SVGRenderer¶
Qualified name: manimpango.renderer.SVGRenderer
- class SVGRenderer¶
SVGRenderer
is a renderer which renders theLayout
to an SVG file. Note that unlike other renderers thefile_name
is a required parameter.The
file_name
is opened when the class is initialised and only closed when the renderer is destroyed.- Parameters
Example
>>> import manimpango as mp >>> a = mp.SVGRenderer(100, 100, mp.Layout('hello'), 'test.svg') >>> a <SVGRenderer file_name='test.svg' width=100.0 height=100.0 layout=<Layout text='hello' markup=None> >>> a.render() True >>> a.save() 'test.svg'
- Raises
Exception – Any error reported by cairo.
Methods
render()
actually does the rendering.This method save's the SVG file.
- file_name¶
The file_name where the file is rendered onto
- height¶
The height of the SVG.
- render()¶
render()
actually does the rendering. Any error reported by Cairo is reported as an exception. If this method suceeds you can expect an valid SVG file atfile_name
.- Returns
True
if the function worked, elseFalse
.- Return type
- save()¶
This method save’s the SVG file. Note that this method is provided for compatibility with other renderers and does nothing.
- width¶
The width of the SVG.