A reference to a new empty path can be created using fz_new_path:
Once a path exists, commands can be added to it. The first command must always be a `move'.
Once we have moved to a point, subsequent commands can be added, such as lines, quads (quadratic beziers) and curves (cubic beziers).
In addition, we have 2 functions for adding curves (cubic beziers) where one of the control points is coincident with the neighbouring endpoints. These functions mirror the usage in PDF, but offer no benefits other than convenience as such curves are detected automatically as part of an fz_curveto call.
At any point after the initial move, we can close the path using fz_closepath:
After a path has been closed, the only acceptable next command is a move. A path need not be closed before a second or subsequent move is sent.
For details of exactly what each of these path segment types means, see “The PDF Reference Manual” or “The Postscript Language Reference Manual”.
Finally, we have one additional path construction function, fz_rectto. This appends a rectangle to the current path. This rectangle is equivalent to a move, 3 lines and a closepath, and so is the one exception to the rule that paths must begin with a move (as one is implicit within the rectangle command).
Finally, during path construction, the coordinate at which the notional path cursor has reached can be read using the fz_currentpoint function.