2 % Copyright (C) 1989, 1990, 1992, 1994, 1996 Aladdin Enterprises. All rights reserved.
4 % This software is provided AS-IS with no warranty, either express or
7 % This software is distributed under license and may not be copied,
8 % modified or distributed except as expressly authorized under the terms
9 % of the license contained in the file LICENSE in this distribution.
11 % For more information about licensing, please refer to
12 % http://www.ghostscript.com/licensing/. For information on
13 % commercial licensing, go to http://www.artifex.com/licensing/ or
14 % contact Artifex Software, Inc., 101 Lucas Valley Road #110,
15 % San Rafael, CA 94903, U.S.A., +1(415)492-9861.
17 % $Id: lines.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
18 % Test line rendering (stroke).
20 % Exercise the miter limit. The left column of lines should bevel at
21 % 90 degrees, the right column at 60 degrees.
29 { setmiterlimit 12 0 translate 0 0 moveto
31 { gsave 5 0 rlineto rotate 2.5 0 rlineto
32 gsave 0 setlinewidth 1 0 0 setrgbcolor stroke grestore
33 strokepath 0 setlinewidth stroke
42 % Exercise all the combinations of cap and join styles
43 % for one-line, two-line, and closed paths.
57 { {currentpoint lineto}
59 {3 7 lineto 5 1 lineto}
60 {3 7 lineto 6 3 lineto closepath}
62 { gsave 0 0 moveto exec
64 0.5 setlinewidth 1 0 0 setrgbcolor stroke
65 grestore 8 0 translate
67 grestore 35 0 translate
69 grestore 0 20 translate
74 { 8.5 72 mul 0 translate -1 1 scale
77 { 90 rotate 0 -9.75 72 mul translate
87 gsave xflip drawlines grestore showpage
88 gsave rot90 drawlines grestore showpage
89 gsave rot90 xflip drawlines grestore showpage
90 gsave drawlines rot180 showpage
91 gsave rot180 xflip drawlines grestore showpage
92 gsave rot270 drawlines grestore showpage
93 gsave rot270 xflip drawlines grestore showpage
96 % Here are some boundary conditions, contributed by Mark Rawling.
106 % [ 0.5 sqrt dup dup dup neg exch 0 0 ] concat % 45 rotate
111 0 0 moveto 0 10 lineto 10 0 lineto gsave stroke grestore
113 0 0 moveto 0 10 lineto 10 20 lineto gsave stroke grestore
115 10 0 moveto 10 10 lineto 0 20 lineto gsave stroke grestore
117 10 0 moveto 10 10 lineto 0 0 lineto gsave stroke grestore
121 0 20 moveto 0 10 lineto 10 20 lineto gsave stroke grestore
123 0 20 moveto 0 10 lineto 10 0 lineto gsave stroke grestore
125 10 20 moveto 10 10 lineto 0 0 lineto gsave stroke grestore
127 10 20 moveto 10 10 lineto 0 20 lineto gsave stroke grestore
128 grestore 60 0 translate
134 % Test narrow lines at a variety of angles.
139 /ray { gsave rotate 0 0 moveto rad 0 rlineto stroke grestore } def
142 gsave 0.5 setgray 0 0 rad 0 360 arc stroke grestore
153 [ [ 0 0.5 1 ] [ 1.5 2 2.5 ] [ 3 3.5 4 ] ]
158 grestore 0 250 translate