[misc.misc] Free postscript printer!

lag@aipna.ed.ac.uk (Larry Gorman) (03/10/89)

------Cut Here------------------------------Cut Here-------------------
%!PS
% YES!  IT'S TRUE!  Send this file to your friendly local PostScript
% printer, and once the poster has been printed out, YOU can have
% that printer to keep!  If anyone asks why you are leaving work
% with a laserwriter under your arm, tell them point blank that
% it is authorised by Dr. Gorman.  You can't get more clout than
% that!

% Remember: SPOOL THIS POSTER TODAY, TAKE A PRINTER AWAY!

% poster

/inch {72 mul} def

% constants

%/pagewidth 8.3 def		% real width of page
%/pagedepth 11.5 def		% real depth of page
/pagewidth 7.1 def		% width of page
/pagedepth 11 def		% depth of page
/TM pagedepth .3 sub def	% top margin
/BM .3 def			% bott. marg.
/LM .3 def			% left
/RM pagewidth .3 sub def	% right
/colcount 3 def			% width of poster in pages
/rowcount 4 def			% depth of poster in pages
/horwidth colcount 4 mul def	% horus width
/horx colcount pagewidth mul horwidth sub 2 div def	% horus x posn
/hory rowcount pagedepth mul horwidth .81 mul sub 2 div def	% horus y posn

% draw some rays, man
% stack: rayx rayy rayangle raylength raycount convergence ray_gray
/out_rays
{
 /ray_gray exch def			% ray's grayness
 /convergence exch def			% ratio of length to final width
 /raycount exch def			% no. of rays in splay
 /raylength exch def			% length of ray
 /rayangle exch def			% angle of splay
 /rayy exch def				% splay centre x posn
 /rayx exch def				% splay centre y posn
 /angle 360 raycount div def		% angle separating rays
 /width raylength convergence mul 2 div def	% width of ray end
 /total_angle 0 def			% toatl angle of rotation
 rayx rayy translate			% translate to centre of rays
 newpath
 ray_gray setgray
 0 0 moveto
 rayangle rotate			% offset rotation
 raycount				% draw rays
 {
  /reallength raylength total_angle cos abs .5 add mul def
  reallength width lineto
  reallength 0 width sub lineto
  fill
  0 0 moveto
  angle rotate
  /total_angle total_angle angle add def
 } repeat
 0 rayangle sub rotate			% make up 360 degrees rotation
 0 rayx sub 0 rayy sub translate	% return to orig. translation
} def

% draw some rays, man
% stack: rayx rayy rayangle raylength raycount convergence ray_gray
/in_rays
{
 /ray_gray exch def			% ray's grayness
 /convergence exch def			% ratio of length to final width
 /raycount exch def			% no. of rays in splay
 /raylength exch def			% length of ray
 /rayangle exch def			% angle of splay
 /rayy exch def				% splay centre x posn
 /rayx exch def				% splay centre y posn
 /angle 360 raycount div def		% angle separating rays
 /width raylength convergence mul 2 div def	% width of ray end
 /total_angle 0 def			% toatl angle of rotation
 rayx rayy translate			% translate to centre of rays
 newpath
 ray_gray setgray
 rayangle rotate			% offset rotation
 raycount				% draw rays
 {
  /reallength raylength total_angle cos abs mul def
  reallength 0 moveto
  0 0 width sub lineto
  0 width lineto
  fill
  0 0 moveto
  angle rotate
  /total_angle total_angle angle add def
 } repeat
 0 rayangle sub rotate			% make up 360 degrees rotation
 0 rayx sub 0 rayy sub translate	% return to orig. translation
} def

% equilateral triangle
% stack: x y sidelength line_grayness fill_grayness
/eqtriangle
{
 /fill_grayness exch def
 /line_grayness exch def
 /sidelength exch def
 /y exch def
 /x exch def
 newpath
 x y moveto
 sidelength 0 rlineto
 sidelength 0 translate
 120 rotate
 sidelength 0 rlineto
 sidelength 0 translate
 120 rotate
 sidelength 0 rlineto
 sidelength 0 translate
 120 rotate
 gsave
 line_grayness setgray
 stroke
 grestore
 fill_grayness setgray
 fill
} def

% draw an upward pointing curve of the given width
% stack: x y width
/upcurve
{
 /width exch def
 /y exch def
 /x exch def
 /radius width .7 mul def
 x width .5 mul add y width -.495 mul add radius 45 135 arc
} def

% draw an downward pointing curve of the given width
% stack: x y width
/downcurve
{
 /width exch def
 /y exch def
 /x exch def
 /radius width .7 mul def
 x width .5 mul add y width .495 mul add radius 225 315 arc
} def

% draw an "eye" of the given width at the given position
% stack: x y width line_grayness surround_grayness iris_grayness
/eye
{
 /iris_grayness exch def
 /surround_grayness exch def
 /line_grayness exch def
 /width exch def
 /y exch def
 /x exch def
 % draw surround
 line_grayness setgray
 x y width upcurve
 x y width downcurve
 gsave
 stroke
 grestore
 surround_grayness setgray
 fill
 % draw iris
 x width 2 div add y width 8 div 0 360 arc
 gsave
 line_grayness setgray
 stroke
 grestore
 iris_grayness setgray
 fill
} def

% print an eye in a triangle
% stack: horusx horusy basewidth
/horus
{
 /basewidth exch def
 /horusy exch def
 /horusx exch def
 % do rays
 horusx basewidth 2 div add basewidth .3 mul horusy add 270 basewidth 1.5 mul 7 .05 .9 out_rays
 horusx basewidth 2 div add basewidth .3 mul horusy add 270 360 14 div add basewidth 1.2 mul 7 .05 .7 in_rays
 horusx horusy basewidth 0 0 eqtriangle
 /eyewidth basewidth .5 mul def
 basewidth eyewidth sub 2 div horusx add basewidth .3 mul horusy add eyewidth 0 .5 1 eye
} def

% postscript cookery book poster printing routine
/printposter
{
 /rows exch def
 /columns exch def
 /bigpictureproc exch def

 newpath
 leftmargin botmargin moveto
 0 ph rlineto
 pw 0 rlineto
 0 ph neg rlineto
 closepath
 clip

 leftmargin botmargin translate

 0 1 rows 1 sub
 {
  /rowcount exch def
  0 1 columns 1 sub
  {
   /colcount exch def
   gsave
   pw colcount mul neg
   ph rowcount mul neg
   translate

   bigpictureproc
   gsave showpage grestore

   grestore
  } for
 } for
} def

/retaddrfont /Times-BoldItalic findfont [7 0 0 9 0 0] makefont def

/leftmargin .5 inch def
/botmargin .25 inch def
/pw 7.5 inch def
/ph 10 inch def
{horx inch hory inch horwidth inch horus} colcount rowcount printposter

showpage

% That's all folks!