Expand description

Specified types for SVG Path.




  • Whether to allow empty string in the parser.
  • The path command absolute type.
  • 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.


  • Parse a pair of numbers into CoordPair.
  • 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 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.