-
Notifications
You must be signed in to change notification settings - Fork 0
/
traxSkel.ps
executable file
·227 lines (202 loc) · 3.72 KB
/
traxSkel.ps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
%!PS-Adobe
@ size = small, medium, big
dup
/small eq {
/fontSize 6 def
/boxWidth 34 def
/lineWidth 5 def
/shadowWidth 1 def
/boxDistance 2 def
pop
} {
/medium eq {
/fontSize 9 def
/boxWidth 50 def
/lineWidth 7 def
/shadowWidth 2 def
/boxDistance 3 def
} {
/fontSize 12 def
/boxWidth 68 def
/lineWidth 10 def
/shadowWidth 3 def
/boxDistance 4 def
} ifelse
} ifelse
% /boxWidth 68 def % the size of one tile
% /lineWidth 10 def % the width of the line on the tile
% /shadowWidth 3 def % the thickness of the tile (just to make it
% look nicer)
% /boxDistance 4 def % how far are two tiles apart... should be
% greater than shadowWidth
/Times-Roman findfont fontSize scalefont setfont
/blackGrayValue 0 def
/whiteGrayValue 1 def
/backgroundGrayValue 2 3 div def
/shadowGrayValue 0 def
/halfBoxWidth boxWidth 2 div def
/halfLineWidth lineWidth 2 div def
/entireBoxWidth boxWidth boxDistance add def
/negHalfLineWidth halfLineWidth neg def
/hbwm1 halfBoxWidth 1 sub def
/negHalfBoxWidth halfBoxWidth neg def
/nhbwm1 hbwm1 neg def
/xPos {
entireBoxWidth mul
} def
/yPos {
entireBoxWidth neg mul
} def
/fillbox { % stack: grayvalue
setgray fill
} def
/box {
newpath
halfBoxWidth halfBoxWidth moveto
halfBoxWidth negHalfBoxWidth lineto
negHalfBoxWidth negHalfBoxWidth lineto
negHalfBoxWidth halfBoxWidth lineto
closepath
backgroundGrayValue fillbox
move 0 ne {
gsave
% negHalfBoxWidth boxDistance add shadowWidth add
% halfBoxWidth boxDistance sub shadowWidth sub fontSize sub moveto
% blackGrayValue setgray move show
negHalfBoxWidth boxDistance add
halfBoxWidth boxDistance sub fontSize sub moveto
move 0 lt {
whiteGrayValue setgray move neg 3 string cvs show
} {
blackGrayValue setgray move 3 string cvs show
} ifelse
grestore
} if
} def
/shadowBox {
gsave
1 1 shadowWidth {
-1 -1 translate
newpath
halfBoxWidth halfBoxWidth moveto
halfBoxWidth negHalfBoxWidth lineto
negHalfBoxWidth negHalfBoxWidth lineto
negHalfBoxWidth halfBoxWidth lineto
closepath
shadowGrayValue fillbox
} for
grestore
} def
/angle {
newpath
negHalfLineWidth hbwm1 moveto
halfLineWidth hbwm1 lineto
hbwm1 hbwm1 hbwm1 halfLineWidth sub 180 270 arc
hbwm1 negHalfLineWidth lineto
hbwm1 hbwm1 hbwm1 halfLineWidth add 270 180 arcn
closepath
} def
/line {
newpath
nhbwm1 halfLineWidth moveto
hbwm1 halfLineWidth lineto
hbwm1 negHalfLineWidth lineto
nhbwm1 negHalfLineWidth lineto
closepath
} def
/trxBL {
moveto
/move exch def
gsave
currentpoint translate
shadowBox
box
angle
blackGrayValue fillbox
180 rotate
angle
whiteGrayValue fillbox
grestore
} def
/trxTL {
moveto
/move exch def
gsave
currentpoint translate
shadowBox
box
270 rotate
angle
blackGrayValue fillbox
180 rotate
angle
whiteGrayValue fillbox
grestore
} def
/trxBR {
moveto
/move exch def
gsave
currentpoint translate
shadowBox
box
90 rotate
angle
blackGrayValue fillbox
180 rotate
angle
whiteGrayValue fillbox
grestore
} def
/trxTR {
moveto
/move exch def
gsave
currentpoint translate
shadowBox
box
180 rotate
angle
blackGrayValue fillbox
180 rotate
angle
whiteGrayValue fillbox
grestore
} def
/trxH {
moveto
/move exch def
gsave
currentpoint translate
shadowBox
box
90 rotate
line
blackGrayValue fillbox
90 rotate
line
whiteGrayValue fillbox
grestore
} def
/trxV {
moveto
/move exch def
gsave
currentpoint translate
shadowBox
box
line
blackGrayValue fillbox
shadowGrayValue fillbox
90 rotate
line
whiteGrayValue fillbox
grestore
} def
%50 700 translate
50 550 translate
@ tiles
/Times-Roman findfont 15 scalefont setfont
0 200 translate
@ text
showpage