XML technologies / SVG / Using complex graphic elements and formatting / Using paths correctly / Overview of path commands
(Excerpt from “Das Einsteigerseminar SVG — Webgrafiken mit XML” by Helma Spona)
Many more path commands exist beyond those used so far. All will therefore be explained with examples below. SVG supports these path commands:
M(Moveto) jumps to the position given as parameters, usually setting the path’s start. It can also jump elsewhere within the path, for example to create dashed lines.Z(Closepath) closes the path by drawing a straight line to its start. WritingZorzmakes no difference.L(Lineto) draws a line to the position specified as parameters.H(Horizontal Lineto) draws a horizontal line.V(Vertical Lineto) draws a vertical line.C(Curveto) draws a cubic Bézier curve.S(Shorthand/Smooth Curveto) draws a cubic Bézier curve.Q(Quadratic Bézier Curveto) creates a quadratic Bézier curve.T(Shorthand/smooth quadratic Bézier curveto) creates a quadratic Bézier curve.A(Elliptical Arc) creates an elliptical curve.
The Moveto command
The Moveto or M command jumps to a position within the path, changing position without starting a new path. Its syntax is simple:
M x y
Here, x/y specifies the destination.
The ClosePath command
The Z command closes a path. Like M, it can occur several times in one path. It closes to the position of the last M command before the Z command. It has no parameters, so simply write Z.
Copyright © verlag moderne industrie GmbH 2001
You may print the online version for your private use.
Otherwise, this chapter from “Das Einsteigerseminar SVG — Webgrafiken mit XML” is subject to the same conditions as the bound edition. The work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
verlag moderne industrie GmbH, Justus-von-Liebig-Straße 1, D-86899 Landsberg/Lech, fon ++49 (0) 81 91 / 125 – 0, leserservice(at)mi-verlag.de