[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

#### 4.18.11.5 FVG Path

Defines a path. Paths are complex shapes that may or may not be filled. Paths can have multiple contours defined in each one, but they cannot currently carve holes in the path.

#### Defining the Shape

Example: This defines a path by first moving to a point, drawing a line relative to that point, and a second line relative to the end of the first line. The area defined by this path is then filled white with its outline painted red.

    <path d="M 100 100 L 300 100 L 200 300 z"
          stroke="#ff0000"
          fill="#ffffff" />

#### Differences from SVG

The FVG path command differs from its SVG relative in the following ways:

- Each command expects one, and only one, set of parameters. In SVG many commands allow you to specify repeated coordinates for the same command. This is currently not the case in FVG, though this limitation may be lifted in the future.
- SVG supports several curving commands, beziers, arcs, etc. These are not currently supported in FVG, though this limitation may be lifted in the future.

#### Allowed Parameters

Name | Required | Example | Description
`d` | yes | `d="M 100 100 L 300 100 L 200 300 z"` | Defines the countour of the path (see below).
`stroke` | no | `stroke="#ff0000"` | Turns on stroking of the shape, and sets the color. If this is not present, the shape will not be stroked. Either this value or ``fill'` must be present or the shape will be invisible.
`fill` | no | `fill="#ff0000"` | Turns on filling of the shape, and sets the color. If this is not present, the shape will not be filled. Either this value or ``stroke'` must be present or the shape will be invisible. Note that if a path is not closed, it will not be filled. A path's contour is closed by using the ``z'` command.

#### Path Commands

Name | Example | Description

`M` or `m`

`M 100 100`

Start a new sub-path at the given (x,y) coordinate. ``M'` (uppercase) indicates that absolute coordinates will follow; ``m'` (lowercase) indicates that relative coordinates will follow. If a relative moveto (``m'`) appears as the first element of the path, then it is treated as a pair of absolute coordinates. If a moveto is followed by multiple pairs of coordinates, the subsequent pairs are treated as implicit lineto commands.

`Z` or `z` | `z` | Close the current subpath by drawing a straight line from the current point to current subpath's initial point. A new contour (subpath) will start after this command is encountered. If this command is present at the end of a contour, then that path may be filled. ``Z'` (uppercase) and ``z'` (lowercase) produce the same result.
`L` or `l` | `L 200 200` | Draw a line from the current point to the given (x,y) coordinate which becomes the new current point. ``L'` (uppercase) indicates that absolute coordinates will follow; ``l'` (lowercase) indicates that relative coordinates will follow.
`H` or `h` | `H 300` | Draws a horizontal line from the current point (cpx,cpy) to (x,cpy), where "x" is the supplied x coordinate. ``H'` (uppercase) indicates that absolute coordinates will follow; ``h'` (lowercase) indicates that relative coordinates will follow. At the end of the command, the new current point becomes (x,cpy) for the final value of x.
`V` or `v` | `V 300` | Draws a vertical line from the current point (cpx,cpy) to (cpx,y), where "y" is the supplied y coordinate. ``V'` (uppercase) indicates that absolute coordinates will follow; ``v'` (lowercase) indicates that relative coordinates will follow. At the end of the command, the new point becomes (cpx,y) for the final value of y.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ]

This document was generated using texi2html 1.76.