chiark / gitweb /
before reorder to major K
[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 %    4^3 x    8 10 13 15   16 Y,C per page   4 = 0 5 10 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 3 def
116
117 /klist [ 0 1 2 3 4 5 ] def
118
119 /gridox szox def
120 /gridoy szoy def
121
122 ranges
123
124 /m 8 def
125 /klist [ 6 7 9 11 13 15 ] def
126 /ylist [ 0 2 5 7 8 10 12 15 ] def
127
128 /gridox szox 2 div margbx sub def
129 /gridoy szoy 2 div margby sub def
130
131 0 1 1 { /yellowpage exch def
132 0 1 1 { /yellowx exch def
133 0 1 1 { /yellowy exch def
134
135 /yellowix
136   yellowpage            4 mul
137   yellowy    neg 1 add  2 mul add
138   yellowx                     add def
139
140 gsave
141  yellowx  gridox margbx add  mul
142  yellowy  gridoy margby add  mul
143  translate
144
145  /yellow  ylist yellowix get  def
146
147  someyellow
148
149 grestore
150
151 /yellowix yellowix 1 add def
152
153 } for
154 } for
155 showpage
156 } for
157