Expand description
Render an SVG document to any backend implementing RenderSink.
Vello support is enabled by default. Raster images require a custom
RenderSink::draw_image implementation.
This currently lacks support for a number of important SVG features.
This is also intended to be the preferred integration between Vello and usvg, so consider contributing if you need a feature which is missing.
§Usage
let svg = r#"<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
<circle cx="50" cy="50" r="40" fill="red"/>
</svg>"#;
let scene = vello_svg::render(svg).expect("valid SVG");Use append or append_tree to render into an existing scene or custom sink.
§Unsupported features
Unsupported or incomplete features include:
- clipping beyond a single path
- masking
- filter effects
- group background
- path shape-rendering
- patterns
Re-exports§
Modules§
Enums§
- Error
- Triggered when there is an issue parsing user input.
Traits§
- Render
Sink - A rendering backend for SVG documents.
Functions§
- append
- Append an SVG to a
RenderSink, with default error handling. - append_
tree - Append an
usvg::Treeto aRenderSink, with default error handling. - append_
tree_ with - Append an
usvg::Treeto aRenderSink, with user-provided error handling logic. - append_
tree_ with_ transform - Append an
usvg::Treeto aRenderSinkwith a base transform applied to all elements. - append_
with - Append an SVG to a
RenderSink, with user-provided error handling logic. - render
vello - Render an SVG string to a new Vello scene.
- render_
tree vello - Render a
usvg::Treeto a new Vello scene.