Expand description
Specified types for SVG Path.
MacrosΒ§
- parse_
arguments π
StructsΒ§
- Path
Parser π - SVG Path parser.
- Path
Traversal πState - For internal SVGPath normalization.
- SVGPath
Data - The SVG path data.
EnumsΒ§
- Allow
Empty - Whether to allow empty string in the parser.
FunctionsΒ§
- parse_
command_ πpoint_ abs - Parse a pair of numbers that describes the absolutely positioned endpoint.
- parse_
command_ πpoint_ rel - Parse a pair of numbers that describes the relatively positioned endpoint.
- 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Β§
- Coord
Pair - The path coord type.
- Path
Command - 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.