chiark / gitweb /
fix gamut thing
[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     /gn     gm    1 add   def
37     /kmx    knx   1 sub   def
38     /kmy    kny   1 sub   def
39
40     /stridox  gridox  gn  div  def
41     /stridoy  gridoy  gn  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 gm {            /magenta exch def
56     0 1 gm {            /cyan    exch def
57
58     gsave
59
60         magenta                 stridox mul
61         cyan    neg gm 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            gn div
69                  magenta        gn div
70                  yellow         gn div
71
72                 klist
73                  blackx
74                  blacky  knx mul add
75                  get base 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 gm {                    /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 /base 16 def
113
114 /gm 16 def
115
116 /knx 2 def
117 /kny 2 def
118
119 /klist [ 0 1 2 3 ] def
120 /ylist [ 0 1 2 3 5 8 11 15 ] def
121
122 /gridox szox def
123 /gridoy szoy def
124
125 %ranges
126
127 /ranges2 {
128
129 /gm 8 def
130
131 /gridox szox 2 div margbx sub def
132 /gridoy szoy 2 div margby sub def
133
134 0 1 1 { /yellowpage exch def
135 0 1 1 { /yellowx exch def
136 0 1 1 { /yellowy exch def
137
138 /yellowix
139   yellowpage            4 mul
140   yellowy    neg 1 add  2 mul add
141   yellowx                     add def
142
143 gsave
144  yellowx  gridox margbx add  mul
145  yellowy  gridoy margby add  mul
146  translate
147
148  /yellow  ylist yellowix get  def
149
150  someyellow
151
152 grestore
153
154 } for
155 } for
156 showpage
157 } for
158
159 } def
160
161 /klist [ 4 5 6 7 ] def   ranges2
162 /klist [ 8 10 13 15 ] def ranges2