LMFL#!C(:PADDED T :HOST "SYS" :BACKUP-DATE 2773683927. :SYSTEM-TYPE :LOGICAL :VERSION 60. :TYPE "TEXT" :NAME "POSTSCRIPT-DRIVER" :DIRECTORY ("REL3-2" "PRINTER") :SOURCE-PATTERN "( :DIRECTORY (\"REL3-2\") :NAME :WILD :TYPE :WILD :VERSION :NEWEST)" :CHARACTERS T :NOT-BACKED-UP T :CREATION-DATE 2770657601. :AUTHOR "REL3-2" :LENGTH-IN-BYTES 13562. :LENGTH-IN-BLOCKS 14. :BYTE-SIZE 8.)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  %Explorer PostScript driver file%!PS-Adobe-1.0%%%                           RESTRICTED RIGHTS LEGEND %%%Use, duplication, or disclosure by the Government is subject to%%%restrictions as set forth in subdivision (b)(3)(ii) of the Rights in%%%Technical Data and Computer Software clause at 52.227-7013.%%%%%%                     TEXAS INSTRUMENTS INCORPORATED.%%%                              P.O. BOX 2909%%%                           AUSTIN, TEXAS 78769%%%                                 MS 2151%%%%%% Copyright (C) 1987, Texas Instruments Incorporated. All rights%%% reserved.%%% NOTE: DO NOT ALLOW ANY TAB CHARACTERS IN THIS FILE. POSTSCRIPT WILL%%%  SIMPLY STOP PROCESSING WHEN IT SEES A TAB.%%%This file contains the PS program used by the Explorer PS printer%%% driver. This file is downloaded to the printer for each print%%% request. The entry point for text files is PrintFile. The entry%%% point for screen dumps is PrintScreenImage. This code is tough to%%% debug. Usually if there is an error, the printer just quits. The%%% best way to figure out what went wrong is to use the subroutine%%% called Test. Insert a call to Test at about where you suspect the%%% problem. If the printer gets that far, then a page will be printed %%% displaying the top two elements of the PS stack. Sometimes you just%%% have to do a binary search placing Test in various location until%%% you narrow down the problem. Once you know which part of this code%%% is failing, you can usually figure out what's going on by executing%%% it in Interactive mode. Kermit (in the public directory) is a good %%% terminal emulator to use. The code in public:public;vt100-yank.xld%%% allows you to mark text in Zmacs and then yank it into the VT100%%% emulator instance running Kermit. Happy hunting/Test{ /bitstr 80 string def /Helvetica findfont 10 scalefont setfont 200 200 moveto (TEST: stack top 2 = ) show dup bitstr cvs show exch ( ) show  dup bitstr cvs show exch showpage } def/PrinterCheck {(*) print}def/my-in (%stdin) (r) file def/Orientation%Determine if wide printing{  /my-in (%stdin) (r) file def /rstr 10 string def /leftmargin 40 def /ybot 25 def my-in rstr readline pop rstr cvi 0 eq  {  /topmargin 770 def  /rightmargin 576 def }  {  rstr cvi rotate  0 -612 translate      %09-22-87 DAB  /topmargin 576 def  /rightmargin 770 def } ifelse } bind def/MyShow{show} bind def/PostScriptProgram                        %Handles PS program embedded in file being printed { gsave  {   my-in nstr readline    pop%   Test   cvx   exec    my-in read pop%   Test   1 eq {exit} if    } loop  grestore } bind def /SetPointSize%Sets the current point size of the font{/pointstring 4 string def my-in pointstring readline                               %point size pop                                      %Get rid of true cvi                                      %10-19-87 DAB To get value out of the control char range.       /PointSize exch def                      %Exchange top of stack to put                                          % definition in right order } bind def/TitlePage%Print the header page{initgraphics                              %reset graphics state                                           %Draw box on page 25 setlinewidth 0 setlinejoin 2 setlinecap .5 setgray 36 760 moveto 537 0 rlineto 0  -735 rlineto -537 0 rlineto 0 735 rlineto stroke 0 setgray  /Times-Roman findfont 12 scalefont setfont  leftmargin 15 add 725 moveto  (Owner: ) show leftmargin 60 add 725 moveto counttomark 1 add index show  leftmargin 15 add 700 moveto  (File:) show leftmargin 60 add 700 moveto pstr show   %counttomark 2 add index show  leftmargin 15 add 675 moveto  (Date:) show leftmargin 60 add 675 moveto counttomark 3 add index show  leftmargin 15 add 100 moveto   [11 0 0 13 0 0]  /Times-Roman findfont exch makefont setfont 100 100 moveto (T) show  [10 0 0 9 0 0]  /Times-Roman findfont exch makefont setfont 106 100 moveto (EXAS) show  [11 0 0 13 0 0]  /Times-Roman findfont exch makefont setfont 135 100 moveto (I) show  [10 0 0 9 0 0]  /Times-Roman findfont exch makefont setfont 139 100 moveto  (NSTRUMENTS) show  420 55 moveto (PostScript) show  /Symbol findfont 6 scalefont setfont  currentpoint 3 add moveto  (\322 ) show  currentpoint 3 sub moveto  [10 0 0 9 0 0]  /Times-Roman findfont exch makefont setfont  (Version ) show version show  /Helvetica-Oblique findfont 12 scalefont setfont  100 85 moveto (Explorer) show  /Symbol findfont 8 scalefont setfont  currentpoint exch 2 add exch 3 add moveto  (\344) show  showpage} bind def/Startup%Sets up initial strings and constants. Reads header page and page%heading information. Determines if header page is needed, etc.  {clear  /leftmargin 40 def  /topmargin 770 def  /ybot 25 def                            %Offset from bottom margin  /nstr 255 string def                    %Various strings  /astr 80 string def  /bstr 80 string def  /cstr 80 string def  /hstr 255 string def  /tstr 20 string def  /fstr 255 string def  /pstr 80 string def  1                                       %push current page count on                                          % stack  my-in hstr readline pop                 %Send the the heading second                                          % line. If its not nil print                                          % header.  my-in astr readline pop                 %Read current time  my-in bstr readline pop                 %Read file name  my-in cstr readline pop                 %Read name of current user  mark                                    %Mark start of page header                                          % info on stack  my-in pstr readline pop                 %Get title page info  length 0 gt {TitlePage} if              %Print title page?  }  bind def/NewHeadingLine%Newline for the page header.{ currentpoint 12 sub  exch pop leftmargin exch moveto } bind def/PrintHeading%Prints the page heading on top of each page if needed. { counttomark 4 add index length 0 gt    %Heading requested?   {currentfont   /Courier findfont 10 scalefont setfont  counttomark 2 add index show            %Print file name  currentpoint exch pop 400 exch moveto  ( ) show counttomark 3 add index show   %Print current time  ( Page:) show counttomark 5 add index tstr cvs show  %Print page number  counttomark 6 add -1 roll               %Get page number on top of stack  1 add                                   %Increment page number  counttomark 5 add 1 roll                %Put stack back the way it was  NewHeadingLine  counttomark 4 add index show            %Print 2nd line of header  NewHeadingLine  setfont                                 %Reset to old font                                          %Draw solid line  gsave currentpoint exch rightmargin add exch lineto   stroke grestore                        NewLine} if } bind def/NewPage%Handle page feed {gsave showpage grestore leftmargin topmargin PointSize sub moveto  %Set the top of the page PrintHeading   } bind def /moveDown%Calculates how much to drop line: Pointsize + 10%{ PointSize PointSize 10 div add sub} bind def/ChangeFont {/pointstring 4 string def               %10-19-87 DAB Get the chars values out of the range of ascii control char range [                                        %make an array for the font my-in pointstring readline                %read point width pop cvi                                   %get rid of the true 0 0 my-in pointstring readline                %read point height pop cvi                                    %get rid of the true 0 0 ]                                         %end of fontmatrix array my-in fstr readline                       %read font pop                                       %get rid of true cvn findfont                                  %get off of top of stack exch  makefont setfont } bind def/NewLine {  currentpoint exch pop                     %Get the y value by it self                                           %If too close to bottom do                                           % page feed, else new line  moveDown dup ybot lt {NewPage pop} {leftmargin  exch  moveto } ifelse } bind def /LineWrap%Handle line wrap condition {   {dup dup length 1 sub                   %String length minus CR    0 exch getinterval                     %String without CR                                           %If not too long, exit     dup stringwidth pop currentpoint pop add rightmargin gt {} {exit} ifelse    } loop   dup   MyShow                                    %Print first line   (!) MyShow  length /StringIndex exch def   cleartomark  NewLine  dup length                               %Put remainder of line on stack  StringIndex sub StringIndex exch getinterval  } bind def/TabSpace%Print tab{ currentpoint  exch                                      %get x-coordinate ( ) stringwidth pop add                   %position past next char spot exch moveto leftmargin {TabWidth add                             %cumulatively add TabWidth to itself   dup currentpoint pop gt                 % until we hit a valid tab stop   {exit} if                               % leaving tab stop on top of stack  } loop currentpoint exch pop exch dup rightmargin gt                   %if this would put us past right margin {(!) show NewLine }                       % then do a newline {exch moveto} ifelse                      % else go to tab stop  } bind def/StartText%Set things up for text files.{  SetPointSize  ChangeFont  /TabWidth (w) stringwidth pop 8.0 mul def  leftmargin topmargin PointSize sub moveto  %Initial starting spot  PrintHeading} bind def /PrintSymbol%Print character from the Symbol font {currentfont                              %Get the font matrix for the                                           % current font.  dup  begin                                    %Put dictionary on stack  FontMatrix  end                                      %Pop dictionaly  [1000 0 0 1000 0 0]                      %Matrix to multiply to get                                           % ready for makefont.  [1 0 0 1 0 0]                            %Matrix to store the changes in  concatmatrix  /Symbol findfont exch makefont setfont  my-in nstr readline  pop  dup stringwidth pop currentpoint pop add rightmargin gt { NewLine} if  show  setfont  } bind def/PrintLozenge%Print a lozenge{  /lstr 20 string def currentfont  /Helvetica findfont 5 scalefont setfont my-in lstr readline pop stringwidth pop   %Read lozenge contents and calculate size dup 2 add currentpoint pop add rightmargin gt %test if enough room in the line  {1 index currentfont  exch setfont             %reset the previous font  (!) show  setfont                  %reset Helvetica  NewLine  } if currentpoint 3 -1 roll                %put the string on top gsave currentpoint 4 add exch 2 add exch moveto %left vertex 5 4 rlineto                               %left / dup 0 rlineto                             %top 5 -4 rlineto                              %right \ -5 -4 rlineto                             %right / dup neg 0 rlineto                         %bottom -5 4 rlineto                              %left \ closepath 5 -2 rmoveto                              %start name of lozenge pop lstr show  .3 setlinewidth stroke  grestore exch lstr stringwidth pop add  exch moveto setfont                                       %Set point for next character } bind def/PrintFile{   Startup Orientation   %Swapped statements 09-22-87 DAB StartText  {     my-in nstr readline true eq           %Read line from file                                          %Check for linewrap    {dup stringwidth pop currentpoint pop add  rightmargin gt { dup mark exch LineWrap} if    MyShow    my-in read pop                        %character for end of line     dup 1 eq {PostScriptProgram} if       %Embedded PS program (NOT SUPPORTED)    dup 6 eq {ChangeFont} if    dup 10 eq {SetPointSize NewLine} if    dup 12 eq {NewPage} if     dup 9 eq {TabSpace} if    dup 8 eq {PrintSymbol} if    dup 7 eq {PrintLozenge} if    dup 4 eq {exit} if    cleartomark    mark   } {exit} ifelse }loopshowpage} bind def/PrintScreenImage%Do screen dump{Startup /astr 10 string def             %rotation angle /ustr 10 string def             %user scale factor /wstr 10 string def             %width /hstr 10 string def             %height /pcstr 10 string def             %picstr-width /shstr 10 string def            %scaled height /swstr 10 string def            %scaled width /pwstr 10 string def            %pic-width /my-in (%stdin) (r) file def my-in astr readline pop cvi rotate  %get rotation (0=portrait;90=landscape) my-in ustr readline pop  dup cvr dup cvr scale           %set scaling (magnification) factor my-in wstr readline pop my-in hstr readline pop% my-in swstr readline pop my-in shstr readline pop 50 shstr cvr translate wstr cvr hstr cvr scale %scaling and translation my-in pcstr readline pop /picstr pcstr cvi string def my-in pwstr readline pop /screenimage {                  %make screen image array   pwstr cvi hstr cvi 1 [pwstr cvi 0 0 hstr cvi neg 0 hstr cvi]   { my-in picstr readhexstring pop}   image } def screenimage                     } bind def