]> git.lizzy.rs Git - plan9front.git/blob - sys/lib/ghostscript/zeroline.ps
aux/cpuid: decode family and model bitfields
[plan9front.git] / sys / lib / ghostscript / zeroline.ps
1 %!
2 %    Copyright (C) 1994 Aladdin Enterprises.  All rights reserved.
3
4 % This software is provided AS-IS with no warranty, either express or
5 % implied.
6
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.
10
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.
16
17 % $Id: zeroline.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
18 % zeroline.ps
19 % Test file to determine how other PostScript implementations handle
20 % filling zero-width lines under a variety of conditions.
21
22 % Add a small "fan" of zero-width lines at different angles to the path.
23 /fan
24  { currentpoint 100 0 rlineto
25    2 copy moveto 100 20 rlineto
26    2 copy moveto 100 100 rlineto
27    2 copy moveto 20 100 rlineto
28    moveto 0 100 rlineto
29  } def
30
31 % Append a rectangle to the current path.
32 /rectappend
33  { 4 -2 roll moveto 1 index 0 rlineto 0 exch rlineto
34    neg 0 rlineto closepath
35  } def
36 % Fill a rectangle.
37 /rectfill
38  { gsave newpath rectappend fill grestore
39  } def
40 % Stroke a rectangle.
41 /rectstroke
42  { gsave newpath rectappend stroke grestore
43  } def
44 % Clip to a rectangle.  Unlike the real rectclip,
45 % this clear the current path.
46 /rectclip
47  { newpath rectappend clip newpath
48  } def
49
50 40 40 translate
51
52 % Display fans of different colors on different backgrounds.
53 gsave
54 0 setgray
55 0 0 120 120 rectstroke
56 10 10 moveto fan fill
57 140 0 translate
58 0 setgray
59 0 0 120 120 rectstroke
60 0.8 setgray
61 10 10 moveto fan fill
62 140 0 translate
63 0 setgray
64 0 0 120 120 rectfill
65 1 setgray
66 10 10 moveto fan fill
67 grestore
68 0 140 translate
69
70 % Display rectangles with two edges coincident.
71 gsave
72 newpath
73 0 setgray
74 0 0 40 40 rectappend
75 0 0 20 20 rectappend
76 eofill
77 60 0 translate
78 0 0 40 40 rectappend
79 40 0 -20 20 rectappend
80 fill
81 grestore
82 0 60 translate
83
84 % Display superimposed lines.
85 gsave
86 /super
87  { currentpoint fan
88    2 copy moveto 20 0 rmoveto 50 0 rlineto
89    2 copy moveto 20 4 rmoveto 50 10 rlineto
90    2 copy moveto 20 20 rmoveto 50 50 rlineto
91    2 copy moveto 4 20 rmoveto 10 50 rlineto
92    moveto 0 20 rmoveto 0 50 rlineto
93  } def
94 0 setgray
95 0 0 moveto super fill
96 140 0 translate 0 0 moveto super eofill
97 grestore
98 0 140 translate
99
100 showpage