Here are the basic path commands. (Upper case for absolute
positioning, lower case relative positioning).
Command
Meaning
Parameters
M/m (moveTo)
Establish origin at point specified
Two parameters (x,y) giving
current position
L/l (lineTo)
Straight line path from current
position to point specified
Two parameters (x,y) giving
position of the line end point which becomes the current
position.
H/h (horizontalLineTo)
Horizontal line path from current
position to point specified
Single parameter giving X-coordinate
of the line end point.
The Y-coordinate is the same as that of the previous
current position. The new point becomes the current
position.
V/v (verticalLineTo)
Vertical line path from current
position to point specified
Single parameter giving Y-coordinate
of the line end point. The X-coordinate is the same
as that of the previous current position. The new
point becomes the current position.
Z/z (closePath)
Straight line back to original
point
No parameters.
Note: If the path being specified consists of many short
paths, it may well be more efficient to define the path
as relative positions from the previous current position.
Each command has a lower case equivalent which defines the
coordinate values as relative to the previous current position.
Code Example
SVG Image
<?xml version="1.0"
standalone="no"?>
Right-click
on the image to open the SVG viewer pop-up menu. Click
'view SVG' to display the image in a new, full window
to zoom & pan the image.
(SVG Viewer Tips)
<!DOCTYPE svg PUBLIC "-//W3C//DTD
SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">