EpsonFX1PrinterStream.st
changeset 179 38773360f4b7
parent 126 fca9404da9d4
child 259 6d36f3ac42a2
--- a/EpsonFX1PrinterStream.st	Fri Feb 02 17:24:31 1996 +0100
+++ b/EpsonFX1PrinterStream.st	Fri Feb 02 20:53:52 1996 +0100
@@ -36,15 +36,24 @@
 documentation
 "
     This class defines protocol for simple text prinitng on an Epson-FX1
-    (and compatible) printer. It knows the escape codes for bold, italic etc.
+    (and compatible) printer. 
+    It does not support multiple fonts, but knows how to print bold, italic etc.
 
     I cannot tell, if this is really an Epson -
-    all I have is a Citizen 120D to test - the doc says its an FX1.
+    all I had to test was a Citizen 120D - its documentation claims it to be FX1 compatible.
 "
 !
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/EpsonFX1PrinterStream.st,v 1.12 1995-11-23 01:50:38 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/EpsonFX1PrinterStream.st,v 1.13 1996-02-02 19:53:47 cg Exp $'
+! !
+
+!EpsonFX1PrinterStream class methodsFor:'queries'!
+
+printerTypeName
+    "return a descriptive name"
+
+    ^ 'Epson FX1 compatible printer'
 ! !
 
 !EpsonFX1PrinterStream methodsFor:'access writing'!
@@ -52,21 +61,20 @@
 bold
     "set font to bold"
 
-    "send <ESC>G will do that"
-    super nextPut:(Character esc).
-    super nextPutAll:'G'
+    "send: <ESC>G "
+
+    super escape:$G
 !
 
 character:char fromCharacterSet:set
     "send a character from an alternate character set"
 
-    "send <ESC>R<set><char><ESC>R<\0>"
-    super nextPut:(Character esc).
-    super nextPut:$R.
+    "send: <ESC>R<set><char><ESC>R<0>"
+
+    super escape:$R.
     super nextPut:(Character value:set).
     super nextPut:char.
-    super nextPut:(Character esc).
-    super nextPut:$R.
+    super escape:$R.
     super nextPut:(Character value:0)
 !
 
@@ -81,9 +89,9 @@
 italic
     "set font to italic"
 
-    "send <ESC>4 will do that"
-    super nextPut:(Character esc).
-    super nextPutAll:'4'
+    "send: <ESC>4 will do that"
+
+    super escape:$4
 !
 
 nextPut:aCharacter
@@ -122,18 +130,17 @@
 normal
     "set font to normal"
 
-    "send <ESC>H<ESC>5 will do that"
-    super nextPut:(Character esc).
-    super nextPutAll:'H'.
-    super nextPut:(Character esc).
-    super nextPutAll:'5'
+    "send: <ESC>H<ESC>5"
+
+    super escape:$H. super escape:$5
 ! !
 
 !EpsonFX1PrinterStream methodsFor:'layout'!
 
 linesPerPage:n
-    super nextPut:(Character esc).
-    super nextPut:$C.
+    "send: <ESC>C<n>"
+
+    super escape:$C.
     super nextPut:(Character value:n)
 !
 
@@ -142,20 +149,23 @@
 !
 
 noTopMargin
-    super nextPut:(Character esc).
-    super nextPut:$O
+    "send <ESC>0"
+
+    super escape:$O
 !
 
 pageHeight:inch
-    super nextPut:(Character esc).
-    super nextPut:$C.
+    "send <ESC>G<0><inch>"
+
+    super escape:$C.
     super nextPut:(Character value:0).
     super nextPut:(Character value:inch)
 !
 
 proportional:aBoolean
-    super nextPut:(Character esc).
-    super nextPut:$p.
+    "send <ESC>p0 or <ESC>p1"
+
+    super escape:$p.
     aBoolean ifTrue:[
 	super nextPut:$1
     ] ifFalse:[
@@ -164,13 +174,14 @@
 !
 
 reset
-    super nextPut:(Character esc).
-    super nextPut:$@
+    "send <ESC>@"
+
+    super escape:$@
 !
 
 topMargin:n
-    super nextPut:(Character esc).
-    super nextPut:$N.
+    "send <ESC>N<n>"
+
+    super escape:$N.
     super nextPut:(Character value:n)
 ! !
-