Path iterator for SVG path data.
This iterator accepts null-terminated character strings that contain data on a graphics path according to the W3C's SVG specification and converts them into path segments. An SVG path is a set of commands constisting of a single letter followed by parameters that are separated by whitespace or commas. The commands can be separated by whitespace. Whitespace and commas can be eliminated if doing so makes the path remain unambiguous. Uppercase commands use absolute coordinates, and lowercase commands use relative coordinates. A list of commands follows:
| Command | Parameters | Notes |
| M m | x y [x y ...] | Moves the starting point to (x,y). If further coordinates follow, they are interpreted as line commands. |
| L l | x y [x y ...] | Draws a line from the starting point to (x,y). Coordinates that follow cause further lines to be drawn. |
| H h | x [x ...] | Draws a horizontal line to the end point at x. Coordinates that follow cause further lines to be drawn. |
| V v | y [y ...] | Draws a vertical line to the end point at y. Coordinates that follow cause further lines to be drawn. |
| Q q | x0 y0 x y [x0 y0 x y ...] | Draws a quadratic curve from the current point to (x,y). Its control point has the coordinates (x0,y0). Coordinates that follow cause further curves to be drawn. |
| C c | x0 y0 x1 y1 x y [x0 y0 x1 y1 x y ...] | Draws a cubic curve from the current point to (x,y). Its control points have the coordinates (x0,y0) and (x1,y1). Coordinates that follow cause further curves to be drawn. |
| T t | x y [x y ...] | Draws a quadratic curve from the current point to (x,y). Its control point is the reflection of the previous command's control point relative to the current point. Coordinates that follow cause further curves to be drawn. |
| S s | x1 y1 x y [x1 y1 x y ...] | Draws a cubic curve from the current point to (x,y). This curve's first control point is the reflection of the previous command's second control point relative to the current point. This curve's second control point has the coordinates (x1,y1). Coordinates that follow cause further curves to be drawn. |
| A a | rx ry rot largearc sweep x y [rx ry rot largearc sweep x y ...] | Draws an arc from the current point to (x,y). The arc is described as part of an ellipse with X-radius rx and Y-radius ry and rotated rot degrees. The flags largearc (0: 180 degrees or less; 1: 180 degrees or greater) and sweep (0: counterclockwise; 1: clockwise) narrow the ellipse choices. Parameters that follow cause further arcs to be drawn. |
| Z z | (none) | Closes the path by drawing a line from the current point to the starting point. |