Module svg_path

Source
Expand description

Specified types for SVG Path.

Macrosยง

parse_arguments ๐Ÿ”’

Structsยง

PathParser ๐Ÿ”’
SVG Path parser.
PathTraversalState ๐Ÿ”’
For internal SVGPath normalization.
SVGPathData
The SVG path data.

Enumsยง

AllowEmpty
Whether to allow empty string in the parser.

Functionsยง

parse_coord ๐Ÿ”’
Parse a pair of numbers into CoordPair.
parse_number ๐Ÿ”’
This is a special version which parses the number for SVG Path. e.g. โ€œM 0.6.5โ€ should be parsed as MoveTo with a coordinate of (โ€œ0.6โ€, โ€œ.5โ€), instead of treating 0.6.5 as a non-valid floating point number. In other words, the logic here is similar with that of tokenizer::consume_numeric, which also consumes the number as many as possible, but here the input is a Peekable and we only accept an integer of a floating point number.
skip_comma_wsp ๐Ÿ”’
Skip all svg whitespaces and one comma, and return true if |iter| hasnโ€™t finished.
skip_wsp ๐Ÿ”’
Skip all svg whitespaces, and return true if |iter| hasnโ€™t finished.

Type Aliasesยง

CoordPair
The path coord type.
PathCommand
The SVG path command. The fields of these commands are self-explanatory, so we skip the documents. Note: the index of the control points, e.g. control1, control2, are mapping to the control points of the Bรฉzier curve in the spec.