chiark / gitweb /
for test erk ?
[pandemic-rising-tide.git] / cmyk.ps
1 %!
2
3 %   16^3 x    0 .. 3       1 Y per page
4 %    8^3 x    4 .. 7       4 Y per page      8 = 0 2 4 6 8 10 12 15
5 %             8 10 13 15
6
7 /paperx 595 def
8 /papery 842 def
9
10 /margin 18 def
11
12 /printareax paperx margin 2 mul sub def
13 /printareay papery margin 2 mul sub def
14
15 /textx 12 def
16 /texty 12 def
17
18 /szox printareax textx sub def
19 /szoy printareay texty sub def
20
21 % o = outer, i = inner, f = final
22
23 /margox 5 def
24 /margoy 5 def
25
26 /margix 2 def
27 /margiy 2 def
28
29 /margbx 10 def
30 /margby 10 def
31
32 % strid = stride
33
34 /someyellow {
35     
36     /n      m     1 add   def
37     /kmx    knx   1 sub   def
38     /kmy    kny   1 sub   def
39
40     /stridox  gridox  n  div  def
41     /stridoy  gridoy  n  div  def
42
43     /szix  stridox  margox sub  def
44     /sziy  stridoy  margoy sub  def
45
46     /stridix  szix  knx  div def
47     /stridiy  sziy  kny  div def
48
49     /szfx  stridix  margix sub  def
50     /szfy  stridiy  margiy sub  def
51
52     margin margin translate
53     textx  0      translate
54
55     0 1 m {             /magenta exch def
56     0 1 m {             /cyan    exch def
57
58     gsave
59
60         magenta                 stridox mul
61         cyan    neg m add       stridoy mul  translate
62
63         szfy setlinewidth
64
65         0 1 kmx {       /blackx exch def
66         0 1 kmy {       /blacky exch def
67
68                 cyan            n div
69                  magenta        n div
70                  yellow         n div
71
72                 klist
73                  blackx
74                  blacky  knx mul add
75                  get m div
76
77                  setcmykcolor
78
79                 blackx                          stridix mul
80                  blacky  neg kmy add            stridiy mul
81                  szfy -0.5 mul add
82                  moveto
83
84                 szfx 0 rlineto stroke
85
86         } for
87         } for
88
89     grestore
90
91     } for
92     } for
93
94 } def
95
96 /ranges {
97
98     0 1 m {                     /yellow  exch def
99         someyellow
100
101     0 setgray
102     /Helvetica findfont 18 scalefont setfont
103     0 0 moveto
104     (Y) show
105     yellow (___) cvs show
106
107         showpage
108     } for
109
110 } def
111
112 /m 16 def
113
114 /knx 2 def
115 /kny 2 def
116
117 /klist [ 0 1 2 3 ] def
118 /ylist [ 0 1 2 3 5 8 11 15 ] def
119
120 /gridox szox def
121 /gridoy szoy def
122
123 %ranges
124
125 /ranges2 {
126
127 /m 8 def
128
129 /gridox szox 2 div margbx sub def
130 /gridoy szoy 2 div margby sub def
131
132 0 1 1 { /yellowpage exch def
133 0 1 1 { /yellowx exch def
134 0 1 1 { /yellowy exch def
135
136 /yellowix
137   yellowpage            4 mul
138   yellowy    neg 1 add  2 mul add
139   yellowx                     add def
140
141 gsave
142  yellowx  gridox margbx add  mul
143  yellowy  gridoy margby add  mul
144  translate
145
146  /yellow  ylist yellowix get  def
147
148  someyellow
149
150 grestore
151
152 } for
153 } for
154 showpage
155 } for
156
157 } def
158
159 /klist [ 7 8 9 15 ] def   ranges2
160 %/klist [ 4 5 6 7 ] def   ranges2
161 %/klist [ 8 10 13 15 ] def ranges2