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

  1. % Enscript styled header.
  2. % Copyright (c) 1995 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. %%DocumentNeededResources: font Times-Bold Times-Roman
  26. %Format: moddatestr    $W
  27. %Format: modtimestr    $C
  28.  
  29. % Fonts.
  30. /Times-Bold /HeaderFont-Bold MF
  31. /HeaderDateF /HeaderFont-Bold findfont 12 scalefont def
  32.  
  33. /Times-Roman /HeaderFont-Times MF
  34. /HeaderHDRF /HeaderFont-Times findfont 14 scalefont def
  35.  
  36. /HeaderPageNumF /Helvetica-Bold findfont 28.8 scalefont def
  37.  
  38. /do_header {    % print enscript header
  39.   gsave
  40.     d_header_x d_header_y translate
  41.  
  42.     % light bar
  43.     0 0 d_header_w d_header_h 2 div Box
  44.     .95 setgray fill
  45.  
  46.     % filename
  47.     0 setgray 
  48.     HeaderHDRF setfont
  49.     d_header_w fname stringwidth pop sub 2 div d_header_h 8 div moveto
  50.     fname show
  51.  
  52.     % user supplied header string.
  53.     user_header_p {
  54.       d_header_w user_header_str stringwidth pop sub 2 div 
  55.       d_header_h 8 div 5 mul moveto user_header_str show
  56.     } if
  57.  
  58.     % dark gray boxes
  59.     /dbw d_header_h 2 mul def    % dark box width
  60.     /dbc .7 def            % dark box color
  61.  
  62.     % left dark box.
  63.     0 0 dbw d_header_h Box
  64.     dbc setgray fill
  65.  
  66.     0 setgray 
  67.     HeaderDateF setfont
  68.     moddatestr dup stringwidth pop dbw exch sub 2 div 
  69.     d_header_h 2 div 2 add moveto show
  70.     modtimestr dup stringwidth pop dbw exch sub 2 div 
  71.     d_header_h 5 div moveto show
  72.  
  73.     % right dark box
  74.     d_header_w dbw sub 0 dbw d_header_h Box
  75.     dbc setgray fill
  76.  
  77.     HeaderPageNumF setfont
  78.     1 setgray
  79.     pagenum 10 string cvs dup 
  80.     stringwidth pop dbw exch sub 2 div d_header_w dbw sub add
  81.     d_header_h .2 mul moveto show
  82.  
  83.   grestore
  84. } def
  85.