(FILECREATED "19-Nov-84 13:32:12" {DSK}<LISPFILES>FXPRINTER.;1 22620  

      changes to:  (FNS FXPRINT TEXTFILEP BOLD.MODE COMMENT.MODE EXPANDED.MODE STANDARD.MODE 
			\PRINTER.PRINT.HEADING \PRINTER.TEXTINIT)
		   (VARS FXPRINTERCOMS)

      previous date: " 7-Sep-84 13:43:52" {ROSEBOWL}<LISP>LIBRARY>FXPRINTER.;13)


(* Copyright (c) 1984 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT FXPRINTERCOMS)

(RPAQQ FXPRINTERCOMS ((FILES (SYSLOAD FROM VALUEOF LISPUSERSDIRECTORIES)
			     RS232)
		      [ADDVARS [PRINTERTYPES ((FX.80 LOCALPRINTER)
					      (CANPRINT (TEXT BITMAP WINDOW))
					      (STATUS TRUE)
					      (PROPERTIES NILL)
					      (SEND FXPRINT)
					      (BITMAPSCALE NIL)
					      (BITMAPFILE (FX.PRESSBITMAP FILE BITMAP SCALEFACTOR 
									  REGION ROTATION TITLE]
			       (PRINTFILETYPES (TEXT (TEST TEXTFILEP)
						     (EXTENSION (TEXT]
		      (P (PUTPROP %'FX.80 %'PRINTERTYPE %'LOCALPRINTER))
		      (FNS * PRINTERFNS)
		      (VARS (DEFAULTLOCALBAUDRATE NIL)
			    (SUPPRESS.PAPER.ADJ.FLAG NIL))))
(FILESLOAD (SYSLOAD FROM VALUEOF LISPUSERSDIRECTORIES)
	   RS232)

(ADDTOVAR PRINTERTYPES ((FX.80 LOCALPRINTER)
			(CANPRINT (TEXT BITMAP WINDOW))
			(STATUS TRUE)
			(PROPERTIES NILL)
			(SEND FXPRINT)
			(BITMAPSCALE NIL)
			(BITMAPFILE (FX.PRESSBITMAP FILE BITMAP SCALEFACTOR REGION ROTATION TITLE))))

(ADDTOVAR PRINTFILETYPES (TEXT (TEST TEXTFILEP)
			       (EXTENSION (TEXT))))
(PUTPROP %'FX.80 %'PRINTERTYPE %'LOCALPRINTER)

(RPAQQ PRINTERFNS (RS232.PRINT RS232.PRINTFILE FBITMAP FX.PRESSBITMAP FXFITERROR FXPRINT 
			       BITMAPDISPLAY TEXTFILEP WINDOWDISPLAY WINDOW.TO.BITMAP BOLD.MODE 
			       COMBMDISPLAY COMGRAPH.MODE COMMENT.MODE EXPANDED.MODE GRAPHICS.MODE 
			       SELECT.MODE STANDARD.MODE \PRINTER.COMMAND \PRINTER.CRLF 
			       \PRINTER.HEADING \PRINTER.INIT \PRINTER.MODE \PRINTER.PRINT.HEADING 
			       \PRINTER.TEXTINIT))
(DEFINEQ

(RS232.PRINT
  [LAMBDA (FILENAME NOROTATE? STANDARD.SETUP COMPRESS?)      (* edited: " 6-Sep-84 11:08")
    (RS232INIT)                                              (* Darn it, but the bug with printer initialization 
							     isn't here; it's in RS232. But this "fixes" the bug in 
							     RS232, anyways.)
    (COND
      (STANDARD.SETUP (RS232INIT 9600 8 NIL 1 'DTR)
		      (SETQ RS232XON\XOFF? T))
      (T (\PRINTER.INIT)))
    (COND
      ((BITMAPP FILENAME)
	(FBITMAP FILENAME NOROTATE? COMPRESS?))
      ((WINDOWP FILENAME)
	(WINDOWDISPLAY FILENAME NOROTATE? COMPRESS?))
      (T (RS232.PRINTFILE FILENAME])

(RS232.PRINTFILE
  [LAMBDA (FILENAME)                                         (* edited: " 7-Sep-84 13:40")

          (* This function takes a file, opens it for stream input (in the function \PRINTER.FILEINIT), and prints that file
	  on an Epson FX-80 Printer. A later version of this function will allow user interaction such that, if the user 
	  owns a printer other than the Epson, he/she will be able to specify the command characters that allow certain font
	  and mode changes on her/his particular printer. NOTE: check the documentation for this program for the correct pin
	  connections for you particular machine.)


    (PROG (FILE)
          (\PRINTER.TEXTINIT)                                (* This function initializes print modes and form feeds 
							     on the Epson printer.)
          (\PRINTER.PRINT.HEADING FILENAME)                  (* The function \PRINTER.PRINT.HEADING sets up the mode 
							     for printing the heading, and calls the function that 
							     actually does the printing.)
          (CLOSEF? FILENAME)
          (SETQ FILE (OPENSTREAM FILENAME (QUOTE INPUT)
				 (QUOTE OLD)))
          (until (EOFP FILE) bind CHAR
	     do (SETQ CHAR (BIN FILE))
		(SELECT.MODE CHAR))
          (CLOSEF FILE])

(FBITMAP
  [LAMBDA (BMAP NOROTATE? COMPRESS? NOERRORCHECK)            (* edited: " 1-Aug-84 17:59")

          (* This function takes a bit map, and, if the user doesn't make an explicit request (using a non-nil NOROTATE? 
	  argument), prints the image out rotated -90 degrees using the fast \GETBASEBYTE function.)


    (COND
      [(NULL COMPRESS?)
	(PROG ((HEIGHT (fetch BITMAPHEIGHT of BMAP))
	       (BASE (fetch BITMAPBASE of BMAP))
	       (BYTESPERROW (ITIMES 2 (fetch BITMAPRASTERWIDTH of BMAP)))
	       COLUMN J CNT OFFSET)
	      (COND
		[NOROTATE? (COND
			     ((AND (NULL NOERRORCHECK)
				   (GREATERP (FETCH BITMAPWIDTH OF BMAP)
					     576))
			       (FXFITERROR BMAP NOROTATE? COMPRESS? HEIGHT (FETCH BITMAPWIDTH
									      OF BMAP)))
			     (T (BITMAPDISPLAY BMAP]
		(T (COND
		     ((OR (LEQ HEIGHT 576)
			  NOERRORCHECK)
		       (\PRINTER.MODE (QUOTE UniDirectionalOn))
		       (\PRINTER.MODE (QUOTE EightSpacingOn))
		       (SETQ OFFSET BYTESPERROW)
		       (for COLUMN from 1 to BYTESPERROW
			  do (GRAPHICS.MODE HEIGHT)
			     (for J from HEIGHT to 1 by -1
				do (RS232WRITEBYTE (\GETBASEBYTE BASE (IDIFFERENCE (ITIMES 
										      BYTESPERROW J)
										   OFFSET))
						   T))
			     (\PRINTER.CRLF)
			     (SETQ OFFSET (SUB1 OFFSET)))
		       (\PRINTER.MODE (QUOTE UniDirectionalOff)))
		     (T (FXFITERROR BMAP NOROTATE? COMPRESS? HEIGHT (fetch BITMAPWIDTH of BMAP]
      (T (COMBMDISPLAY BMAP NOROTATE? NOERRORCHECK])

(FX.PRESSBITMAP
  [LAMBDA (FILE BITMAP SCALEFACTOR REGION ROTATION TITLE)
    (PROG NIL
          (COND
	    [REGION (SETQ NEWBITMAP (BITMAPCREATE (fetch (REGION WIDTH) of REGION)
						  (fetch (REGION HEIGHT) of REGION]
	    (T (SETQ NEWBITMAP BITMAP)))
          (\PRINTER.INIT)
          (BITBLT BITMAP (fetch (REGION LEFT) of REGION)
		  (fetch (REGION BOTTOM) of REGION)
		  NEWBITMAP 0 0 (fetch (REGION WIDTH) of REGION)
		  (fetch (REGION HEIGHT) of REGION))
          (RETURN (FBITMAP NEWBITMAP ROTATION])

(FXFITERROR
  [LAMBDA (BMAP NOROTATE? COMPRESS? Y X)                     (* edited: " 2-Aug-84 10:18")
    (printout T "The bitmap will not fit on the page." T)
    (PROG (NROTATE NCOMPRESS USER?)
          (COND
	    [(GREATERP X 576)
	      (COND
		[(OR (GREATERP Y 576)
		     COMPRESS?)
		  (SETQ NCOMPRESS T)
		  (COND
		    ((GREATERP X 960)

          (* Both height and width of the bitmap is too big; we thus compress it. Is the X length too long for even 
	  compression? Then rotate it, else preserve the old setting.)


		      (SETQ NROTATE NIL))
		    (T (SETQ NROTATE NOROTATE?]
		(T (SETQ NROTATE NIL)
		   (SETQ NCOMPRESS COMPRESS?]
	    [(GREATERP Y 576)
	      (COND
		((NULL NOROTATE?)
		  (SETQ NROTATE T)
		  (SETQ NCOMPRESS COMPRESS?))
		(T (SETQ NROTATE NOROTATE?)
		   (SETQ NCOMPRESS COMPRESS?]
	    (T (SETQ NROTATE NOROTATE?)
	       (SETQ NCOMPRESS COMPRESS?)))
          (printout T "The following settings will work:" T "NOROTATE? " NROTATE T "COMPRESS? " 
		    NCOMPRESS T T)
          [SETQ USER? (ASKUSER 10 (QUOTE Y)
			       "Use these settings? "
			       (QUOTE ((Y "es
")
					(N "o
")
					(A "bort
"]
          (COND
	    ((EQ (QUOTE N)
		 USER?)
	      (FBITMAP BMAP NOROTATE? COMPRESS? T))
	    ((EQ (QUOTE Y)
		 USER?)
	      (FBITMAP BMAP NROTATE NCOMPRESS NIL))
	    ((EQ (QUOTE A)
		 USER?)
	      (printout T T "Aborted." T)
	      (\PRINTER.MODE (QUOTE EightSpacingOn))
	      (\PRINTER.MODE (QUOTE UniDirectionalOff])

(FXPRINT
  [LAMBDA (HOST FILE PRINTOPTIONS)                           (* Barrera "16-Apr-84 15:17")
    (SETQ SAVED.SUPPRESS.FLAG SUPPRESS.PAPER.ADJ.FLAG)
    [COND
      ((NOT (NULL FILE))
	(COND
	  [[NOT (NULL (SETQ COUNTER (LISTGET PRINTOPTIONS '#COPIES]
	    (PROG NIL
	      LOOP(COND
		    ((GEQ COUNTER 1)
		      (RS232.PRINT FILE)
		      (SETQ COUNTER (SUB1 COUNTER))
		      (RS232WRITEBYTE (CHARCODE FF))
		      (SETQ SUPPRESS.PAPER.ADJ.FLAG T)
		      (GO LOOP]
	  (T (RS232.PRINT FILE)
	     (RS232WRITEBYTE (CHARCODE FF]
    (SETQ SUPPRESS.PAPER.ADJ.FLAG SAVED.SUPPRESS.FLAG])

(BITMAPDISPLAY
  [LAMBDA (BMAP)                                             (* edited: "17-Feb-84 19:09")

          (* If the user specifies that the Bit Map is to be printed horizontally, then the slow method of printing the 
	  imapge via BITMAPBIT is used.)


    (PROG ((WIDTH (fetch BITMAPWIDTH of BMAP))
	   CURRENTHT EXP X Y PRINTVAL)
          (\PRINTER.MODE 'UniDirectionalOn)
          (\PRINTER.MODE 'EightSpacingOn)
          (for CURRENTHT from HEIGHT to 0 by -8
	     do ((GRAPHICS.MODE WIDTH)
		 (for X from 1 to WIDTH do ((SETQ PRINTVAL 0)
					    [for EXP from 7 to 0 by -1
					       do ((SETQ Y (DIFFERENCE CURRENTHT (DIFFERENCE 7 EXP)))
						   (SETQ PRINTVAL
						     (IPLUS (ITIMES (EXPT 2 EXP)
								    (BITMAPBIT BMAP X Y))
							    PRINTVAL]
					    (RS232WRITEBYTE PRINTVAL T)))
		 (\PRINTER.CRLF)))
          (\PRINTER.MODE 'UniDirectionalOff])

(TEXTFILEP
  [LAMBDA (FILE)
    (EQ 'TEXT
	(GETFILEINFO FILE 'TYPE])

(WINDOWDISPLAY
  [LAMBDA (WINDOW NOROTATE? COMPRESS?)                       (* edited: " 2-Aug-84 09:50")

          (* This function will print out a window onto the FX-80 printer using the RS232 Port. The image printed will 
	  either be printed straight across or rotated by a negative 90 degrees, depending on whether the user specifically 
	  requests no rotation in the initial function call.)


    (PROG (BITMAP)
          (SETQ BITMAP (WINDOW.TO.BITMAP WINDOW))

          (* Because the function \GETBASEBYTE is much faster than BITMAPBIT, and can only work on bit maps, first this 
	  function changes the window into a bit map, using WINDOW.TO.BITMAP, then it performs functions upon the created 
	  bit map as if it had been called from RS232.PRINT.)


          (FBITMAP BITMAP NOROTATE? COMPRESS?])

(WINDOW.TO.BITMAP
  [LAMBDA (WINDOW)                                           (* JBleier "17-Feb-84 18:10")
    (PROG (BITMAP)
          [SETQ BITMAP (BITMAPCREATE (WINDOWPROP WINDOW (QUOTE WIDTH))
				     (WINDOWPROP WINDOW (QUOTE HEIGHT]
          (BITBLT WINDOW NIL NIL BITMAP)
          (RETURN BITMAP])

(BOLD.MODE
  [LAMBDA NIL                                                (* JBleier "20-Jan-84 18:17")
                                                             (* Print Bold pitch)
    (\PRINTER.MODE 'ProportionalOff)
    (\PRINTER.MODE 'ExpandOff)
    (\PRINTER.MODE 'CompressedOn)
    (\PRINTER.MODE 'BoldOn])

(COMBMDISPLAY
  [LAMBDA (BMAP NOROTATE? NOERRORCHECK)                      (* edited: " 2-Aug-84 15:21")
    (PROG ((HEIGHT (fetch BITMAPHEIGHT of BMAP))
	   (WIDTH (fetch BITMAPWIDTH of BMAP))
	   PRINTVAL YPOS)
          (\PRINTER.MODE (QUOTE UniDirectionalOn))
          (COND
	    ((NULL NOROTATE?)                                (* The cheap man's way of rotating the object: rotate 
							     the height and width coordinates instead.)
	      (SETQ YPOS HEIGHT)                             (* YPOS is not being used at the moment;
							     it makes a wonderful temporary variable)
	      (SETQ HEIGHT WIDTH)
	      (SETQ WIDTH YPOS)))

          (* This method of printing out a bitmap is very slow; it requires two passes of the printer head to put down a 
	  line of information. But it is very compressed; the size is around 2/3 of normal.)


          (COND
	    [(AND (GREATERP WIDTH 960)
		  (NULL NOERRORCHECK))
	      (FXFITERROR BMAP NOROTATE? T (COND
			    (NOROTATE? HEIGHT)
			    (T WIDTH))
			  (COND
			    (NOROTATE? WIDTH)
			    (T HEIGHT]
	    (T
	      [for Q from HEIGHT to 0 by -24
		 do
		  (for I from Q to (IDIFFERENCE Q 12) by -12
		     do
		      (

          (* The reason for two passes is simple; the first pass uses the top 4 sets of pins (number 1, 3, 5, and 7), and 
	  the second pass uses the bottom 4 sets of pins (number 2, 4, 6, and 8). This makes it so the pins wear evenly 
	  while dumping large bitmaps.)


		       (for YY from 11 to 9 by -1
			  do
			   (COMGRAPH.MODE WIDTH)
			   (for X from 1 to WIDTH
			      do
			       ((SETQ PRINTVAL 0)
				[for Y from YY to 0 by -3
				   do ((SETQ YPOS (IDIFFERENCE I (IDIFFERENCE 11 Y)))
				       (SETQ PRINTVAL
					 (IPLUS PRINTVAL
						(ITIMES [CAR (NTH [COND
								    ((EQP I Q)
								      (QUOTE (1 4 16 64)))
								    (T (QUOTE (2 8 32 128]
								  (ADD1 (IQUOTIENT Y 3]
							(COND
							  (NOROTATE? (BITMAPBIT BMAP X YPOS))
							  (T (BITMAPBIT BMAP (IDIFFERENCE HEIGHT YPOS)
									X]
				(RS232WRITEBYTE PRINTVAL T)))

          (* The printer now prints four rows of information per pass at the printer. This is to keep the proper aspect 
	  ratio (which turns out to be a 2/3 spacing per dot, where the dots on the printer head itself is 1, by 
	  definition.) So, the printer makes three passes at this spacing, and then does an EightSpace move;
	  thus, 12 rows of dots are placed where 8 was before.)


			   (\PRINTER.COMMAND (CHARCODE "3"))
			   (RS232WRITEBYTE 2 T)
			   (\PRINTER.CRLF))

          (* The alternate 5 and 7 spacing is used because of the printer head; when a line is finished printing, the head 
	  is already 2 spaces down. Then, by going with 5 and 7, it is possible to switch the set of pins being used on the 
	  printer head. The printing is finished with eight-spacing, only to get things going right again.)


		       (\PRINTER.COMMAND (CHARCODE "A"))
		       (RS232WRITEBYTE (COND
					 ((EQP I Q)
					   7)
					 (T 5))
				       T)
		       (\PRINTER.CRLF]
	      (\PRINTER.MODE (QUOTE EightSpacingOn))
	      (\PRINTER.MODE (QUOTE UniDirectionalOff))
	      (\PRINTER.CRLF])

(COMGRAPH.MODE
  [LAMBDA (WIDTH)                                            (* edited: " 1-Aug-84 14:13")
    (\PRINTER.COMMAND (CHARCODE "L"))
    (COND
      ((LESSP WIDTH 256)
	(RS232WRITEBYTE WIDTH T)
	(RS232WRITEBYTE 0 T))
      (T (RS232WRITEBYTE (REMAINDER WIDTH 256)
			 T)
	 (RS232WRITEBYTE (IQUOTIENT WIDTH 256)
			 T])

(COMMENT.MODE
  [LAMBDA NIL                                                (* JBleier "20-Jan-84 18:18")
                                                             (* Print in subscripted, italicized, compressed pitch)
    (\PRINTER.MODE 'EliteOff)
    (\PRINTER.MODE 'BoldOff)
    (\PRINTER.MODE 'SubScriptOn)
    (\PRINTER.MODE 'ItalicOn)
    (\PRINTER.MODE 'CompressedOn])

(EXPANDED.MODE
  [LAMBDA NIL                                                (* JBleier "20-Jan-84 18:18")
                                                             (* Print in Expanded pitch)
    (\PRINTER.MODE 'BoldOff)
    (\PRINTER.MODE 'EliteOff)
    (\PRINTER.MODE 'ExpandOn)
    (\PRINTER.MODE 'ProportionalOn])

(GRAPHICS.MODE
  [LAMBDA (ROWS)                                             (* edited: "15-JAN-84 17:55")
    (\PRINTER.COMMAND (CHARCODE "*"))
    (RS232WRITEBYTE 5 T)
    (COND
      ((LESSP ROWS 256)
	(RS232WRITEBYTE ROWS T)
	(RS232WRITEBYTE 0 T))
      (T (RS232WRITEBYTE (REMAINDER ROWS 256)
			 T)
	 (RS232WRITEBYTE (IQUOTIENT ROWS 256)
			 T])

(SELECT.MODE
  [LAMBDA (CHAR)                                             (* JBleier "20-Jan-84 18:23")
    (SELCHARQ CHAR
	      [↑F 

          (* If the character just received from the file is a ↑F, then the next character will dictate mode type.
	  Get that next character and find what mode type to send to the printer.)


		  (SETQ CHAR (BIN FILE))
		  (SELCHARQ CHAR
			    (↑B                              (* Print Bold)
				(BOLD.MODE))
			    (↑C                              (* Print Comments)
				(COMMENT.MODE))
			    (↑D                              (* Print Large)
				(EXPANDED.MODE))
			    (PROGN 

          (* If the mode is none of the above, then it is either standard mode (↑A), or unknown; in either case, use 
	  standard pitch.)


				   (STANDARD.MODE]
	      (CR (\PRINTER.CRLF))
	      (RS232WRITEBYTE CHAR T])

(STANDARD.MODE
  [LAMBDA NIL                                                (* edited: "29-DEC-83 18:14")

          (* Turn off all the previous switches, i.e., print in standard pica. (the function \PRINTER.MODE takes as its 
	  argument the mode switch direction, and sends code to the printer via the function \PRINTER.COMMAND that directs the
	  printer to perform the given operation.))


    (\PRINTER.MODE 'CompressedOn)
    (\PRINTER.MODE 'ItalicOff)
    (\PRINTER.MODE 'ScriptOff)
    (\PRINTER.MODE 'EliteOff)
    (\PRINTER.MODE 'ExpandOff)
    (\PRINTER.MODE 'BoldOff)
    (\PRINTER.MODE 'ProportionalOff])

(\PRINTER.COMMAND
  [LAMBDA (CommandChar)                                      (* JBleier "20-Jan-84 18:23")

          (* Send an Escape, to tell the printer there is to be a mode change, and the then specific mode change, as 
	  detailed in PRINTER.MODE.)


    (RS232WRITEBYTE (CHARCODE ESC)
		    T)
    (RS232WRITEBYTE CommandChar T])

(\PRINTER.CRLF
  [LAMBDA NIL                                                (* JBleier "20-Jan-84 18:21")
                                                             (* Send a carraige return/line feed to the printer;
							     the printer holds all incoming characters in its buffer 
							     until it sees a CR/LF.)
    (RS232WRITEBYTE (CHARCODE CR))
    (RS232WRITEBYTE (CHARCODE LF))
    (RS232FORCEOUTPUT])

(\PRINTER.HEADING
  [LAMBDA (FILENAME)                                         (* edited: "29-DEC-83 19:15")
    (RS232WRITECHARS "Listing of File " T)
    (RS232WRITECHARS FILENAME T)
    (RS232WRITECHARS " , " T)
    (RS232WRITECHARS (DATE)
		     T)
    (RS232WRITECHARS " by " T)
    (RS232WRITECHARS (USERNAME)
		     T)
    (\PRINTER.CRLF)
    (\PRINTER.CRLF])

(\PRINTER.INIT
  [LAMBDA NIL                                                (* Barrera "16-Apr-84 15:21")

          (* This function closes the file to be printed (if necessary.) It also allows the user to specify baud rate.
	  Default on the baud rate is 1200)


    [COND
      ((NULL SUPPRESS.PAPER.SET.FLAG)
	(PROG (BAUDRATE)
	  SLOWPERSON
	      (printout T T T 
		    "Set the paper in the printer so that it is about 1/2 inch above the ribbon."
			T "Remember to turn the printer off first." T T T)
	      (printout T T T)
	      (COND
		((NOT (EQ (ASKUSER 7 (QUOTE Y)
				   "Are you all set?(Y/N)")
			  (QUOTE Y)))
		  (GO SLOWPERSON]
    [COND
      (DEFAULTLOCALBAUDRATE (SETQ BAUDRATE DEFAULTLOCALBAUDRATE))
      (T (SETQ BAUDRATE (ASKUSER 60 1200 
		   "What Baud Rate do you want (make sure your printer is set to the same rate)?"
				 (QUOTE (300 1200 2400 4800 9600]
    (RS232INIT BAUDRATE 8 NIL 1 (QUOTE DTR))
    (SETQ RS232XON\XOFF? T])

(\PRINTER.MODE
  [LAMBDA (Mode)                                             (* edited: "17-Feb-84 19:40")

          (* Ths function takes as its argument the mode for the printer to print in, and sends this to the printer via the 
	  function \PRINTER.COMMAND.)


    (SELECTQ Mode
	     (BoldOn (\PRINTER.COMMAND (CHARCODE "E")))
	     (BoldOff (\PRINTER.COMMAND (CHARCODE "F")))
	     (CompressedOn (\PRINTER.COMMAND 15))
	     (CompressedOff (RS232WRITEBYTE 18 T))
	     (EliteOn (\PRINTER.COMMAND (CHARCODE "M")))
	     (EliteOff (\PRINTER.COMMAND (CHARCODE "P")))
	     (ItalicOn (\PRINTER.COMMAND (CHARCODE "4")))
	     (ItalicOff (\PRINTER.COMMAND (CHARCODE "5")))
	     (PicaOn (\PRINTER.COMMAND (CHARCODE "P"))
		     (RS232WRITEBYTE 18 T))
	     (SubScriptOn (\PRINTER.COMMAND (CHARCODE "S"))
			  (RS232WRITEBYTE (CHARCODE "0")
					  T))
	     (ScriptOff (\PRINTER.COMMAND (CHARCODE "T")))
	     (SuperScriptOn (\PRINTER.COMMAND (CHARCODE "S"))
			    (RS232WRITEBYTE (CHARCODE "1")
					    T))
	     (ExpandOn (\PRINTER.COMMAND (CHARCODE "W"))
		       (RS232WRITEBYTE (CHARCODE "1")
				       T))
	     (ExpandOff (\PRINTER.COMMAND (CHARCODE "W"))
			(RS232WRITEBYTE (CHARCODE "0"))
			T)
	     (ProportionalOn (\PRINTER.COMMAND (CHARCODE "p"))
			     (RS232WRITEBYTE (CHARCODE "1")
					     T))
	     (ProportionalOff (\PRINTER.COMMAND (CHARCODE "p"))
			      (RS232WRITEBYTE (CHARCODE "0")
					      T))
	     (UniDirectionalOn (\PRINTER.COMMAND (CHARCODE "U"))
			       (RS232WRITEBYTE (CHARCODE "1")
					       T))
	     (UniDirectionalOff (\PRINTER.COMMAND (CHARCODE "U"))
				(RS232WRITEBYTE (CHARCODE "0")
						T))
	     (SevenSpacingOn (\PRINTER.COMMAND (CHARCODE "1")))
	     (EightSpacingOn (\PRINTER.COMMAND (CHARCODE "A"))
			     (RS232WRITEBYTE 8 T))
	     (NineSpacingOn (\PRINTER.COMMAND (CHARCODE "0")))
	     (TwelveSpacingOn (\PRINTER.COMMAND (CHARCODE "2")))
	     NIL])

(\PRINTER.PRINT.HEADING
  [LAMBDA (FILENAME)                                         (* JBleier "20-Jan-84 18:14")
    (\PRINTER.CRLF)
    (\PRINTER.MODE 'BoldOn)
    (\PRINTER.HEADING FILENAME)
    (\PRINTER.MODE 'BoldOff)
    (\PRINTER.CRLF])

(\PRINTER.TEXTINIT
  [LAMBDA NIL                                                (* edited: "17-Feb-84 19:40")
                                                             (* Perform all of the initialization, including setting
							     the character modes for standard pitch, and making sure
							     that XON\XOFF protocol is used.)
    (SETQ RS232XON\XOFF? T)
    (\PRINTER.MODE 'BoldOff)
    (\PRINTER.MODE 'PicaOn)
    (\PRINTER.MODE 'ExpandOff)
    (\PRINTER.MODE 'CompressedOn)
    (\PRINTER.MODE 'ProportionalOff)
    (\PRINTER.MODE 'TwelveSpacingOn)
    (\PRINTER.COMMAND (CHARCODE "N"))
    (RS232WRITEBYTE 7])
)

(RPAQQ DEFAULTLOCALBAUDRATE NIL)

(RPAQQ SUPPRESS.PAPER.ADJ.FLAG NIL)
(PUTPROPS FXPRINTER COPYRIGHT ("Xerox Corporation" 1984))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1933 22461 (RS232.PRINT 1943 . 2602) (RS232.PRINTFILE 2604 . 3924) (FBITMAP 3926 . 5538
) (FX.PRESSBITMAP 5540 . 6110) (FXFITERROR 6112 . 7626) (FXPRINT 7628 . 8320) (BITMAPDISPLAY 8322 . 
9305) (TEXTFILEP 9307 . 9387) (WINDOWDISPLAY 9389 . 10242) (WINDOW.TO.BITMAP 10244 . 10561) (BOLD.MODE
 10563 . 10905) (COMBMDISPLAY 10907 . 14282) (COMGRAPH.MODE 14284 . 14625) (COMMENT.MODE 14627 . 15036
) (EXPANDED.MODE 15038 . 15386) (GRAPHICS.MODE 15388 . 15750) (SELECT.MODE 15752 . 16649) (
STANDARD.MODE 16651 . 17317) (\PRINTER.COMMAND 17319 . 17674) (\PRINTER.CRLF 17676 . 18113) (
\PRINTER.HEADING 18115 . 18497) (\PRINTER.INIT 18499 . 19482) (\PRINTER.MODE 19484 . 21498) (
\PRINTER.PRINT.HEADING 21500 . 21772) (\PRINTER.TEXTINIT 21774 . 22459)))))
STOP