2000-01-05 08:14:47 +00:00
|
|
|
% === BEGIN ps-print prologue 1
|
2007-01-27 00:10:33 +00:00
|
|
|
% version: 6.1
|
2000-01-05 08:14:47 +00:00
|
|
|
|
2015-01-01 17:18:06 +00:00
|
|
|
% Copyright (C) 2000-2015 Free Software Foundation, Inc.
|
2008-05-15 07:32:14 +00:00
|
|
|
|
2001-02-20 12:29:52 +00:00
|
|
|
% This file is part of GNU Emacs.
|
2008-05-15 07:32:14 +00:00
|
|
|
|
|
|
|
% GNU Emacs is free software: you can redistribute it and/or modify
|
2001-02-20 12:29:52 +00:00
|
|
|
% it under the terms of the GNU General Public License as published by
|
2008-05-15 07:32:14 +00:00
|
|
|
% the Free Software Foundation, either version 3 of the License, or
|
|
|
|
% (at your option) any later version.
|
|
|
|
|
2001-02-20 12:29:52 +00:00
|
|
|
% GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
% GNU General Public License for more details.
|
2008-05-15 07:32:14 +00:00
|
|
|
|
2001-02-20 12:29:52 +00:00
|
|
|
% You should have received a copy of the GNU General Public License
|
2008-05-15 07:32:14 +00:00
|
|
|
% along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
2001-02-20 12:29:52 +00:00
|
|
|
|
2002-06-26 08:31:10 +00:00
|
|
|
% As a special exception, the copyright holders of this module give
|
|
|
|
% you permission to include the module in a Postscript file generated
|
|
|
|
% by Emacs or other free software together with the result of
|
|
|
|
% converting text to be printed, regardless of the license terms of
|
|
|
|
% that text, and to use under terms of your choice the page images
|
|
|
|
% resulting from formatting said combination. If you modify this
|
|
|
|
% module, you may extend this exception to your version of the module
|
|
|
|
% but you are not obligated to do so. If you do not wish to do so,
|
|
|
|
% delete this exception statement from your version.
|
|
|
|
|
|
|
|
|
2000-01-05 08:14:47 +00:00
|
|
|
% ISOLatin1Encoding stolen from ps_init.ps in GhostScript 2.6.1.4:
|
2000-06-07 15:38:19 +00:00
|
|
|
/ISOLatin1Encoding where{pop}{
|
2000-01-05 08:14:47 +00:00
|
|
|
% -- The ISO Latin-1 encoding vector isn't known, so define it.
|
|
|
|
% -- The first half is the same as the standard encoding,
|
|
|
|
% -- except for minus instead of hyphen at code 055.
|
|
|
|
/ISOLatin1Encoding
|
|
|
|
StandardEncoding 0 45 getinterval aload pop
|
|
|
|
/minus
|
|
|
|
StandardEncoding 46 82 getinterval aload pop
|
|
|
|
%*** NOTE: the following are missing in the Adobe documentation,
|
|
|
|
%*** but appear in the displayed table:
|
|
|
|
%*** macron at 0225, dieresis at 0230, cedilla at 0233, space at 0240.
|
|
|
|
% 0200 (128)
|
2000-06-07 15:38:19 +00:00
|
|
|
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
|
|
|
|
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
|
|
|
|
/dotlessi/grave/acute/circumflex/tilde/macron/breve/dotaccent
|
|
|
|
/dieresis/.notdef/ring/cedilla/.notdef/hungarumlaut/ogonek/caron
|
2000-01-05 08:14:47 +00:00
|
|
|
% 0240 (160)
|
2000-06-07 15:38:19 +00:00
|
|
|
/space/exclamdown/cent/sterling
|
|
|
|
/currency/yen/brokenbar/section
|
|
|
|
/dieresis/copyright/ordfeminine/guillemotleft
|
|
|
|
/logicalnot/hyphen/registered/macron
|
|
|
|
/degree/plusminus/twosuperior/threesuperior
|
|
|
|
/acute/mu/paragraph/periodcentered
|
|
|
|
/cedilla/onesuperior/ordmasculine/guillemotright
|
|
|
|
/onequarter/onehalf/threequarters/questiondown
|
2000-01-05 08:14:47 +00:00
|
|
|
% 0300 (192)
|
2000-06-07 15:38:19 +00:00
|
|
|
/Agrave/Aacute/Acircumflex/Atilde
|
|
|
|
/Adieresis/Aring/AE/Ccedilla
|
|
|
|
/Egrave/Eacute/Ecircumflex/Edieresis
|
|
|
|
/Igrave/Iacute/Icircumflex/Idieresis
|
|
|
|
/Eth/Ntilde/Ograve/Oacute
|
|
|
|
/Ocircumflex/Otilde/Odieresis/multiply
|
|
|
|
/Oslash/Ugrave/Uacute/Ucircumflex
|
|
|
|
/Udieresis/Yacute/Thorn/germandbls
|
2000-01-05 08:14:47 +00:00
|
|
|
% 0340 (224)
|
2000-06-07 15:38:19 +00:00
|
|
|
/agrave/aacute/acircumflex/atilde
|
|
|
|
/adieresis/aring/ae/ccedilla
|
|
|
|
/egrave/eacute/ecircumflex/edieresis
|
|
|
|
/igrave/iacute/icircumflex/idieresis
|
|
|
|
/eth/ntilde/ograve/oacute
|
|
|
|
/ocircumflex/otilde/odieresis/divide
|
|
|
|
/oslash/ugrave/uacute/ucircumflex
|
|
|
|
/udieresis/yacute/thorn/ydieresis
|
2000-01-05 08:14:47 +00:00
|
|
|
256 packedarray def
|
|
|
|
}ifelse
|
|
|
|
|
|
|
|
/reencodeFontISO{ %def
|
|
|
|
dup
|
|
|
|
length 12 add dict % Make a new font (a new dict the same size
|
|
|
|
% as the old one) with room for our new symbols.
|
|
|
|
|
|
|
|
begin % Make the new font the current dictionary.
|
|
|
|
|
2000-06-07 15:38:19 +00:00
|
|
|
% Copy each of the symbols from the old dictionary
|
|
|
|
% to the new one except for the font ID.
|
|
|
|
{1 index/FID ne{def}{pop pop}ifelse}forall
|
2000-01-05 08:14:47 +00:00
|
|
|
|
2000-06-07 15:38:19 +00:00
|
|
|
% Override the encoding with the ISOLatin1 encoding.
|
|
|
|
currentdict/FontType get 0 ne{/Encoding ISOLatin1Encoding def}if
|
2000-01-05 08:14:47 +00:00
|
|
|
|
|
|
|
% Use the font's bounding box to determine the ascent, descent,
|
|
|
|
% and overall height; don't forget that these values have to be
|
|
|
|
% transformed using the font's matrix.
|
|
|
|
|
|
|
|
% ^ (x2 y2)
|
|
|
|
% | |
|
|
|
|
% | v
|
|
|
|
% | +----+ - -
|
|
|
|
% | | | ^
|
|
|
|
% | | | | Ascent (usually > 0)
|
|
|
|
% | | | |
|
|
|
|
% (0 0) -> +--+----+-------->
|
|
|
|
% | | |
|
|
|
|
% | | v Descent (usually < 0)
|
|
|
|
% (x1 y1) --> +----+ - -
|
|
|
|
|
2000-06-07 15:38:19 +00:00
|
|
|
currentdict/FontType get 0 ne
|
|
|
|
{/FontBBox load aload pop % -- x1 y1 x2 y2
|
|
|
|
FontMatrix transform/Ascent exch def pop
|
|
|
|
FontMatrix transform/Descent exch def pop}
|
|
|
|
{/PrimaryFont FDepVector 0 get def
|
|
|
|
PrimaryFont/FontBBox get aload pop
|
|
|
|
PrimaryFont/FontMatrix get transform/Ascent exch def pop
|
|
|
|
PrimaryFont/FontMatrix get transform/Descent exch def pop}ifelse
|
2000-01-05 08:14:47 +00:00
|
|
|
|
|
|
|
/FontHeight Ascent Descent sub def % use `sub' because descent < 0
|
|
|
|
|
|
|
|
% Define these in case they're not in the FontInfo
|
|
|
|
% (also, here they're easier to get to).
|
|
|
|
/UnderlinePosition Descent 0.70 mul def
|
|
|
|
/OverlinePosition Descent UnderlinePosition sub Ascent add def
|
|
|
|
/StrikeoutPosition Ascent 0.30 mul def
|
|
|
|
/LineThickness FontHeight 0.05 mul def
|
|
|
|
/Xshadow FontHeight 0.08 mul def
|
|
|
|
/Yshadow FontHeight -0.09 mul def
|
|
|
|
/SpaceBackground Descent neg UnderlinePosition add def
|
|
|
|
/XBox Descent neg def
|
|
|
|
/YBox LineThickness 0.7 mul def
|
|
|
|
|
|
|
|
currentdict % Leave the new font on the stack
|
|
|
|
end % Stop using the font as the current dictionary.
|
|
|
|
definefont % Put the font into the font dictionary
|
|
|
|
pop % Discard the returned font.
|
|
|
|
}bind def
|
|
|
|
|
2000-06-07 15:38:19 +00:00
|
|
|
% Font definition
|
|
|
|
/DefFont{findfont exch scalefont reencodeFontISO}def
|
2000-01-05 08:14:47 +00:00
|
|
|
|
2000-06-07 15:38:19 +00:00
|
|
|
% Font selection
|
|
|
|
/F{
|
2000-01-05 08:14:47 +00:00
|
|
|
findfont
|
2000-06-07 15:38:19 +00:00
|
|
|
dup/Ascent get/Ascent exch def
|
|
|
|
dup/Descent get/Descent exch def
|
|
|
|
dup/FontHeight get/FontHeight exch def
|
|
|
|
dup/UnderlinePosition get/UnderlinePosition exch def
|
|
|
|
dup/OverlinePosition get/OverlinePosition exch def
|
|
|
|
dup/StrikeoutPosition get/StrikeoutPosition exch def
|
|
|
|
dup/LineThickness get/LineThickness exch def
|
|
|
|
dup/Xshadow get/Xshadow exch def
|
|
|
|
dup/Yshadow get/Yshadow exch def
|
|
|
|
dup/SpaceBackground get/SpaceBackground exch def
|
|
|
|
dup/XBox get/XBox exch def
|
|
|
|
dup/YBox get/YBox exch def
|
2000-01-05 08:14:47 +00:00
|
|
|
setfont
|
|
|
|
}def
|
|
|
|
|
2000-06-07 15:38:19 +00:00
|
|
|
/FG/setrgbcolor load def
|
2000-01-05 08:14:47 +00:00
|
|
|
|
|
|
|
/bg false def
|
|
|
|
/BG{
|
2000-06-07 15:38:19 +00:00
|
|
|
dup/bg exch def
|
|
|
|
{[4 1 roll]}
|
|
|
|
{[1.0 1.0 1.0]}
|
2000-01-05 08:14:47 +00:00
|
|
|
ifelse
|
|
|
|
/bgcolor exch def
|
|
|
|
}def
|
|
|
|
|
|
|
|
% B width C
|
|
|
|
% +-----------+
|
|
|
|
% | Ascent (usually > 0)
|
|
|
|
% A + +
|
|
|
|
% | Descent (usually < 0)
|
|
|
|
% +-----------+
|
|
|
|
% E width D
|
|
|
|
|
|
|
|
/dobackground{ % width --
|
|
|
|
currentpoint % -- width x y
|
|
|
|
gsave
|
|
|
|
newpath
|
|
|
|
moveto % A (x y)
|
|
|
|
0 Ascent rmoveto % B
|
|
|
|
dup 0 rlineto % C
|
|
|
|
0 Descent Ascent sub rlineto % D
|
|
|
|
neg 0 rlineto % E
|
|
|
|
closepath
|
2000-03-30 13:27:27 +00:00
|
|
|
FillBgColor
|
2000-01-05 08:14:47 +00:00
|
|
|
grestore
|
|
|
|
}def
|
|
|
|
|
|
|
|
/eolbg{ % dobackground until right margin
|
|
|
|
PrintWidth % -- x-eol
|
|
|
|
currentpoint pop % -- cur-x
|
|
|
|
sub % -- width until eol
|
|
|
|
dobackground
|
|
|
|
}def
|
|
|
|
|
Line and paragraph spacing feature.
(LineHS, ParagraphHS, EffectUnderline, EffectStrikeou, EffectOverline)
(EffectShadow, EffectBox, EffectOutline): New vars.
(PSL, S, EF, printZebra, doColumnZebra, doZebra): Code fix.
(PHL, LHL): New funs.
2001-04-02 10:38:26 +00:00
|
|
|
/LineHS LineHeight LineSpacing add def
|
|
|
|
/ParagraphHS LineHeight ParagraphSpacing add def
|
|
|
|
/PSL{/h exch def bg{eolbg}if 0 currentpoint exch pop h sub moveto}def
|
2000-01-05 08:14:47 +00:00
|
|
|
/PLN{PrintLineNumber{doLineNumber}if}def
|
|
|
|
|
Line and paragraph spacing feature.
(LineHS, ParagraphHS, EffectUnderline, EffectStrikeou, EffectOverline)
(EffectShadow, EffectBox, EffectOutline): New vars.
(PSL, S, EF, printZebra, doColumnZebra, doZebra): Code fix.
(PHL, LHL): New funs.
2001-04-02 10:38:26 +00:00
|
|
|
/SL{LineHS PSL isLineStep pop}def % Soft Linefeed
|
2000-01-05 08:14:47 +00:00
|
|
|
|
Line and paragraph spacing feature.
(LineHS, ParagraphHS, EffectUnderline, EffectStrikeou, EffectOverline)
(EffectShadow, EffectBox, EffectOutline): New vars.
(PSL, S, EF, printZebra, doColumnZebra, doZebra): Code fix.
(PHL, LHL): New funs.
2001-04-02 10:38:26 +00:00
|
|
|
/PHL{ParagraphHS PSL PLN}def % Paragraph Hard Linefeed
|
|
|
|
/LHL{LineHS PSL PLN}def % Hard Linefeed
|
2000-01-05 08:14:47 +00:00
|
|
|
|
|
|
|
% Some debug
|
2000-06-07 15:38:19 +00:00
|
|
|
/dcp{currentpoint exch 40 string cvs print(, )print =}def
|
|
|
|
/dp{print 2 copy exch 40 string cvs print(, )print =}def
|
2000-01-05 08:14:47 +00:00
|
|
|
|
|
|
|
/W{
|
2000-06-07 15:38:19 +00:00
|
|
|
( )stringwidth % Get the width of a space in the current font.
|
2000-01-05 08:14:47 +00:00
|
|
|
pop % Discard the Y component.
|
|
|
|
mul % Multiply the width of a space
|
|
|
|
% by the number of spaces to plot
|
|
|
|
bg{dup dobackground}if
|
|
|
|
0 rmoveto
|
|
|
|
}def
|
|
|
|
|
Line and paragraph spacing feature.
(LineHS, ParagraphHS, EffectUnderline, EffectStrikeou, EffectOverline)
(EffectShadow, EffectBox, EffectOutline): New vars.
(PSL, S, EF, printZebra, doColumnZebra, doZebra): Code fix.
(PHL, LHL): New funs.
2001-04-02 10:38:26 +00:00
|
|
|
/Effect 0 def
|
|
|
|
/EffectUnderline false def
|
|
|
|
/EffectStrikeout false def
|
|
|
|
/EffectOverline false def
|
|
|
|
/EffectShadow false def
|
|
|
|
/EffectBox false def
|
|
|
|
/EffectOutline false def
|
2000-01-05 08:14:47 +00:00
|
|
|
|
|
|
|
% effect: 1 - underline 2 - strikeout 4 - overline
|
|
|
|
% 8 - shadow 16 - box 32 - outline
|
Line and paragraph spacing feature.
(LineHS, ParagraphHS, EffectUnderline, EffectStrikeou, EffectOverline)
(EffectShadow, EffectBox, EffectOutline): New vars.
(PSL, S, EF, printZebra, doColumnZebra, doZebra): Code fix.
(PHL, LHL): New funs.
2001-04-02 10:38:26 +00:00
|
|
|
/EF{
|
|
|
|
/Effect exch def
|
|
|
|
/EffectUnderline Effect 1 and 0 ne def
|
|
|
|
/EffectStrikeout Effect 2 and 0 ne def
|
|
|
|
/EffectOverline Effect 4 and 0 ne def
|
|
|
|
/EffectShadow Effect 8 and 0 ne def
|
|
|
|
/EffectBox Effect 16 and 0 ne def
|
|
|
|
/EffectOutline Effect 32 and 0 ne def
|
|
|
|
}def
|
|
|
|
|
|
|
|
% stack: string |- --
|
2000-01-05 08:14:47 +00:00
|
|
|
/S{
|
2000-06-07 15:38:19 +00:00
|
|
|
/xx currentpoint dup Descent add/yy exch def
|
|
|
|
Ascent add/YY exch def def
|
|
|
|
dup stringwidth pop xx add/XX exch def
|
Line and paragraph spacing feature.
(LineHS, ParagraphHS, EffectUnderline, EffectStrikeou, EffectOverline)
(EffectShadow, EffectBox, EffectOutline): New vars.
(PSL, S, EF, printZebra, doColumnZebra, doZebra): Code fix.
(PHL, LHL): New funs.
2001-04-02 10:38:26 +00:00
|
|
|
EffectShadow{
|
2000-01-05 08:14:47 +00:00
|
|
|
/yy yy Yshadow add def
|
|
|
|
/XX XX Xshadow add def
|
|
|
|
}if
|
|
|
|
bg{
|
|
|
|
true
|
Line and paragraph spacing feature.
(LineHS, ParagraphHS, EffectUnderline, EffectStrikeou, EffectOverline)
(EffectShadow, EffectBox, EffectOutline): New vars.
(PSL, S, EF, printZebra, doColumnZebra, doZebra): Code fix.
(PHL, LHL): New funs.
2001-04-02 10:38:26 +00:00
|
|
|
EffectBox
|
2000-01-05 08:14:47 +00:00
|
|
|
{SpaceBackground doBox}
|
|
|
|
{xx yy XX YY doRect}
|
|
|
|
ifelse
|
|
|
|
}if % background
|
Line and paragraph spacing feature.
(LineHS, ParagraphHS, EffectUnderline, EffectStrikeou, EffectOverline)
(EffectShadow, EffectBox, EffectOutline): New vars.
(PSL, S, EF, printZebra, doColumnZebra, doZebra): Code fix.
(PHL, LHL): New funs.
2001-04-02 10:38:26 +00:00
|
|
|
EffectBox {false 0 doBox}if % box
|
|
|
|
EffectShadow {dup doShadow}if % shadow
|
|
|
|
EffectOutline
|
2000-01-05 08:14:47 +00:00
|
|
|
{true doOutline} % outline
|
|
|
|
{show} % normal text
|
|
|
|
ifelse
|
Line and paragraph spacing feature.
(LineHS, ParagraphHS, EffectUnderline, EffectStrikeou, EffectOverline)
(EffectShadow, EffectBox, EffectOutline): New vars.
(PSL, S, EF, printZebra, doColumnZebra, doZebra): Code fix.
(PHL, LHL): New funs.
2001-04-02 10:38:26 +00:00
|
|
|
EffectUnderline{UnderlinePosition Hline}if % underline
|
|
|
|
EffectStrikeout{StrikeoutPosition Hline}if % strikeout
|
|
|
|
EffectOverline {OverlinePosition Hline}if % overline
|
2000-01-05 08:14:47 +00:00
|
|
|
}bind def
|
|
|
|
|
|
|
|
% stack: position |- --
|
|
|
|
/Hline{
|
|
|
|
currentpoint exch pop add dup
|
|
|
|
gsave
|
|
|
|
newpath
|
|
|
|
xx exch moveto
|
|
|
|
XX exch lineto
|
|
|
|
closepath
|
|
|
|
LineThickness setlinewidth stroke
|
|
|
|
grestore
|
|
|
|
}bind def
|
|
|
|
|
|
|
|
% stack: fill-or-not delta |- --
|
|
|
|
/doBox{
|
|
|
|
/dd exch def
|
|
|
|
xx XBox sub dd sub yy YBox sub dd sub
|
|
|
|
XX XBox add dd add YY YBox add dd add
|
|
|
|
doRect
|
|
|
|
}bind def
|
|
|
|
|
|
|
|
% stack: fill-or-not lower-x lower-y upper-x upper-y |- --
|
|
|
|
/doRect{
|
|
|
|
/rYY exch def
|
|
|
|
/rXX exch def
|
|
|
|
/ryy exch def
|
|
|
|
/rxx exch def
|
|
|
|
gsave
|
|
|
|
newpath
|
|
|
|
rXX rYY moveto
|
|
|
|
rxx rYY lineto
|
|
|
|
rxx ryy lineto
|
|
|
|
rXX ryy lineto
|
|
|
|
closepath
|
|
|
|
% top of stack: fill-or-not
|
2000-06-07 15:38:19 +00:00
|
|
|
{FillBgColor}
|
|
|
|
{LineThickness setlinewidth stroke}ifelse
|
2000-01-05 08:14:47 +00:00
|
|
|
grestore
|
|
|
|
}bind def
|
|
|
|
|
|
|
|
% stack: string |- --
|
|
|
|
/doShadow{
|
|
|
|
gsave
|
|
|
|
Xshadow Yshadow rmoveto
|
|
|
|
false doOutline
|
|
|
|
grestore
|
|
|
|
}bind def
|
|
|
|
|
|
|
|
/st 1 string def
|
|
|
|
|
|
|
|
% stack: string fill-or-not |- --
|
|
|
|
/doOutline{
|
|
|
|
/-fillp- exch def
|
2000-06-07 15:38:19 +00:00
|
|
|
/-ox- currentpoint/-oy- exch def def
|
2000-01-05 08:14:47 +00:00
|
|
|
gsave
|
|
|
|
LineThickness setlinewidth
|
|
|
|
{st 0 3 -1 roll put
|
|
|
|
st dup true charpath
|
|
|
|
-fillp- {gsave FillBgColor grestore}if
|
|
|
|
stroke stringwidth
|
2000-06-07 15:38:19 +00:00
|
|
|
-oy- add/-oy- exch def
|
|
|
|
-ox- add/-ox- exch def
|
2000-01-05 08:14:47 +00:00
|
|
|
-ox- -oy- moveto
|
|
|
|
}forall
|
|
|
|
grestore
|
|
|
|
-ox- -oy- moveto
|
|
|
|
}bind def
|
|
|
|
|
|
|
|
% stack: --
|
|
|
|
/FillBgColor{bgcolor aload pop setrgbcolor fill}bind def
|
|
|
|
|
2000-04-29 19:34:29 +00:00
|
|
|
% stack: -- |- boolean
|
|
|
|
/isLineStep{
|
|
|
|
SyncLineZebra
|
2000-05-18 21:52:48 +00:00
|
|
|
{PLScounter 0 gt % or zebra
|
|
|
|
{/PLScounter PLScounter 1 sub def PLScounter 0 eq}
|
|
|
|
{false}ifelse
|
|
|
|
PrintLineStep 1 gt
|
|
|
|
{/PrintLineStep PrintLineStep 1 sub def}
|
|
|
|
{/PrintLineStep ZebraHeight def
|
|
|
|
/PLScounter PrintLineStart def}ifelse}
|
|
|
|
{LineNumber PrintLineStart sub PrintLineStep mod 0 eq}ifelse % or line step
|
2000-04-29 19:34:29 +00:00
|
|
|
}def
|
|
|
|
|
2000-01-05 08:14:47 +00:00
|
|
|
% stack: --
|
|
|
|
/doLineNumber{
|
|
|
|
/LineNumber where
|
2000-04-29 19:34:29 +00:00
|
|
|
{pop
|
|
|
|
isLineStep % or line step
|
|
|
|
LineNumber Lines ge or % or last line
|
|
|
|
{currentfont
|
2000-01-05 08:14:47 +00:00
|
|
|
gsave
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
LineNumberColor SetColor
|
2000-01-05 08:14:47 +00:00
|
|
|
/L0 findfont setfont
|
|
|
|
LineNumber Lines ge
|
2000-04-29 19:34:29 +00:00
|
|
|
{(end )}
|
2000-06-07 15:38:19 +00:00
|
|
|
{LineNumber 6 string cvs( )strcat}ifelse
|
2000-01-05 08:14:47 +00:00
|
|
|
dup stringwidth pop neg 0 rmoveto
|
|
|
|
show
|
|
|
|
grestore
|
2000-04-29 19:34:29 +00:00
|
|
|
setfont}if
|
2000-01-05 08:14:47 +00:00
|
|
|
/LineNumber LineNumber 1 add def
|
|
|
|
}if
|
|
|
|
}def
|
|
|
|
|
2000-03-30 13:27:27 +00:00
|
|
|
% stack: color-specifier |- --
|
2000-06-07 15:38:19 +00:00
|
|
|
/SetColor{dup type/realtype eq{setgray}{aload pop setrgbcolor}ifelse}def
|
2000-03-30 13:27:27 +00:00
|
|
|
|
2000-01-05 08:14:47 +00:00
|
|
|
% stack: --
|
|
|
|
/printZebra{
|
|
|
|
gsave
|
2000-03-30 13:27:27 +00:00
|
|
|
ZebraColor SetColor
|
2000-01-05 08:14:47 +00:00
|
|
|
/double-zebra ZebraHeight ZebraHeight add def
|
Line and paragraph spacing feature.
(LineHS, ParagraphHS, EffectUnderline, EffectStrikeou, EffectOverline)
(EffectShadow, EffectBox, EffectOutline): New vars.
(PSL, S, EF, printZebra, doColumnZebra, doZebra): Code fix.
(PHL, LHL): New funs.
2001-04-02 10:38:26 +00:00
|
|
|
/yiter double-zebra LineHS mul neg def
|
2000-01-05 08:14:47 +00:00
|
|
|
/xiter PrintWidth InterColumn add def
|
2000-12-29 11:47:19 +00:00
|
|
|
/zebra-line LinesPrinted def
|
2000-01-05 08:14:47 +00:00
|
|
|
NumberOfColumns{LinesPerColumn doColumnZebra xiter 0 rmoveto}repeat
|
|
|
|
grestore
|
|
|
|
}def
|
|
|
|
|
|
|
|
% stack: lines-per-column |- --
|
|
|
|
/doColumnZebra{
|
2000-06-07 15:38:19 +00:00
|
|
|
/lpc exch def
|
2000-01-05 08:14:47 +00:00
|
|
|
gsave
|
2001-02-20 10:42:14 +00:00
|
|
|
ZebraFollow 1 and 0 ne{
|
2000-06-07 15:38:19 +00:00
|
|
|
/H ZebraHeight zebra-line ZebraHeight mod sub def
|
|
|
|
/lpc lpc H sub def
|
|
|
|
zebra-line double-zebra mod ZebraHeight lt
|
|
|
|
{H doZebra % "black" stripe followed by a "white" stripe
|
|
|
|
/lpc lpc ZebraHeight sub def
|
|
|
|
H ZebraHeight add}
|
|
|
|
{H}ifelse % "white" stripe
|
Line and paragraph spacing feature.
(LineHS, ParagraphHS, EffectUnderline, EffectStrikeou, EffectOverline)
(EffectShadow, EffectBox, EffectOutline): New vars.
(PSL, S, EF, printZebra, doColumnZebra, doZebra): Code fix.
(PHL, LHL): New funs.
2001-04-02 10:38:26 +00:00
|
|
|
LineHS mul neg 0 exch rmoveto
|
2000-06-07 15:38:19 +00:00
|
|
|
/zebra-line zebra-line LinesPerColumn add def
|
|
|
|
}if
|
Line and paragraph spacing feature.
(LineHS, ParagraphHS, EffectUnderline, EffectStrikeou, EffectOverline)
(EffectShadow, EffectBox, EffectOutline): New vars.
(PSL, S, EF, printZebra, doColumnZebra, doZebra): Code fix.
(PHL, LHL): New funs.
2001-04-02 10:38:26 +00:00
|
|
|
/zspacing 0 def
|
2000-06-07 15:38:19 +00:00
|
|
|
lpc dup double-zebra idiv{ZebraHeight doZebra 0 yiter rmoveto}repeat
|
2001-02-20 10:42:14 +00:00
|
|
|
double-zebra mod dup 0 le{pop}
|
Line and paragraph spacing feature.
(LineHS, ParagraphHS, EffectUnderline, EffectStrikeou, EffectOverline)
(EffectShadow, EffectBox, EffectOutline): New vars.
(PSL, S, EF, printZebra, doColumnZebra, doZebra): Code fix.
(PHL, LHL): New funs.
2001-04-02 10:38:26 +00:00
|
|
|
{dup ZebraHeight gt
|
|
|
|
{pop ZebraHeight}
|
|
|
|
{/zspacing LineSpacing def
|
|
|
|
ZebraFollow 2 and 0 ne{pop ZebraHeight}if}ifelse
|
|
|
|
doZebra}ifelse
|
2000-01-05 08:14:47 +00:00
|
|
|
grestore
|
|
|
|
}def
|
|
|
|
|
|
|
|
% stack: zebra-height (in lines) |- --
|
|
|
|
/doZebra{
|
Line and paragraph spacing feature.
(LineHS, ParagraphHS, EffectUnderline, EffectStrikeou, EffectOverline)
(EffectShadow, EffectBox, EffectOutline): New vars.
(PSL, S, EF, printZebra, doColumnZebra, doZebra): Code fix.
(PHL, LHL): New funs.
2001-04-02 10:38:26 +00:00
|
|
|
/zh exch 0.05 sub LineHS mul zspacing sub def
|
2000-01-05 08:14:47 +00:00
|
|
|
gsave
|
|
|
|
0 LineHeight 0.65 mul rmoveto
|
|
|
|
PrintWidth 0 rlineto
|
|
|
|
0 zh neg rlineto
|
|
|
|
PrintWidth neg 0 rlineto
|
|
|
|
0 zh rlineto
|
|
|
|
fill
|
|
|
|
grestore
|
|
|
|
}def
|
|
|
|
|
2000-03-30 13:27:27 +00:00
|
|
|
% stack: --
|
|
|
|
/printBackground{
|
|
|
|
/BackgroundColor where{
|
2007-01-27 00:10:33 +00:00
|
|
|
/LHg LineHeight 0.65 mul def
|
|
|
|
/PHg PrintHeight LHg add def
|
2000-03-30 13:27:27 +00:00
|
|
|
pop gsave BackgroundColor SetColor
|
|
|
|
NumberOfColumns{
|
|
|
|
gsave
|
2007-01-27 00:10:33 +00:00
|
|
|
0 LHg rmoveto
|
2000-03-30 13:27:27 +00:00
|
|
|
PrintWidth 0 rlineto
|
2007-01-27 00:10:33 +00:00
|
|
|
0 PHg neg rlineto
|
2000-03-30 13:27:27 +00:00
|
|
|
PrintWidth neg 0 rlineto
|
2007-01-27 00:10:33 +00:00
|
|
|
0 PHg rlineto
|
2000-03-30 13:27:27 +00:00
|
|
|
fill
|
|
|
|
grestore
|
|
|
|
PrintWidth InterColumn add 0 rmoveto
|
|
|
|
}repeat
|
|
|
|
grestore
|
|
|
|
}if
|
|
|
|
}def
|
|
|
|
|
2000-01-05 08:14:47 +00:00
|
|
|
% tx ty rotation xscale yscale xpos ypos BeginBackImage
|
|
|
|
/BeginBackImage{
|
|
|
|
/-save-image- save def
|
|
|
|
/showpage{}def
|
|
|
|
translate
|
|
|
|
scale
|
|
|
|
rotate
|
|
|
|
translate
|
|
|
|
}def
|
|
|
|
|
|
|
|
/EndBackImage{-save-image- restore}def
|
|
|
|
|
|
|
|
% string fontsize fontname rotation gray xpos ypos ShowBackText
|
|
|
|
/ShowBackText{
|
|
|
|
gsave
|
|
|
|
translate
|
|
|
|
setgray
|
|
|
|
rotate
|
2000-06-07 15:38:19 +00:00
|
|
|
findfont exch dup/-offset- exch -0.25 mul def scalefont setfont
|
2000-01-05 08:14:47 +00:00
|
|
|
0 -offset- moveto
|
|
|
|
/-saveLineThickness- LineThickness def
|
|
|
|
/LineThickness 1 def
|
|
|
|
false doOutline
|
|
|
|
/LineThickness -saveLineThickness- def
|
|
|
|
grestore
|
|
|
|
}def
|
|
|
|
|
2000-06-07 15:38:19 +00:00
|
|
|
/SetPageSize{
|
|
|
|
BMark/PageSize[PageWidth LandscapePageHeight LandscapeMode{exch}if]EMark setpagedevice
|
|
|
|
}def
|
|
|
|
|
2000-01-05 08:14:47 +00:00
|
|
|
/BeginDoc{
|
|
|
|
% ---- Remember space width of the normal text font `f0'.
|
2000-06-07 15:38:19 +00:00
|
|
|
/SpaceWidth/f0 findfont setfont( )stringwidth pop def
|
2000-01-05 08:14:47 +00:00
|
|
|
% ---- save the state of the document (useful for ghostscript!)
|
|
|
|
/docState save def
|
|
|
|
% ---- [andrewi] set PageSize based on chosen dimensions
|
|
|
|
UseSetpagedevice{
|
2000-06-07 15:38:19 +00:00
|
|
|
WarnPaperSize{SetPageSize}{mark{SetPageSize}stopped cleartomark}ifelse
|
2000-01-05 08:14:47 +00:00
|
|
|
}if
|
|
|
|
/ColumnWidth PrintWidth InterColumn add def
|
|
|
|
% ---- define where printing will start
|
|
|
|
/f0 F % this installs Ascent
|
|
|
|
/PrintStartY PrintHeight Ascent sub def
|
|
|
|
/ColumnIndex 1 def
|
|
|
|
/N-Up-Counter N-Up-End 1 sub def
|
2000-05-18 21:52:48 +00:00
|
|
|
/PLScounter PrintLineStart def
|
2000-01-05 08:14:47 +00:00
|
|
|
}def
|
|
|
|
|
|
|
|
/EndDoc{
|
|
|
|
% ---- restore the state of the document (useful for ghostscript!)
|
|
|
|
docState restore
|
|
|
|
}def
|
|
|
|
|
|
|
|
/BeginDSCPage{
|
|
|
|
% ---- when 1st column, save the state of the page
|
2000-06-07 15:38:19 +00:00
|
|
|
ColumnIndex 1 eq{/pageState save def}if
|
2000-01-05 08:14:47 +00:00
|
|
|
% ---- save the state of the column
|
|
|
|
/columnState save def
|
|
|
|
}def
|
|
|
|
|
|
|
|
/PrintHeaderWidth PrintOnlyOneHeader{PrintPageWidth}{PrintWidth}ifelse def
|
|
|
|
|
|
|
|
/BeginPage{
|
2000-12-29 11:47:19 +00:00
|
|
|
/LinesPrinted exch def
|
2000-01-05 08:14:47 +00:00
|
|
|
% ---- when 1st column, print all background effects
|
|
|
|
ColumnIndex 1 eq{
|
|
|
|
0 PrintStartY moveto % move to where printing will start
|
2000-03-30 13:27:27 +00:00
|
|
|
printBackground
|
2000-06-07 15:38:19 +00:00
|
|
|
Zebra{printZebra}if
|
2000-01-05 08:14:47 +00:00
|
|
|
printGlobalBackground
|
|
|
|
printLocalBackground
|
|
|
|
}if
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
PrintOnlyOneHeader{ColumnIndex 1 eq}{true}ifelse
|
|
|
|
dup PrintHeader and{
|
|
|
|
PrintHeaderFrame{HeaderFrame}if
|
|
|
|
HeaderText
|
|
|
|
}if
|
|
|
|
PrintFooter and{
|
|
|
|
PrintFooterFrame{FooterFrame}if
|
|
|
|
FooterText
|
2000-01-05 08:14:47 +00:00
|
|
|
}if
|
|
|
|
0 PrintStartY moveto % move to where printing will start
|
2000-06-07 15:38:19 +00:00
|
|
|
/LineNumber where
|
|
|
|
{pop
|
|
|
|
SyncLineZebra
|
|
|
|
{/H PageNumber 1 sub NumberOfColumns mul ColumnIndex 1 sub add
|
|
|
|
LinesPerColumn mul ZebraHeight mod def
|
|
|
|
/PLScounter H PrintLineStart ge{0}{PrintLineStart H sub}ifelse def
|
|
|
|
/PrintLineStep ZebraHeight H sub def}if}if
|
2000-01-05 08:14:47 +00:00
|
|
|
PLN
|
|
|
|
}def
|
|
|
|
|
|
|
|
/EndPage{bg{eolbg}if}def
|
|
|
|
|
|
|
|
/EndDSCPage{
|
|
|
|
ColumnIndex NumberOfColumns eq{
|
|
|
|
% ---- restore the state of the page
|
|
|
|
pageState restore
|
|
|
|
/ColumnIndex 1 def
|
|
|
|
% ---- N-up printing
|
|
|
|
N-Up 1 gt{
|
2000-06-07 15:38:19 +00:00
|
|
|
N-Up-Counter 0 gt
|
|
|
|
{% ---- Next page on same row
|
2000-01-05 08:14:47 +00:00
|
|
|
/N-Up-Counter N-Up-Counter 1 sub def
|
2000-06-07 15:38:19 +00:00
|
|
|
N-Up-XColumn N-Up-YColumn}
|
|
|
|
{% ---- Next page on next line
|
2000-01-05 08:14:47 +00:00
|
|
|
/N-Up-Counter N-Up-End 1 sub def
|
2000-06-07 15:38:19 +00:00
|
|
|
N-Up-XLine N-Up-YLine}ifelse
|
2000-01-05 08:14:47 +00:00
|
|
|
translate
|
|
|
|
}if
|
|
|
|
}{ % else
|
|
|
|
% ---- restore the state of the current column
|
|
|
|
columnState restore
|
|
|
|
% ---- and translate to the next column
|
|
|
|
ColumnWidth 0 translate
|
|
|
|
/ColumnIndex ColumnIndex 1 add def
|
|
|
|
}ifelse
|
|
|
|
}def
|
|
|
|
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
/TextStart{
|
|
|
|
LeftMargin BottomMargin
|
|
|
|
PrintFooter{
|
|
|
|
FooterPad add
|
|
|
|
FooterLines FooterLineHeight mul add
|
|
|
|
FooterPad add
|
|
|
|
FooterOffset add}if
|
|
|
|
}def
|
|
|
|
|
2000-01-05 08:14:47 +00:00
|
|
|
% stack: number-of-pages-per-sheet |- --
|
|
|
|
/BeginSheet{
|
|
|
|
/sheetState save def
|
|
|
|
/pages-per-sheet exch def
|
2000-05-18 21:52:48 +00:00
|
|
|
|
|
|
|
% ---- translate to bottom-right corner of Portrait page
|
|
|
|
LandscapeMode{
|
|
|
|
LandscapePageHeight 0 translate
|
|
|
|
90 rotate
|
|
|
|
}if
|
|
|
|
% ---- [jack] Kludge: my ghostscript window is 21x27.7 instead of 21x29.7
|
|
|
|
/JackGhostscript where{pop 1 27.7 29.7 div scale}if
|
|
|
|
UpsideDown{PageWidth LandscapePageHeight translate 180 rotate}if
|
|
|
|
% ---- N-Up printing
|
|
|
|
N-Up 1 gt{
|
|
|
|
% ---- landscape
|
|
|
|
N-Up-Landscape{
|
|
|
|
PageWidth 0 translate
|
|
|
|
90 rotate
|
|
|
|
}if
|
|
|
|
N-Up-Margin dup translate
|
|
|
|
% ---- scale
|
|
|
|
LandscapeMode{
|
|
|
|
/HH PageWidth def
|
|
|
|
/WW LandscapePageHeight def
|
|
|
|
}{
|
|
|
|
/HH LandscapePageHeight def
|
|
|
|
/WW PageWidth def
|
|
|
|
}ifelse
|
2000-06-07 15:38:19 +00:00
|
|
|
/xx 0 def
|
|
|
|
N-Up-Landscape{
|
|
|
|
/ww WW WW mul N-Up-Lines HH mul div def
|
|
|
|
/cc HH N-Up-Columns N-Up-Missing add div def
|
|
|
|
ww cc gt{/xx WW def/WW cc ww div WW mul def/xx xx WW sub def}if
|
|
|
|
}{
|
|
|
|
/hh HH N-Up-Columns N-Up-Missing add div def
|
|
|
|
/cc HH N-Up-Lines div def
|
|
|
|
hh cc gt{/xx WW def/WW cc hh div WW mul def/xx xx WW sub def}if
|
|
|
|
}ifelse
|
2000-05-18 21:52:48 +00:00
|
|
|
WW N-Up-Margin sub N-Up-Margin sub
|
|
|
|
N-Up-Landscape
|
2000-06-07 15:38:19 +00:00
|
|
|
{N-Up-Lines div HH}
|
|
|
|
{N-Up-Columns N-Up-Missing add div WW}ifelse
|
2000-05-18 21:52:48 +00:00
|
|
|
div dup scale
|
2000-06-07 15:38:19 +00:00
|
|
|
LandscapeMode{/yy 0 def}{/yy xx def/xx 0 def}ifelse
|
|
|
|
xx N-Up-Repeat 1 sub LandscapePageHeight mul yy add translate
|
2000-05-18 21:52:48 +00:00
|
|
|
% ---- go to start position in page matrix
|
|
|
|
N-Up-XStart N-Up-Missing 0.5 mul
|
|
|
|
LandscapeMode
|
|
|
|
{LandscapePageHeight mul N-Up-YStart add}
|
|
|
|
{PageWidth mul add N-Up-YStart}ifelse
|
|
|
|
translate
|
|
|
|
}if
|
|
|
|
% ---- translate to lower left corner of TEXT
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
TextStart translate
|
2000-05-18 21:52:48 +00:00
|
|
|
|
2000-01-05 08:14:47 +00:00
|
|
|
% ---- N-up printing
|
|
|
|
N-Up 1 gt N-Up-Border and pages-per-sheet 0 gt and{
|
|
|
|
% ---- page border
|
|
|
|
gsave
|
|
|
|
0 setgray
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
TextStart exch neg exch neg moveto
|
2000-01-05 08:14:47 +00:00
|
|
|
N-Up-Repeat
|
|
|
|
{N-Up-End
|
|
|
|
{gsave
|
|
|
|
PageWidth 0 rlineto
|
|
|
|
0 LandscapePageHeight rlineto
|
|
|
|
PageWidth neg 0 rlineto
|
|
|
|
closepath stroke
|
|
|
|
grestore
|
|
|
|
/pages-per-sheet pages-per-sheet 1 sub def
|
|
|
|
pages-per-sheet 0 le{exit}if
|
|
|
|
N-Up-XColumn N-Up-YColumn rmoveto
|
|
|
|
}repeat
|
|
|
|
pages-per-sheet 0 le{exit}if
|
|
|
|
N-Up-XLine N-Up-XColumn sub N-Up-YLine rmoveto
|
|
|
|
}repeat
|
|
|
|
grestore
|
|
|
|
}if
|
|
|
|
}def
|
|
|
|
|
|
|
|
/EndSheet{
|
|
|
|
showpage
|
|
|
|
sheetState restore
|
|
|
|
}def
|
|
|
|
|
|
|
|
/SetHeaderLines{ % nb-lines --
|
|
|
|
/HeaderLines exch def
|
|
|
|
% ---- bottom up
|
|
|
|
HeaderPad
|
|
|
|
HeaderLines 1 sub HeaderLineHeight mul add
|
|
|
|
HeaderTitleLineHeight add
|
|
|
|
HeaderPad add
|
|
|
|
/HeaderHeight exch def
|
|
|
|
}def
|
|
|
|
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
/SetFooterLines{ % nb-lines --
|
|
|
|
/FooterLines exch def
|
|
|
|
% ---- bottom up
|
|
|
|
FooterPad
|
|
|
|
FooterLines FooterLineHeight mul add
|
|
|
|
FooterPad add
|
|
|
|
/FooterHeight exch def
|
|
|
|
}def
|
|
|
|
|
2000-01-05 08:14:47 +00:00
|
|
|
% |---------|
|
|
|
|
% | tm |
|
|
|
|
% |---------|
|
|
|
|
% | header |
|
|
|
|
% |-+-------| <-- (x y)
|
|
|
|
% | ho |
|
|
|
|
% |---------|
|
|
|
|
% | text |
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
% |---------|
|
|
|
|
% | fo |
|
|
|
|
% |---------|
|
|
|
|
% | footer |
|
2000-01-05 08:14:47 +00:00
|
|
|
% |-+-------| <-- (0 0)
|
|
|
|
% | bm |
|
|
|
|
% |---------|
|
|
|
|
|
2000-06-07 15:38:19 +00:00
|
|
|
% -- |- x y
|
|
|
|
/HeaderFrameStart{0 PrintHeight HeaderOffset add}def
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
/FooterFrameStart{0 FooterHeight FooterOffset add neg}def
|
|
|
|
|
|
|
|
/doFramePath{
|
|
|
|
/h exch def
|
|
|
|
PrintHeaderWidth 0 rlineto
|
|
|
|
0 h rlineto
|
|
|
|
PrintHeaderWidth neg 0 rlineto
|
|
|
|
0 h neg rlineto
|
2000-01-05 08:14:47 +00:00
|
|
|
}def
|
|
|
|
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
/HeaderFramePath{HeaderHeight doFramePath}def
|
|
|
|
/FooterFramePath{FooterHeight doFramePath}def
|
|
|
|
|
|
|
|
% /path-fun /start-fun vector-property doFrame
|
|
|
|
/doFrame{
|
|
|
|
/vecFrame exch def
|
|
|
|
/startFrame exch load def
|
|
|
|
/pathFrame exch load def
|
2000-01-05 08:14:47 +00:00
|
|
|
gsave
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
vecFrame 2 get setlinewidth % frame border width
|
|
|
|
% ---- do the shadow of the next rectangle
|
|
|
|
startFrame moveto
|
2000-01-05 08:14:47 +00:00
|
|
|
1 -1 rmoveto
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
pathFrame
|
|
|
|
vecFrame 4 get SetColor fill % frame shadow color
|
2000-01-05 08:14:47 +00:00
|
|
|
% ---- do the next rectangle ...
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
startFrame moveto
|
|
|
|
pathFrame
|
|
|
|
gsave vecFrame 1 get SetColor fill grestore % frame background
|
|
|
|
gsave vecFrame 3 get SetColor stroke grestore % frame border color
|
2000-01-05 08:14:47 +00:00
|
|
|
grestore
|
|
|
|
}def
|
|
|
|
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
/HeaderFrame{/HeaderFramePath /HeaderFrameStart HeaderFrameProperties doFrame}def
|
|
|
|
/FooterFrame{/FooterFramePath /FooterFrameStart FooterFrameProperties doFrame}def
|
|
|
|
|
2000-01-05 08:14:47 +00:00
|
|
|
/HeaderStart{
|
|
|
|
HeaderFrameStart
|
|
|
|
exch HeaderPad add exch % horizontal pad
|
|
|
|
% ---- bottom up
|
|
|
|
HeaderPad add % vertical pad
|
|
|
|
HeaderDescent sub
|
|
|
|
HeaderLineHeight HeaderLines 1 sub mul add
|
|
|
|
}def
|
|
|
|
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
/FooterStart{
|
|
|
|
FooterFrameStart
|
|
|
|
exch FooterPad add exch % horizontal pad
|
|
|
|
% ---- bottom up
|
|
|
|
FooterPad add % vertical pad
|
|
|
|
FooterDescent sub
|
|
|
|
FooterLineHeight FooterLines 1 sub mul add
|
|
|
|
}def
|
|
|
|
|
2004-03-30 03:08:48 +00:00
|
|
|
/HeaderClip{HeaderFrameStart moveto HeaderFramePath clip}def
|
|
|
|
/FooterClip{FooterFrameStart moveto FooterFramePath clip}def
|
|
|
|
|
2000-01-05 08:14:47 +00:00
|
|
|
/strcat{
|
|
|
|
dup length 3 -1 roll dup length dup 4 -1 roll add string dup
|
|
|
|
0 5 -1 roll putinterval
|
|
|
|
dup 4 2 roll exch putinterval
|
|
|
|
}def
|
|
|
|
|
|
|
|
/pagenumberstring{
|
|
|
|
PageNumber 32 string cvs
|
2000-06-07 15:38:19 +00:00
|
|
|
ShowNofN{(/)strcat PageCount 32 string cvs strcat}if
|
2000-01-05 08:14:47 +00:00
|
|
|
}def
|
|
|
|
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
% lines is-right HeaderOrFooterTextLines
|
|
|
|
/HeaderOrFooterTextLines{
|
|
|
|
/is_right exch def
|
|
|
|
HFStart moveto
|
|
|
|
{ % ---- process the lines
|
|
|
|
aload pop
|
|
|
|
exch F
|
|
|
|
gsave
|
|
|
|
dup xcheck{exec}if
|
|
|
|
is_right{
|
|
|
|
dup stringwidth pop
|
|
|
|
PrintHeaderWidth exch sub HFPad HFPad add sub 0 rmoveto
|
|
|
|
}if
|
|
|
|
HFColor SetColor
|
|
|
|
show
|
|
|
|
grestore
|
|
|
|
0 HFLineHeight neg rmoveto
|
|
|
|
}forall
|
|
|
|
}def
|
2000-01-05 08:14:47 +00:00
|
|
|
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
% right-lines left-lines /start lineheight pad fore-color HeaderOrFooterText
|
|
|
|
/HeaderOrFooterText{
|
|
|
|
/HFColor exch def
|
|
|
|
/HFPad exch def
|
|
|
|
/HFLineHeight exch def
|
|
|
|
/HFStart exch load def
|
2000-01-05 08:14:47 +00:00
|
|
|
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
% -- rightLines leftLines -- at stack
|
2000-01-05 08:14:47 +00:00
|
|
|
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
% ---- hack: `PN 1 and' == `PN 2 modulo'
|
2000-01-05 08:14:47 +00:00
|
|
|
% ---- if even page number and duplex, then exchange left and right
|
2000-06-07 15:38:19 +00:00
|
|
|
PageNumber 1 and 0 eq SwitchHeader and{exch}if
|
2000-01-05 08:14:47 +00:00
|
|
|
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
% ---- process the left lines
|
|
|
|
false HeaderOrFooterTextLines
|
2000-01-05 08:14:47 +00:00
|
|
|
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
% ---- process the right lines
|
|
|
|
true HeaderOrFooterTextLines
|
|
|
|
}def
|
2000-01-05 08:14:47 +00:00
|
|
|
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
/HeaderText{
|
2004-03-30 03:08:48 +00:00
|
|
|
gsave HeaderClip
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
HeaderLinesRight HeaderLinesLeft
|
|
|
|
/HeaderStart HeaderLineHeight HeaderPad
|
|
|
|
HeaderFrameProperties 0 get
|
|
|
|
HeaderOrFooterText
|
2004-03-30 03:08:48 +00:00
|
|
|
grestore
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
}def
|
|
|
|
|
|
|
|
/FooterText{
|
2004-03-30 03:08:48 +00:00
|
|
|
gsave FooterClip
|
Footer implementation. Doc fix.
(doLineNumber): Code fix for line number color.
(BeginPage, BeginSheet, HeaderFramePath, HeaderFrame, HeaderText): Code
fix for footer implementation.
(TextStart, SetFooterLines, FooterFrameStart, doFramePath)
(FooterFramePath, doFrame, FooterFrame, FooterStart)
(HeaderOrFooterTextLines, HeaderOrFooterText, FooterText): New funs.
2001-04-10 11:34:26 +00:00
|
|
|
FooterLinesRight FooterLinesLeft
|
|
|
|
/FooterStart FooterLineHeight FooterPad
|
|
|
|
FooterFrameProperties 0 get
|
|
|
|
HeaderOrFooterText
|
2004-03-30 03:08:48 +00:00
|
|
|
grestore
|
2000-01-05 08:14:47 +00:00
|
|
|
}def
|
|
|
|
|
|
|
|
/ReportFontInfo{
|
|
|
|
2 copy
|
|
|
|
/t0 3 1 roll DefFont
|
|
|
|
/t0 F
|
|
|
|
/lh FontHeight def
|
2000-06-07 15:38:19 +00:00
|
|
|
/sw( )stringwidth pop def
|
|
|
|
/aw(01234567890abcdefghijklmnopqrstuvwxyz)dup length exch
|
2000-01-05 08:14:47 +00:00
|
|
|
stringwidth pop exch div def
|
2000-06-07 15:38:19 +00:00
|
|
|
/t1 12/Helvetica-Oblique DefFont
|
2000-01-05 08:14:47 +00:00
|
|
|
/t1 F
|
|
|
|
gsave
|
2000-06-07 15:38:19 +00:00
|
|
|
(languagelevel = )show
|
2000-03-30 13:27:27 +00:00
|
|
|
languagelevel 32 string cvs show
|
2000-01-05 08:14:47 +00:00
|
|
|
grestore
|
|
|
|
0 FontHeight neg rmoveto
|
|
|
|
gsave
|
2000-06-07 15:38:19 +00:00
|
|
|
(For )show
|
2000-01-05 08:14:47 +00:00
|
|
|
128 string cvs show
|
2000-06-07 15:38:19 +00:00
|
|
|
( )show
|
2000-01-05 08:14:47 +00:00
|
|
|
32 string cvs show
|
2000-06-07 15:38:19 +00:00
|
|
|
( point, the line height is )show
|
2000-01-05 08:14:47 +00:00
|
|
|
lh 32 string cvs show
|
2000-06-07 15:38:19 +00:00
|
|
|
(, the space width is )show
|
2000-01-05 08:14:47 +00:00
|
|
|
sw 32 string cvs show
|
2000-06-07 15:38:19 +00:00
|
|
|
(,)show
|
2000-01-05 08:14:47 +00:00
|
|
|
grestore
|
|
|
|
0 FontHeight neg rmoveto
|
|
|
|
gsave
|
2000-06-07 15:38:19 +00:00
|
|
|
(and a crude estimate of average character width is )show
|
2000-01-05 08:14:47 +00:00
|
|
|
aw 32 string cvs show
|
2000-06-07 15:38:19 +00:00
|
|
|
(.)show
|
2000-01-05 08:14:47 +00:00
|
|
|
grestore
|
|
|
|
0 FontHeight neg rmoveto
|
|
|
|
}def
|
|
|
|
|
2000-06-07 15:38:19 +00:00
|
|
|
% cm to point
|
|
|
|
/cm{72 mul 2.54 div}def
|
2000-01-05 08:14:47 +00:00
|
|
|
|
|
|
|
/ReportAllFontInfo{
|
2000-06-07 15:38:19 +00:00
|
|
|
% key = font name value = font dictionary
|
|
|
|
FontDirectory{pop 10 exch ReportFontInfo}forall
|
2000-01-05 08:14:47 +00:00
|
|
|
}def
|
|
|
|
|
2000-06-07 15:38:19 +00:00
|
|
|
% 3 cm 20 cm moveto 10/Courier ReportFontInfo showpage
|
|
|
|
% 3 cm 20 cm moveto ReportAllFontInfo showpage
|
2000-01-05 08:14:47 +00:00
|
|
|
|
|
|
|
% === END ps-print prologue 1
|