12 % cmyk printer sample test
14 % Copyright (C) 2019 Ian Jackson
16 % This program is free software: you can redistribute it and/or modify
17 % it under the terms of the GNU Affero General Public License as
18 % published by the Free Software Foundation, either version 3 of the
19 % License, or (at your option) any later version.
21 % This program is distributed in the hope that it will be useful,
22 % but WITHOUT ANY WARRANTY; without even the implied warranty of
23 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 % GNU Affero General Public License for more details.
26 % You can obtain a copy of the GNU Affero General Public License
27 % from <http://www.gnu.org/licenses/>.
31 % 9^3 0 1 2 9 pagex @ 9 x 9 x 3 = 243
34 % horiz M } M-C-K grid
36 % veert' K } M-C-K grid
38 % 5^3 3 4 1 page @ 5 x 5 x 5 x 2 = 250
39 % 5^3 6 8 1 page @ 5 x 5 x 5 x 2 = 250
44 % horiz M } M-C-K grid
45 % vert' C } M-C-K grid
55 /printareax paperx margin 2 mul sub def
56 /printareay papery margin 2 mul sub def
61 /szox printareax textx sub def
62 /szoy printareay texty sub def
64 % o = outer, i = inner, f = final
76 /digits [ (0) (1) (2) (3) (4) (5) (6) (7) (8) (9)
77 (a) (b) (c) (d) (e) (f) ] def
80 /ccfont /Helvetica findfont cctexty scalefont def
82 /Helvetica findfont texty scalefont setfont
84 /ifdebug { debug exch if } def
94 magentax stridox mul add
95 blackx stridix mul add
99 blacky neg kmy add stridiy mul
100 cyany neg gm add stridoy mul add
104 maxval gm div mul round cvi
118 /stridox gridox gn div def
119 /stridoy gridoy gn div def
121 /szix stridox margox sub def
122 /sziy stridoy margoy sub def
124 /stridix szix knx div def
125 /stridiy sziy kny div def
127 /szfx stridix margix sub def
128 /szfy stridiy margiy sub def
130 0 1 gm { /cyany exch def
131 0 1 kmy { /blacky exch def
133 0 1 gm { /magentax exch def
134 0 1 kmx { /blackx exch def
138 kentry_x kentry_y translate
148 0 szfy +0.5 mul moveto
149 szfx 0 rlineto stroke
152 /Helvetica findfont 6.5 scalefont setfont
162 6.5 mul 0 exch moveto
169 cyany 0 le blacky 0 le and { % top row
171 0 stridiy margoy add translate
191 0 printareay texty sub translate
198 margin margin translate
217 /ylist [ 0 1 2 3 5 8 11 15 ] def
224 yellowval (_) cvs show
227 /text_ul { text_yellow } def
231 cyany cmy_xy2val (_) cvs show
235 magentax cmy_xy2val (_) cvs show
236 magentax gm ge { maxvalshow } if
240 0 texty 0.25 mul translate
243 klist blacky get (_) cvs show
251 cctexty 0.75 mul texty -0.75 mul translate
253 0 1 1 { /copyrighty exch def
254 0 cctexty copyrighty neg mul moveto
255 copyright cyany neg gm add 2 mul copyrighty add get
257 neg exch neg exch rmoveto
269 0 1 maxval { /yellowval exch def
271 /ytext { digits yellow get } def
290 klist blackx get (_) cvs show
291 blackx knx 1 sub eq {
302 % stridox gn mul stridoy sub 0 translate
303 % stridix 0.5 mul -0.25 cctexty mul 0 exch moveto
317 0 texty 0.5 mul translate
318 cyany 0 le { 0 texty moveto text_yellow } if
324 /gridoy szoy margby 4 mul sub gn div def
326 0 1 gm { /yellowy exch def
328 /yellowval yellowy cmy_xy2val def
329 /text_u_p yellowy 1 ge def
332 yellowy neg gm add gridoy margby add mul
344 /klist [ 3 4 ] def ranges2
345 /klist [ 6 8 ] def /text_l_p false def ranges2