home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-alpha / enscript-1.4.0-bin.lha / share / enscript / mp.hdr < prev    next >
Encoding:
Text File  |  1996-10-14  |  2.5 KB  |  99 lines

  1. % OPENWINDOWS' mp header
  2. % Copyright (c) 1996 Markku Rossi.
  3. % Author: Markku Rossi <mtr@iki.fi>
  4. %
  5.  
  6. %
  7. % This file is part of GNU enscript.
  8. % This program is free software; you can redistribute it and/or modify
  9. % it under the terms of the GNU General Public License as published by
  10. % the Free Software Foundation; either version 2, or (at your option)
  11. % any later version.
  12. %
  13. % This program is distributed in the hope that it will be useful,
  14. % but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. % GNU General Public License for more details.
  17. %
  18. % You should have received a copy of the GNU General Public License
  19. % along with this program; see the file COPYING.  If not, write to
  20. % the Free Software Foundation, 59 Temple Place - Suite 330,
  21. % Boston, MA 02111-1307, USA.
  22. %
  23.  
  24. % -- code follows this line --
  25. %Format: userstr    %n
  26. %Format: datestr    %D{%d/%m/%y  %Hh%M}
  27. %Format: pagestr    $%/$=
  28.  
  29. %HeaderHeight: 48
  30. %FooterHeight: 48
  31.  
  32. % Fonts.
  33. /Helvetica-BoldOblique /helvetica-encoded MF
  34. /SmallFont /helvetica-encoded findfont 10 scalefont def
  35. /BigFont /helvetica-encoded findfont 16 scalefont def
  36.  
  37. /RBox {     % x y w h r -> -
  38.   /r exch def
  39.   /h exch def
  40.   /w exch def
  41.   /y exch def
  42.   /x exch def
  43.   
  44.   x y r add moveto
  45.   x y h add x w add y h add r arcto 4 {pop} repeat
  46.   x w add y h add x w add y r arcto 4 {pop} repeat
  47.   x w add y x y r arcto 4 {pop} repeat
  48.   x y x y h add r arcto 4 {pop} repeat
  49.   closepath
  50. } def
  51.  
  52. /radius 10 def
  53.  
  54. /do_header {    % print mp header
  55.   gsave
  56.     .5 setlinewidth
  57.  
  58.     % footer
  59.     d_footer_x d_footer_y d_footer_w 40 radius RBox
  60.     gsave
  61.       .9 setgray fill
  62.     grestore
  63.     stroke
  64.  
  65.     BigFont setfont
  66.     ftail dup stringwidth pop d_footer_w exch sub 2 div 
  67.     d_footer_y 14 add moveto show
  68.  
  69.     % header
  70.     d_header_x d_header_y 8 add d_header_w 65 sub 40 radius RBox
  71.     gsave
  72.       .9 setgray fill
  73.     grestore
  74.     stroke
  75.     SmallFont setfont
  76.  
  77.     datestr dup stringwidth pop d_header_x d_header_w 75 sub add exch sub
  78.     d_header_y 22 add moveto show
  79.  
  80.     d_header_x 10 add d_header_y 22 add moveto (printed by: ) show
  81.     BigFont setfont
  82.     userstr show
  83.  
  84.     d_header_x d_header_w add 60 sub d_header_y 8 add 60 40 radius RBox
  85.     stroke
  86.  
  87.     SmallFont setfont
  88.     (Page) dup stringwidth pop 60 exch sub 2 div 
  89.     d_header_x d_header_w add 60 sub add d_header_y 33 add moveto show
  90.  
  91.     BigFont setfont
  92.     pagestr dup stringwidth pop 60 exch sub 2 div
  93.     d_header_x d_header_w add 60 sub add d_header_y 13 add moveto show
  94.  
  95.   grestore
  96. } def
  97.