Adam Tkac a614ff
diff -up enscript-1.6.5.1/lib/simple.hdr.wrap_header enscript-1.6.5.1/lib/simple.hdr
Adam Tkac a614ff
--- enscript-1.6.5.1/lib/simple.hdr.wrap_header	2009-01-24 21:59:34.000000000 +0100
Adam Tkac a614ff
+++ enscript-1.6.5.1/lib/simple.hdr	2010-05-21 13:04:28.070346832 +0200
Adam Tkac a614ff
@@ -3,6 +3,10 @@
Adam Tkac a614ff
 % Copyright (c) 1995 Markku Rossi.
Adam Tkac a614ff
 % Author: Markku Rossi <mtr@iki.fi>
Adam Tkac a614ff
 %
Adam Tkac a614ff
+% Modified: Chris Josefy, USA, MAY 2006
Adam Tkac a614ff
+%  + Added line wrapping to header to work more like AIX enscript
Adam Tkac a614ff
+%  + This assumes that one does not change the header font size from the default
Adam Tkac a614ff
+%  + This also assumes that the line only wraps once
Adam Tkac a614ff
 
Adam Tkac a614ff
 %
Adam Tkac a614ff
 % This file is part of GNU Enscript.
Adam Tkac a614ff
@@ -24,6 +28,7 @@
Adam Tkac a614ff
 % -- code follows this line --
Adam Tkac a614ff
 %Format: fmodstr	$D{%a %b %d %H:%M:%S %Y}
Adam Tkac a614ff
 %Format: pagenumstr	$V$%
Adam Tkac a614ff
+%HeaderHeight: 44
Adam Tkac a614ff
 
Adam Tkac a614ff
 /do_header {	% print default simple header
Adam Tkac a614ff
   gsave
Adam Tkac a614ff
@@ -39,10 +44,23 @@
Adam Tkac a614ff
       d_header_w user_header_right_str stringwidth pop sub 5 sub
Adam Tkac a614ff
       0 moveto user_header_right_str show
Adam Tkac a614ff
     } {
Adam Tkac ecde85
-      5 0 moveto fname show
Adam Tkac ecde85
-      45 0 rmoveto fmodstr show
Adam Tkac ecde85
-      45 0 rmoveto pagenumstr show
Adam Tkac ecde85
-    } ifelse
Adam Tkac a614ff
+      fname length fmodstr length add pagenumstr length add 95 6 idiv add d_header_w 6 idiv le{
Adam Tkac a614ff
+        5 0 moveto fname show
Adam Tkac a614ff
+        45 0 rmoveto fmodstr show
Adam Tkac a614ff
+        45 0 rmoveto pagenumstr show
Adam Tkac a614ff
+      } {
Adam Tkac a614ff
+        5 0 moveto fmodstr show
Adam Tkac a614ff
+        45 0 rmoveto pagenumstr show
Adam Tkac a614ff
+        fname length d_header_w 6 idiv idiv 1 add 10 mul 5 exch moveto
Adam Tkac a614ff
+        1 1 fname length d_header_w 6 idiv idiv
Adam Tkac a614ff
+        {
Adam Tkac a614ff
+          dup fname exch 1 sub d_header_w 6 idiv mul d_header_w 6 idiv getinterval show
Adam Tkac a614ff
+          5 exch 10 mul fname length d_header_w 6 idiv idiv 1 add 10 mul exch sub moveto
Adam Tkac a614ff
+        } for
Adam Tkac a614ff
+        5 10 moveto
Adam Tkac a614ff
+        fname fname length d_header_w 6 idiv idiv d_header_w 6 idiv mul dup fname length exch sub getinterval show
Adam Tkac a614ff
+      }ifelse
Adam Tkac a614ff
+    }ifelse
Adam Tkac a614ff
 
Adam Tkac a614ff
   grestore
Adam Tkac a614ff
 } def