% 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