chiark / gitweb /
format
[pandemic-rising-tide.git] / cmyk.ps
1 %!
2
3 /paperx 595 def
4 /papery 842 def
5
6 /margin 18 def
7
8 /printareax paperx margin 2 mul sub def
9 /printareay papery margin 2 mul sub def
10
11 /textx 12 def
12 /texty 12 def
13
14 /szox printareax textx sub def
15 /szoy printareay texty sub def
16
17 % o = outer, i = inner, f = final
18
19 /margox 5 def
20 /margoy 5 def
21
22 /margix 2 def
23 /margiy 2 def
24
25 % strid = stride
26
27 /someyellow {
28     
29     /n      m     1 add   def
30     /kmx    knx   1 sub   def
31     /kmy    kny   1 sub   def
32
33     /stridox  szox  n  div  def
34     /stridoy  szoy  n  div  def
35
36     /szix  stridox  margox sub  def
37     /sziy  stridoy  margoy sub  def
38
39     /stridix  szix  knx  div def
40     /stridiy  sziy  kny  div def
41
42     /szfx  stridix  margix sub  def
43     /szfy  stridiy  margiy sub  def
44
45     margin margin translate
46     textx  0      translate
47
48     0 1 m {             /magenta exch def
49     0 1 m {             /cyan    exch def
50
51     gsave
52
53         magenta                 stridox mul
54         cyan    neg m add       stridoy mul  translate
55
56         szfy setlinewidth
57
58         0 1 kmx {       /blackx exch def
59         0 1 kmy {       /blacky exch def
60
61                 cyan            n div
62                  magenta        n div
63                  yellow         n div
64
65                  blackx         knx div
66                  blacky  add    kny div
67                  kfact mul  kbase add
68
69                  setcmykcolor
70
71                 blackx                          stridix mul
72                  blacky  neg kmy add            stridiy mul
73                  szfy -0.5 mul add
74                  moveto
75
76                 szfx 0 rlineto stroke
77
78         } for
79         } for
80
81     grestore
82
83     } for
84     } for
85
86     0 setgray
87
88 } def
89
90 /ranges {
91
92     0 1 m {                     /yellow  exch def
93         someyellow
94
95         /Helvetica findfont 18 scalefont setfont
96         0 0 moveto
97         (Y) show
98         yellow (___) cvs show
99         showpage
100     } for
101
102 } def
103
104 /m 16 def
105
106 /knx 1 def
107 /kny 3 def
108
109 /kbase 0 def
110 /kfact 0.5 def
111
112 ranges