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