summaryrefslogtreecommitdiff
path: root/support/lametex/page/icons.ps
blob: 6204fe4e05bc379897e433cd4ad05d17f8c41794 (plain)
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
% This PostScript file defines a few simple operators for throwing 
% icons onto the page.

%% All icons are expected to fit into a 1"x1" square, but they don't have to.

%%%%%%%%%%%  icon-name  OutsideTopIcon   - %%%%%%%%%%%%
% Given the name of an icon, executes the icon in the top outside corner.
/OutsideTopIcon
{
} bind def

%%%%%%%%%%%  icon-name  LeftMarginIcon   - %%%%%%%%%%%%
% Given the name of an icon, executes the icon in the left margin.
/LeftMarginIcon
{
  gsave
       bslot 72 sub ypos 72 sub translate cvx exec
  grestore
} bind def

%%%%%%%%%%%%  icon-name  number SprinkleIcon   - %%%%%%%%%%%%
% Given the name of an icon, executes the icon in the left margin.
/SprinkleIcon
{
  dup 0 eq
  {
     pop
  }
  {
    0 1 3 -1 roll Random
    {
       pop
        gsave
        8.5 in Random 11 in Random translate 0 0 moveto dup cvx exec
        grestore
     } for
     pop
  } ifelse
} bind def

/BIG 1073741824 def

% Gives a random number between 0 and N
%   N   Random  random-number
/Random
{
   rand BIG div mul 2 div
} bind def 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% THE FOLLOWING ROUTINES ARE USED IN THE ROACH ICON
%%%%%%%%%%%%%%%%%%%%  - Roach - %%%%%%%%%%%%%%%%%%%%

/Body
{
  -1 0 moveto -5 2 lineto -11 15 -9 25 -10 40 curveto
  -1 30 lineto closepath fill
} bind def
 
/Legs
{
  -15 0 moveto  -8 5 lineto -7 10 lineto stroke
  -16 25 moveto -13 20 lineto -7 17 lineto stroke
  -21 40 moveto -15 30 lineto -10 30 lineto -7 25 lineto stroke
} bind def

/Head
{
  0 31 moveto 0 31 15 90 135 arc fill
  0 42 moveto 0 42 8 90 200 arc fill
  0 50 moveto 0 50 3 90 200 arc fill
  -4 45 moveto -7 65 lineto stroke
} bind def

/Roach
{
  newpath
  gsave
    0.7 setgray
    30 30 translate
    .7 .7 scale
    360 Random rotate
    Body Legs Head
    -1 1 scale
    Body Legs Head
  grestore
} bind def


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% END OF ROUTINES FOR THE ROACH ICON
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% THE FOLLOWING ROUTINES ARE USED IN THE WIZARD ICON
%%%%%%%%%%%%%%%% -  Wizard - %%%%%%%%%%%%%%%%%%

/Hat
{
    gsave
    25 54 moveto
    35 51 lineto
    35 Random
    15 add /x exch def    % Hat tilt randomness
    x 5 add 68 x 70 3 arcto pop pop pop pop
    x 5 sub 68 x 2 sub 65 2 arcto pop pop pop pop
    x 2 add 66 lineto 
    closepath
    1 setlinejoin
    gsave dup setgray fill grestore gsave stroke grestore
    % Add the while circles
    clip
    .7 gt { 0 } { 1 } ifelse setgray
    newpath
    0 1 20
    {
      pop 40 Random 20 add 20 Random 50 add 1.5 0 360 arc fill
    } for
    grestore
} bind def

% Takes two angles for the arms.
/Clothes
{
    gsave
    1 setlinejoin
    % Robes
    25 30 moveto
    25 20 20 10 17 3 curveto
    30 0 40 5 50 2 curveto
    38 25 34 32 36 35 curveto

    % Right arm
    40 Random 10 add            % Right arm randomness
    50 exch lineto 5 15 rlineto
    currentpoint 5 70 -110 arcn
    10 20 rlineto -10 -18 rlineto
    40 43 lineto
    26 43 lineto
    22 42 lineto

    % Left arm
    45 Random 20 add dup dup   % Left arm randomness
    10 exch lineto 15 sub 10 exch lineto
    10 exch lineto
    -5 1 -6 -10 0 -10 rcurveto
    0 -5 rlineto
    closepath
    % Add the while circles
    gsave dup setgray fill grestore gsave stroke grestore clip
    .7 gt { 0 } { 1 } ifelse setgray
    newpath
    0 1 50
    {
      pop 60 Random 10 add 50 Random 1.5 0 360 arc fill
    } for
    grestore
} bind def

/Face
{
   gsave
      % setgray
      1 setgray
      25 54 moveto 25 33 37 33 35 52 curveto fill
      % currentgray .7 gt { 0 } { 1 } ifelse setgray
      0 setgray
      25 54 moveto 25 33 37 33 35 52 curveto stroke
         newpath .3 setlinewidth
         28 49 1 0 360 arc stroke
         32 48 1 0 360 arc stroke
         30 45 1 0 360 arc fill

      % Whiskers
      .7 gt { 0 } { 1 } ifelse setgray
      0 1 10
      {
         25 add
         0 1 5
         {
           pop dup 10 Random 36 add
           moveto -3 Random -1 1 -3 Random 0 -5 Random rcurveto stroke
	 } for
         pop
      } for
   grestore
} bind def

% draws a picture of a wizard in a 1"x1" square
/Wizard
{
  newpath .5 setlinewidth
  1 Random dup Clothes
  Face
  1 Random Hat
} bind def

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% END OF ROUTINES FOR THE WIZARD ICON
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

/in {72 mul} def

/IconDemo
{
  /icon exch def
  1 1 11
  {
    pop
    1 1 8
    {
% Uncomment this line to see the icon boxes.
%      0 0 moveto 72 0 lineto 72 72 lineto 0 72 lineto closepath stroke
      icon cvx exec
      pop 1 in 0 translate
    } for
    -8 in 1 in translate
  } for
} bind def

%% To do a demo of one of the icons, uncomment one of these lines.
% /Wizard IconDemo showpage
% /Roach IconDemo showpage