Examples of Drawing Paths

5.4.1 Examples of Drawing Paths

The following PostScript source

%!

0 setlinewidth
72 72 scale 

newpath
1 1 moveto
1 3 lineto
4 3 lineto
4 1 lineto
3 1 lineto
2.5 1 .5 0 180 arc
closepath
stroke

showpage

creates the following diagram:

The following filled triangle shows how paths may be combined and drawn on top of each other:

%!

0.025 setlinewidth
72 72 scale
0.8 setgray

newpath
1 1 moveto
7 1 lineto
1 5 lineto
closepath
fill

0 setgray

newpath
1 1 moveto
7 1 lineto
1 5 lineto
closepath
stroke

showpage


David Maxwell, who is still writing this, would like to hear your comments and suggestions. And remember, parts of this manual are based on P.J. Weingartner's work: A First Guide to PostScript.