Module svg_path

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_arc_radii πŸ”’
Parse a pair of numbers that describes the size of the ellipse that the arc is taken from.
parse_axis_end_abs πŸ”’
Parse a number that describes the absolutely positioned axis end point.
parse_axis_end_rel πŸ”’
Parse a number that describes the relatively positioned axis end point.
parse_command_end_abs πŸ”’
Parse a pair of numbers that describes the absolutely positioned end point.
parse_command_end_rel πŸ”’
Parse a pair of numbers that describes the relatively positioned end point.
parse_control_point_abs πŸ”’
Parse a pair of values that describe the absolutely positioned curve control point.
parse_control_point_rel πŸ”’
Parse a pair of values that describe the relatively positioned curve control point.
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.