Skip to main content

parse_svg_path_d

Function parse_svg_path_d 

Source
pub fn parse_svg_path_d(d: &str) -> Result<SvgMultiPolygon, SvgPathParseError>
Expand description

Parse an SVG path d attribute string into a SvgMultiPolygon.

Each M/m command starts a new subpath (ring). All 14 SVG path commands are supported including arcs (converted to cubic beziers).

§Panics

Panics if the path tokenizer signals a command but then yields no token (an internal parser invariant that should not occur for any input).

§Errors

Returns an error if d is not a valid SVG path-data string.