A path is started with a newpath command, which clears any previous path and prepares the system to start a new path. After a new path has been started, you must set the current point to somewhere on the page. Otherwise, how would PostScript know where you wanted to start from? This is done with the moveto command, which takes x and y co-ordinates as its arguments.
Postscript has a variety of commands to move the pen. For example, you can describe lines, arcs of circles, and Bezier curves. The most common command you will use is lineto, which draws a line from the current point to a point specified as it argument, and resets the current point.
The stroke command draw the path you have described. Alternately, the fill command fills the path with the current level of gray.
As you draw more paths, each one starting with a newpath , the objects will be drawn on top of each other in the order that they are drawn. Thus it is important that you think about the order in which you want to draw your paths.
![]() |
|