
%
% ctrl-D to clear any hanging input
%
% dBASE IV Postscript Download File (Postscri.dld)
% Copyright 1989,1991 Borland International, Inc.
% version 1.13
% $Revision:   1.3  $ 
%
% --------- User-adjustable parameters -------
% default page size & orientation
/paper 1 def      % (1=letter, 2=legal, 3=A4)
/orient 1 def     % (1=portrait, 2=landscape)
/nLPP 66 def      % lines per page (60, 66, 78, or 88 for portrait;
                  %                 45 for landscape)
% printer-dependent portrait offsets
/tpxoff 18 def    % x (letter)
/tpyoff 28 def    % y (letter)
/gpxoff 22 def    % x (legal)
/gpyoff 26 def    % y (legal)
/apxoff 16 def    % x (A4)
/apyoff 18 def    % y (A4)
% printer-dependent landscape offsets
/tlxoff 18 def    % x (letter)
/tlyoff 44 def    % y (letter)
/glxoff 18 def    % x (legal)
/glyoff 80 def    % y (legal)
/alxoff  0 def    % x (A4)
/alyoff 29 def    % y (A4)
% point sizes to use
/PicaPoint 12 def                            % Pica
/ElitePoint 10 def                           % Elite
/CompressedPoint 8 def                       % compressed
/CurPoint PicaPoint def                      % initial pointsize
% fonts to use
/CurFSet 1 def                               % default font set
/FSet {
         /CurFSet exch def
         % Font Set 1 (default)
         /n       /Courier-Foreign def                        % normal
         /b       /Courier-Bold-Foreign def                   % bold
         /i       /Courier-Oblique-Foreign def                % italic
         /bi      /Courier-BoldOblique-Foreign def            % bold+italic
         CurFSet 2 eq
                  {
                  /n       /Helvetica-Foreign def
                  /b       /Helvetica-Bold-Foreign def
                  /i       /Helvetica-Oblique-Foreign def
                  /bi      /Helvetica-BoldOblique-Foreign def
                  } if
         CurFSet 3 eq
                  {
                  /n       /Times-Roman-Foreign def
                  /b       /Times-Bold-Foreign def
                  /i       /Times-Italic-Foreign def
                  /bi      /Times-BoldItalic-Foreign def
                  } if
         /FontNorm n def
         /FontBold b def
         /FontItal i def
         /FontBoldItal bi def
         Norm
   } def
% --------- End User-adjustable parameters -------
% ------ User-callable macros
/Letter  {/paper 1 def OrientPaper} def      % Set Letter
/Legal   {/paper 2 def OrientPaper} def      % Set Legal
/A4      {/paper 3 def OrientPaper} def      % Set A4
/Port    {/orient 1 def OrientPaper} def     % Set Portrait
/Land    {/orient 2 def OrientPaper} def     % Set Landscape
/60LPP   {60 LPP} def
/66LPP   {66 LPP} def
/78LPP   {78 LPP} def
/88LPP   {88 LPP} def
/1Font   {1 FSet} def
/2Font   {2 FSet} def
/3Font   {3 FSet} def
% Synonyms
/LETTER  {Letter} def
/LEGAL   {Legal} def 
/PORT    {Port} def /port {Port} def
/LAND    {Land} def /land {Land} def
/60lpp {60LPP} def
/66lpp {66LPP} def
/78lpp {78LPP} def
/88lpp {88LPP} def
/1FONT {1Font} def /1font {1Font} def
/2FONT {2Font} def /2font {2Font} def
/3FONT {3Font} def /3font {3Font} def
% ------ End
%
% Page Setup
/PSet {
         initmatrix
         CurFSet FSet
         /CPI 10 def
         /LPI 6 def
         /HMI 72 def
         /VMI 72 def
         paper 1 eq
                  {orient 1 eq      % letter
                           {/w 8.5 def /h 10.0 def             % letter port
                           nLPP 60 eq {/h 10.0 def} if
                           nLPP 66 eq {/h 10.1 def /LPI 6.6 def} if
                           nLPP 78 eq {/h 13.0 def} if
                           }
                           {/w 11.0 def /h 7.5 def             % letter land
                           /nLPP 45 def
                           } ifelse
                  } if
         paper 2 eq
                  {orient 1 eq      % legal
                           {/w 8.5 def /h 13.1 def             % legal port
                           /nLPP 78 def
                           }
                           {/w 14.0 def /h 6.5 def             % legal land
                           /nLPP 45 def
                           } ifelse
                  } if
         paper 3 eq
                  {orient 1 eq      % A4
                           {/w 8.5 def /h 11 def               % A4 port
			   /LPI 6.05 def		       % makes labels work
                           nLPP 88 eq {/LPI 8 def} if
                           }
                           {/w 11 def /h 7.5 def               % A4 land
                           /nLPP 45 def
                           } ifelse
                  } if
         /PageWidth w def
         /PageHeight h def
   } def

% initialize variables
/BaseLine 0 def
/Bon 0 def
/Ion 0 def
/LocalBox 0 def
%----
%
% Define new BaseLine value
/DefBase {        % args = (new baseline)
   /BaseLine exch def
   } def
%
% Move to a new line
/GoNewLine {      % args = (x,y)
   dup DefBase moveto
   currentpoint exch pop 0 lt {FF} if
   } def
%
% Rotate and/or Translate (if nec.)
/RoTran {
         orient 1 eq
                  {paper 1 eq                                  % PORTRAIT
                           {tpxoff tpyoff translate}           % Letter
                           {paper 2 eq
                                    {gpxoff gpyoff translate}  % Legal
                                    {apxoff apyoff translate}  % A4
                           ifelse
                           } 
                  ifelse
                  }
                  {-90 rotate                                  % LANDSCAPE
                  paper 1 eq
                           {11.0}                              % Letter
                           {paper 2 eq
                                    {14.0}                     % Legal
                                    {11.5}                     % A4
                           ifelse
                           }
                  ifelse
                  VMI mul neg 0 translate
                  
                  paper 1 eq
                           {tlxoff tlyoff translate}           % Letter
                           {paper 2 eq
                                    {glxoff glyoff translate}  % Legal
                                    {alxoff alyoff translate}  % A4
                                    ifelse
                                    }
                           ifelse

                  /LPI 6 def}
                  ifelse
         } def
%
%        Move to top left corner of new page
/Home {
   RoTran
   clear
   0
   PageHeight VMI mul
      GoNewLine CRLF
   } def
%
% Set nLPP
/LPP {   % arg = (#lines per page)
   /nLPP exch def
   PSet
   Home
   } def
% Chg Orientation or Paper
%
/OrientPaper {
         PSet
         Home
         } def
%
%        Initialization
/Init {
   1.415 setmiterlimit
   Home
   Norm
   } def
%
% FormFeed
/FF {
   showpage
   Home
   } def
%
% Carriage Return w/o LF
/CR {
   currentpoint
   exch  pop
   0
   exch moveto
   } def
%
% Carriage Return w/ Line Feed
/CRLF {
   CR currentpoint
   VMI LPI div
   sub
   paper 3 ne { round } if     %% forces a4 7x2's to line up correctly
   GoNewLine
   } def
%
% Backspace
/BS {
   currentpoint
   exch                    % bring x-pos to top
   ( ) stringwidth         % get current font x,y size
   pop                     % get rid of y-size
   sub                     % backup 1 char's worth
   exch moveto
   } def
%
% Establish a different font
/NewFont {
   CurFont findfont
   CurPoint scalefont
   setfont
   } def
%
% Start compressed (15 cpi) print
/Cmp+ {/CurPoint CompressedPoint def NewFont} def
%
% End compressed print
/Cmp- {/CurPoint PicaPoint def NewFont} def
%
% Start Pica pitch
/10Cpi {/CurPoint PicaPoint def NewFont} def
%
% Start Elite pitch
/12Cpi {/CurPoint ElitePoint def NewFont} def
%
% Change to a different font (same size): aFont ChgFont
/ChgFont {
   /CurFont exch def
   CurFont findfont
   CurPoint scalefont
   setfont
   } def
%
% Select un-attributed text
/Norm {
   FontNorm ChgFont
   /Bon 0 def
   /Ion 0 def
   } def
%
% Select bolded text
/Bold {
   Ion 0 eq
      {FontBold ChgFont}
      {FontBoldItal ChgFont}
      ifelse
   /Bon 1 def
   } def
%
% Select un-Bolded text
/BNorm {
   Ion 0 eq
      {FontNorm ChgFont}
      {FontItal ChgFont}
      ifelse
   /Bon 0 def
   } def
%
% Select italicized text
/Ital {
   Bon 0 eq
      {FontItal ChgFont}
      {FontBoldItal ChgFont}
      ifelse
   /Ion 1 def
   } def
%
% Select un-Italicized text
/INorm {
   Bon 0 eq
      {FontNorm ChgFont}
      {FontBold ChgFont}
      ifelse
   /Ion 0 def
   } def
%
% Select bold+italicized text
/BoIt {
   FontBoldItal ChgFont
   /Bon 1 def
   /Ion 1 def
   } def
%
% 1. calc a positive line movement of 1/2 the current point size
% 2. move to the current baseline position
/Script {
   VMI CurPoint idiv 2 idiv
   currentpoint pop BaseLine moveto
   } def
%
% Start superscript
/Sup+ {0 Script rmoveto} def
%
% End superscript
/Sup- {Script pop} def
%
% Start subscript
/Sub+ {0 Script neg rmoveto} def
%
% End subscript
/Sub- {Script pop} def
%
% Start underlined text
/Und+ {
   currentpoint pop BaseLine        % estab start of underline position
   2 sub                   % Y-pos = 2 points down from baseline
   } def
%
% End underlined text
/Und- {
   currentpoint   % save current location
   Und+ moveto    % move to ending underline position
   4 2 roll                % bring starting underline position to top of stack
   lineto                  % draw the line
   stroke
   moveto                  % return to original location
   } def
%
% Overstrike 1st char w/ 2nd char
/OV {             % string OV
   /str 2 1 roll def
   currentpoint
   str 0 1 getinterval show
   moveto
   str 1 1 getinterval show
   } def
%
% we are going to draw characters using current size
% each point in movement is 1/72 of an inch
% curpoint has the current character pitch selected
% we'll use an oversized cell to contain all characters
% to handle porportionally spaced font
% Character height to be calculated from current lpi setting
% character width to be calculated from current pitch setting
%
% Horizontal Line CHR(196) for single, CHR(205) for double
/A {
	/MLineHeight 72 LPI div 2 div def
	/MLineWidth 72 CurPoint div 5 mul 8 div def
	/MLineWidth ( ) stringwidth pop 2 div def
	show
	currentpoint
	0 MLineHeight rmoveto
	MLineWidth 2 mul 0 rlineto
	stroke
	moveto
	MLineWidth 2 mul 0 rmoveto
   } def
%
/B {
	/MLineHeight 72 LPI div 2 div def
	/MLineWidth 72 CurPoint div 5 mul 8 div def
	/MLineWidth ( ) stringwidth pop 2 div def
	show
	currentpoint
	0 MLineHeight 1 sub rmoveto
	MLineWidth 2 mul 0 rlineto
	stroke
	moveto
	currentpoint
	0 MLineHeight 1 add rmoveto
	MLineWidth 2 mul 0 rlineto
	stroke
	moveto
	MLineWidth 2 mul 0 rmoveto
   } def
%
% Vertical Line CHR(179) for single, CHR(186) for double
/C {
	/MLineHeight 72 LPI div 2 div def
	/MLineWidth 72 CurPoint div 5 mul 8 div def
	/MLineWidth ( ) stringwidth pop 2 div def
	show
	currentpoint
	MLineWidth 0 rmoveto
	0 MLineHeight 2 mul rlineto
	stroke
	moveto
	MLineWidth 2 mul 0 rmoveto
   } def
%
/D {
	/MLineHeight 72 LPI div 2 div def
	/MLineWidth 72 CurPoint div 5 mul 8 div def
	/MLineWidth ( ) stringwidth pop 2 div def
	show
	currentpoint
	MLineWidth 1 sub 0 rmoveto
	0 MLineHeight 2 mul rlineto
	stroke
	moveto
	currentpoint
	MLineWidth 1 add 0 rmoveto
	0 MLineHeight 2 mul rlineto
	stroke
	moveto
	MLineWidth 2 mul 0 rmoveto
   } def
%
% Top Left Corner	CHR(218) for single, CHR(201) for double
/E {
	/MLineHeight 72 LPI div 2 div def
	/MLineWidth 72 CurPoint div 5 mul 8 div def
	/MLineWidth ( ) stringwidth pop 2 div def
	show
	currentpoint
	MLineWidth 0 rmoveto
	0 MLineHeight rlineto
	MLineWidth 0 rlineto
	stroke
	moveto
	MLineWidth 2 mul 0 rmoveto
   } def
%
/F {
	/MLineHeight 72 LPI div 2 div def
	/MLineWidth 72 CurPoint div 5 mul 8 div def
	/MLineWidth ( ) stringwidth pop 2 div def
	show
	currentpoint
	MLineWidth 1 sub 0 rmoveto
	0 MLineHeight 1 add rlineto
	MLineWidth 1 add 0 rlineto
	stroke
	moveto
	currentpoint
	MLineWidth 1 add 0 rmoveto
	0 MLineHeight 1 sub  rlineto
	MLineWidth 1 sub 0 rlineto
	stroke
	moveto
	MLineWidth 2 mul 0 rmoveto
   } def
%
% Bottom Left Corner	CHR(192) for single, CHR(200) for double
/G {
	/MLineHeight 72 LPI div 2 div def
	/MLineWidth 72 CurPoint div 5 mul 8 div def
	/MLineWidth ( ) stringwidth pop 2 div def
	show
	currentpoint
	MLineWidth MLineHeight 2 mul rmoveto
	0 0 MLineHeight sub rlineto
	MLineWidth 0 rlineto
	stroke
	moveto
	MLineWidth 2 mul 0 rmoveto
   } def
%
/H {
	/MLineHeight 72 LPI div 2 div def
	/MLineWidth 72 CurPoint div 5 mul 8 div def
	/MLineWidth ( ) stringwidth pop 2 div def
	show
	currentpoint
	MLineWidth 1 sub MLineHeight 2 mul rmoveto
	0 0 MLineHeight 1 add sub rlineto
	MLineWidth 1 add 0 rlineto
	stroke
	moveto
	currentpoint
	MLineWidth 1 add MLineHeight 2 mul rmoveto
	0 0 MLineHeight 1 sub sub  rlineto
	MLineWidth 1 sub 0 rlineto
	stroke
	moveto
	MLineWidth 2 mul 0 rmoveto
   } def
%
% Top Right Corner	CHR(191) for single, CHR(187) for double
/I {
	/MLineHeight 72 LPI div 2 div def
	/MLineWidth 72 CurPoint div 5 mul 8 div def
	/MLineWidth ( ) stringwidth pop 2 div def
	show
	currentpoint
	0 MLineHeight rmoveto
	MLineWidth 0 rlineto
	0 0 MLineHeight sub rlineto
	stroke
	moveto
	MLineWidth 2 mul 0 rmoveto
   } def
%
/J {
	/MLineHeight 72 LPI div 2 div def
	/MLineWidth 72 CurPoint div 5 mul 8 div def
	/MLineWidth ( ) stringwidth pop 2 div def
	show
	currentpoint
	0 MLineHeight 1 add rmoveto
	MLineWidth 1 add 0 rlineto
	0 0 MLineHeight 1 add sub rlineto
	stroke
	moveto
	currentpoint
	0 MLineHeight 1 sub rmoveto
	MLineWidth 1 sub 0 rlineto
	0 0 MLineHeight 1 sub sub rlineto
	stroke
	moveto
	MLineWidth 2 mul 0 rmoveto
   } def
%
% Bottom Right Corner	CHR(217) for single, CHR(188) for double
/K {
	/MLineHeight 72 LPI div 2 div def
	/MLineWidth 72 CurPoint div 5 mul 8 div def
	/MLineWidth ( ) stringwidth pop 2 div def
	show
	currentpoint
	0 MLineHeight rmoveto
	MLineWidth 0 rlineto
	0 MLineHeight rlineto
	stroke
	moveto
	MLineWidth 2 mul 0 rmoveto
   } def
%
/L {
	/MLineHeight 72 LPI div 2 div def
	/MLineWidth 72 CurPoint div 5 mul 8 div def
	/MLineWidth ( ) stringwidth pop 2 div def
	show
	currentpoint
	0 MLineHeight 1 sub rmoveto
	MLineWidth 1 add 0 rlineto
	0 MLineHeight 1 add rlineto
	stroke
	moveto
	currentpoint
	0 MLineHeight 1 add  rmoveto
	MLineWidth 1 sub 0 rlineto
	0 MLineHeight 1 sub rlineto
	stroke
	moveto
	MLineWidth 2 mul 0 rmoveto
   } def
%
/reencodedict 36 dict def
/ReEncode
  {reencodedict begin
   /newfontname exch def
   /basefontname exch def
   /basefontdict basefontname findfont def
   /newfont basefontdict maxlength dict def
   basefontdict
     {exch dup /FID ne
       {dup /Encoding eq
         {exch dup length array copy
            newfont 3 1 roll put}
         {exch newfont 3 1 roll put}
         ifelse}
       {pop pop}
       ifelse
     } forall
   newfont /FontName newfontname put
   foreignvec aload pop
   foreignvec length 2 idiv
   {newfont /Encoding get 3 1 roll put}
   repeat
   newfontname newfont definefont pop
   end 
  } def
/foreignvec [
128 /Ccedilla
129 /udieresis
130 /eacute
131 /acircumflex
132 /adieresis
133 /agrave
134 /aring
135 /ccedilla
136 /ecircumflex
137 /edieresis
138 /egrave
139 /idieresis
140 /icircumflex
141 /igrave
142 /Adieresis
143 /Aring
144 /Eacute
145 /ae
146 /AE
147 /ocircumflex
148 /odieresis
149 /ograve
150 /ucircumflex
151 /ugrave
152 /ydieresis
153 /Odieresis
154 /Udieresis
155 /cent
156 /sterling
157 /yen
159 /florin
160 /aacute
161 /iacute                      
162 /oacute
163 /uacute
164 /ntilde
165 /Ntilde
166 /ordfeminine
167 /ordmasculine
168 /questiondown
173 /exclamdown
174 /guillemotleft
175 /guillemotright
225 /germandbls
249 /bullet
] def
/Courier /Courier-Foreign ReEncode
/Courier-Bold /Courier-Bold-Foreign ReEncode
/Courier-Oblique /Courier-Oblique-Foreign ReEncode
/Courier-BoldOblique /Courier-BoldOblique-Foreign ReEncode
/Helvetica /Helvetica-Foreign ReEncode
/Helvetica-Bold /Helvetica-Bold-Foreign ReEncode
/Helvetica-Oblique /Helvetica-Oblique-Foreign ReEncode
/Helvetica-BoldOblique /Helvetica-BoldOblique-Foreign ReEncode
/Times-Roman /Times-Roman-Foreign ReEncode
/Times-Bold /Times-Bold-Foreign ReEncode
/Times-Italic /Times-Italic-Foreign ReEncode
/Times-BoldItalic /Times-BoldItalic-Foreign ReEncode
PSet
%----- end of Postscri.dld ----
