Stroke – AMT Datasouth PAL User Manual
Page 192

stroke
186
stroke
Description
Renders the current path onto the page.
Usage
stroke
Comments
Drawing lines onto a page involves a two step process. First, the programmer must specify a path
consisting of the lines for PAL to draw. Second, the programmer uses the stroke operator to
instruct PAL to draw the lines.
Operators like lineto and moveto add information to a path contained within the current graphics
state. This path contains mathematical information concerning the drawing operations indicated by
the programmer. A path can consist of several sub-paths. Each sub-path consists of a series of
connected line segments. The moveto and closepath operators result in the termination of one
sub-path and the start of a new sub-path.
The closepath operator allows the programmer to specify a closed sub-path. If the programmer
terminates a sub-path using a moveto operator without a preceding closepath operator, PAL
creates an open sub-path.
PAL joins together the starting and ending points of closed sub-paths and smoothes the transition
between the connected line segments. For open sub-paths, PAL treats the start and end of the path
as simple line end points.
The stroke operator instructs PAL to render all the current sub-paths onto the page using the
current settings in the graphics state. The setlinewidth operator allows the programmer to alter the
graphics state setting which controls the width of the lines drawn by stroke. For open sub-paths,
setlinecap controls how PAL will render the start and end points of the sub-path.
Examples
The following example renders the diagram shown below the example. The example places the
lower left corner of the diagram at user coordinate 36,36 and the upper right at 54,56.