| 1 |
--- enscript-1.6.1/lib/simple.hdr.wrap_header 1997-03-03 09:00:08.000000000 +0100
|
| 2 |
+++ enscript-1.6.1/lib/simple.hdr 2007-02-12 12:57:02.000000000 +0100
|
| 3 |
@@ -1,50 +1,68 @@
|
| 4 |
-%
|
| 5 |
-% Default simple header.
|
| 6 |
-% Copyright (c) 1995 Markku Rossi.
|
| 7 |
-% Author: Markku Rossi <mtr@iki.fi>
|
| 8 |
-%
|
| 9 |
-
|
| 10 |
-%
|
| 11 |
-% This file is part of GNU enscript.
|
| 12 |
-%
|
| 13 |
-% This program is free software; you can redistribute it and/or modify
|
| 14 |
-% it under the terms of the GNU General Public License as published by
|
| 15 |
-% the Free Software Foundation; either version 2, or (at your option)
|
| 16 |
-% any later version.
|
| 17 |
-%
|
| 18 |
-% This program is distributed in the hope that it will be useful,
|
| 19 |
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 20 |
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 21 |
-% GNU General Public License for more details.
|
| 22 |
-%
|
| 23 |
-% You should have received a copy of the GNU General Public License
|
| 24 |
-% along with this program; see the file COPYING. If not, write to
|
| 25 |
-% the Free Software Foundation, 59 Temple Place - Suite 330,
|
| 26 |
-% Boston, MA 02111-1307, USA.
|
| 27 |
-%
|
| 28 |
-
|
| 29 |
-% -- code follows this line --
|
| 30 |
-%Format: fmodstr $D{%a %b %d %H:%M:%S %Y}
|
| 31 |
-%Format: pagenumstr $V$%
|
| 32 |
-
|
| 33 |
-/do_header { % print default simple header
|
| 34 |
- gsave
|
| 35 |
- d_header_x d_header_y HFpt_h 3 div add translate
|
| 36 |
-
|
| 37 |
- HF setfont
|
| 38 |
- user_header_p {
|
| 39 |
- 5 0 moveto user_header_left_str show
|
| 40 |
-
|
| 41 |
- d_header_w user_header_center_str stringwidth pop sub 2 div
|
| 42 |
- 0 moveto user_header_center_str show
|
| 43 |
-
|
| 44 |
- d_header_w user_header_right_str stringwidth pop sub 5 sub
|
| 45 |
- 0 moveto user_header_right_str show
|
| 46 |
- } {
|
| 47 |
- 5 0 moveto fname show
|
| 48 |
- 45 0 rmoveto fmodstr show
|
| 49 |
- 45 0 rmoveto pagenumstr show
|
| 50 |
- } ifelse
|
| 51 |
-
|
| 52 |
- grestore
|
| 53 |
-} def
|
| 54 |
+%
|
| 55 |
+% Default simple header.
|
| 56 |
+% Copyright (c) 1995 Markku Rossi.
|
| 57 |
+% Author: Markku Rossi <mtr@iki.fi>
|
| 58 |
+%
|
| 59 |
+% Modified: Chris Josefy, USA, MAY 2006
|
| 60 |
+% + Added line wrapping to header to work more like AIX enscript
|
| 61 |
+% + This assumes that one does not change the header font size from the default
|
| 62 |
+% + This also assumes that the line only wraps once
|
| 63 |
+
|
| 64 |
+%
|
| 65 |
+% This file is part of GNU enscript.
|
| 66 |
+%
|
| 67 |
+% This program is free software; you can redistribute it and/or modify
|
| 68 |
+% it under the terms of the GNU General Public License as published by
|
| 69 |
+% the Free Software Foundation; either version 2, or (at your option)
|
| 70 |
+% any later version.
|
| 71 |
+%
|
| 72 |
+% This program is distributed in the hope that it will be useful,
|
| 73 |
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 74 |
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 75 |
+% GNU General Public License for more details.
|
| 76 |
+%
|
| 77 |
+% You should have received a copy of the GNU General Public License
|
| 78 |
+% along with this program; see the file COPYING. If not, write to
|
| 79 |
+% the Free Software Foundation, 59 Temple Place - Suite 330,
|
| 80 |
+% Boston, MA 02111-1307, USA.
|
| 81 |
+%
|
| 82 |
+
|
| 83 |
+% -- code follows this line --
|
| 84 |
+%Format: fmodstr $D{%a %b %d %H:%M:%S %Y}
|
| 85 |
+%Format: pagenumstr $V$%
|
| 86 |
+%HeaderHeight: 44
|
| 87 |
+
|
| 88 |
+/do_header { % print default simple header
|
| 89 |
+ gsave
|
| 90 |
+ d_header_x d_header_y HFpt_h 3 div add translate
|
| 91 |
+
|
| 92 |
+ HF setfont
|
| 93 |
+ user_header_p {
|
| 94 |
+ 5 0 moveto user_header_left_str show
|
| 95 |
+
|
| 96 |
+ d_header_w user_header_center_str stringwidth pop sub 2 div
|
| 97 |
+ 0 moveto user_header_center_str show
|
| 98 |
+
|
| 99 |
+ d_header_w user_header_right_str stringwidth pop sub 5 sub
|
| 100 |
+ 0 moveto user_header_right_str show
|
| 101 |
+ } {
|
| 102 |
+ fname length fmodstr length add pagenumstr length add 95 6 idiv add d_header_w 6 idiv le{
|
| 103 |
+ 5 0 moveto fname show
|
| 104 |
+ 45 0 rmoveto fmodstr show
|
| 105 |
+ 45 0 rmoveto pagenumstr show
|
| 106 |
+ } {
|
| 107 |
+ 5 0 moveto fmodstr show
|
| 108 |
+ 45 0 rmoveto pagenumstr show
|
| 109 |
+ fname length d_header_w 6 idiv idiv 1 add 10 mul 5 exch moveto
|
| 110 |
+ 1 1 fname length d_header_w 6 idiv idiv
|
| 111 |
+ {
|
| 112 |
+ dup fname exch 1 sub d_header_w 6 idiv mul d_header_w 6 idiv getinterval show
|
| 113 |
+ 5 exch 10 mul fname length d_header_w 6 idiv idiv 1 add 10 mul exch sub moveto
|
| 114 |
+ } for
|
| 115 |
+ 5 10 moveto
|
| 116 |
+ fname fname length d_header_w 6 idiv idiv d_header_w 6 idiv mul dup fname length exch sub getinterval show
|
| 117 |
+ }ifelse
|
| 118 |
+ }ifelse
|
| 119 |
+
|
| 120 |
+ grestore
|
| 121 |
+} def
|