PostscriptPrinterStream.st
changeset 126 fca9404da9d4
parent 112 3e18f2cfe430
child 170 7194ef17f5b8
--- a/PostscriptPrinterStream.st	Thu Nov 23 02:24:36 1995 +0100
+++ b/PostscriptPrinterStream.st	Thu Nov 23 02:51:57 1995 +0100
@@ -11,15 +11,11 @@
 "
 
 PrinterStream subclass:#PostscriptPrinterStream
-       instanceVariableNames:'xPos yPos lineBuffer colNr lineNr
-			      fFamily fStyle'
-       classVariableNames:'Prolog Trailer
-			   PageProlog PageTrailer
-			   FontHeight FontWidth LeftX TopY LinesPerPage
-			   Italic Bold Normal 
-			   Courier Times Helvetica'
-       poolDictionaries:''
-       category:'Streams-External'
+	 instanceVariableNames:'xPos yPos lineBuffer colNr lineNr fFamily fStyle'
+	 classVariableNames:'Prolog Trailer PageProlog PageTrailer FontHeight FontWidth LeftX
+                TopY LinesPerPage Italic Bold Normal Courier Times Helvetica'
+	 poolDictionaries:''
+	 category:'Streams-External'
 !
 
 !PostscriptPrinterStream class methodsFor:'documentation'!
@@ -38,10 +34,6 @@
 "
 !
 
-version
-    ^ '$Header: /cvs/stx/stx/libbasic2/PostscriptPrinterStream.st,v 1.13 1995-11-11 15:21:26 cg Exp $'
-!
-
 documentation
 "
     This class provides simple text output to postscript printers;
@@ -53,6 +45,10 @@
     provides a compatible interface to line-printing (see other subclasses of
     PrinterStream).
 "
+!
+
+version
+    ^ '$Header: /cvs/stx/stx/libbasic2/PostscriptPrinterStream.st,v 1.14 1995-11-23 01:51:31 cg Exp $'
 ! !
 
 !PostscriptPrinterStream class methodsFor:'initialization'!
@@ -158,72 +154,20 @@
 '
 ! !
 
-!PostscriptPrinterStream methodsFor:'open/close'!
-
-startPrint
-    Prolog isNil ifTrue:[
-	self class initialize
-    ].
-    fFamily := Courier.
-    fStyle := Normal.
-    super writingTo:PrintCommand.
-    super nextPutAllUntranslated:Prolog.
-    self startPage
-!
+!PostscriptPrinterStream methodsFor:'access writing'!
 
-endPrint
-    self endPage.
-    super nextPutAll:Trailer.
-    super endPrint
-! ! 
-
-!PostscriptPrinterStream methodsFor:'private'!
-
-startPage
-    super nextPutAllUntranslated:PageProlog.
-    self setFont.
-    yPos := TopY.
-    xPos := LeftX.
-    lineBuffer := ''.
-    lineNr := 1.
-    colNr := 0
+bold
+    self flushLine.
+    fStyle := Bold.
+    self setFont
 !
 
-endPage
+courier
     self flushLine.
-    super nextPutAllUntranslated:PageTrailer
-!
-
-nextPage
-    self endPage.
-    self startPage
-!
-
-setFont
-    |fontNumber|
-    fontNumber := fFamily + fStyle.
-    super nextPutAllUntranslated:fontNumber printString.
-    super nextPutAllUntranslated:' F'. 
-    super nextPutUntranslated:(Character cr)
+    fFamily := Courier.
+    self setFont
 !
 
-flushLine
-    (lineBuffer size > 0) ifTrue:[
-	super nextPutAllUntranslated:(xPos printString ).
-	super nextPutAllUntranslated:' '.
-	super nextPutAllUntranslated:(yPos printString).
-	super nextPutAllUntranslated:'('.
-	super nextPutAllUntranslated:lineBuffer.
-	super nextPutAllUntranslated:')B'.
-	super nextPutUntranslated:(Character cr).
-	xPos := xPos + (FontWidth * lineBuffer size).
-	colNr := colNr + lineBuffer size
-    ].
-    lineBuffer := ''
-! !
-
-!PostscriptPrinterStream methodsFor:'access writing'!
-
 cr
     "send line termination"
 
@@ -237,6 +181,18 @@
     ]
 !
 
+helvetica
+    self flushLine.
+    fFamily := Helvetica.
+    self setFont
+!
+
+italic
+    self flushLine.
+    fStyle := Italic.
+    self setFont
+!
+
 nextPut:aCharacter
     (aCharacter == Character cr) ifTrue:[
 	^ self cr
@@ -262,9 +218,9 @@
     lineBuffer := lineBuffer copyWith:aCharacter
 !
 
-courier
+normal
     self flushLine.
-    fFamily := Courier.
+    fStyle := Normal.
     self setFont
 !
 
@@ -272,28 +228,70 @@
     self flushLine.
     fFamily := Times.
     self setFont
+! !
+
+!PostscriptPrinterStream methodsFor:'open/close'!
+
+endPrint
+    self endPage.
+    super nextPutAll:Trailer.
+    super endPrint
 !
 
-helvetica
+startPrint
+    Prolog isNil ifTrue:[
+	self class initialize
+    ].
+    fFamily := Courier.
+    fStyle := Normal.
+    super writingTo:PrintCommand.
+    super nextPutAllUntranslated:Prolog.
+    self startPage
+! !
+
+!PostscriptPrinterStream methodsFor:'private'!
+
+endPage
     self flushLine.
-    fFamily := Helvetica.
-    self setFont
+    super nextPutAllUntranslated:PageTrailer
 !
 
-italic
-    self flushLine.
-    fStyle := Italic.
-    self setFont
+flushLine
+    (lineBuffer size > 0) ifTrue:[
+	super nextPutAllUntranslated:(xPos printString ).
+	super nextPutAllUntranslated:' '.
+	super nextPutAllUntranslated:(yPos printString).
+	super nextPutAllUntranslated:'('.
+	super nextPutAllUntranslated:lineBuffer.
+	super nextPutAllUntranslated:')B'.
+	super nextPutUntranslated:(Character cr).
+	xPos := xPos + (FontWidth * lineBuffer size).
+	colNr := colNr + lineBuffer size
+    ].
+    lineBuffer := ''
+!
+
+nextPage
+    self endPage.
+    self startPage
 !
 
-bold
-    self flushLine.
-    fStyle := Bold.
-    self setFont
+setFont
+    |fontNumber|
+    fontNumber := fFamily + fStyle.
+    super nextPutAllUntranslated:fontNumber printString.
+    super nextPutAllUntranslated:' F'. 
+    super nextPutUntranslated:(Character cr)
 !
 
-normal
-    self flushLine.
-    fStyle := Normal.
-    self setFont
+startPage
+    super nextPutAllUntranslated:PageProlog.
+    self setFont.
+    yPos := TopY.
+    xPos := LeftX.
+    lineBuffer := ''.
+    lineNr := 1.
+    colNr := 0
 ! !
+
+PostscriptPrinterStream initialize!