--- a/EpsonFX1PrinterStream.st Fri May 17 16:46:19 1996 +0200
+++ b/EpsonFX1PrinterStream.st Sat May 18 09:14:51 1996 +0200
@@ -35,12 +35,24 @@
documentation
"
- This class defines protocol for simple text prinitng on an Epson-FX1
+ This class defines protocol for simple text printing on an Epson-FX1
(and compatible) printer.
It does not support multiple fonts, but knows how to print bold, italic etc.
+ Graphics printing is not supported - you need a postscriptprinter for this.
+
I cannot tell, if this is really an Epson -
- all I had to test was a Citizen 120D - its documentation claims it to be FX1 compatible.
+ all I had to test was a Citizen 120D - its documentation claims it to be
+ FX1 compatible.
+
+ Notice:
+ This class only defines some minimum protocol for printing on
+ Epsons - you really should use a PostscriptPrinter ...
+ ... however, if you own an Epson, here is some class to start with.
+ It may need to be enhanced at some places (for example: provide more
+ fonts/emphasis's; better international character translation etc.)
+
+ This class is not officially supported - take it or leave it.
[author:]
Claus Gittinger
@@ -57,14 +69,161 @@
!EpsonFX1PrinterStream methodsFor:'access writing'!
+cr
+ "send a carriage return (newLine).
+ We have to output cr-nl here"
+
+ super nextPutUntranslated:(Character value:13).
+ super nextPutUntranslated:(Character value:10).
+ self spaces:LeftMargin
+
+ "Modified: 18.5.1996 / 09:02:07 / cg"
+!
+
+nextPut:aCharacter
+ "send aCharacter to the printer.
+ Catch special characters
+ - currently only german umlauts are handled - If you own this type
+ of printer and depend on it, add more translation here ..."
+
+ |ascii|
+
+ ascii := aCharacter asciiValue.
+ (ascii < 128) ifTrue:[
+ ^ super nextPut:aCharacter
+ ].
+ (ascii == 16rfc) ifTrue:[ "udiaeresis"
+ ^ self character:$} fromCharacterSet:2
+ ].
+ (ascii == 16re4) ifTrue:[ "adiaeresis"
+ ^ self character:${ fromCharacterSet:2
+ ].
+ (ascii == 16rf6) ifTrue:[ "odiaeresis"
+ ^ self character:$| fromCharacterSet:2
+ ].
+ (ascii == 16rdc) ifTrue:[ "Udiaeresis"
+ ^ self character:$] fromCharacterSet:2
+ ].
+ (ascii == 16rc4) ifTrue:[ "Adiaeresis"
+ ^ self character:$[ fromCharacterSet:2
+ ].
+ (ascii == 16rd6) ifTrue:[ "Odiaeresis"
+ ^ self character:$\ fromCharacterSet:2
+ ].
+ (ascii == 16rdf) ifTrue:[ "ssharp"
+ ^ self character:$~ fromCharacterSet:2
+ ]
+
+ "Modified: 18.5.1996 / 09:03:18 / cg"
+! !
+
+!EpsonFX1PrinterStream methodsFor:'emphasis change'!
+
bold
- "set font to bold"
+ "set emphasis to bold"
"send: <ESC>G "
super escape:$G
+
+ "Modified: 18.5.1996 / 09:03:31 / cg"
!
+italic
+ "set emphasis to italic"
+
+ "send: <ESC>4 will do that"
+
+ super escape:$4
+
+ "Modified: 18.5.1996 / 09:03:33 / cg"
+!
+
+normal
+ "set emphasis to normal"
+
+ "send: <ESC>H<ESC>5"
+
+ super escape:$H. super escape:$5
+
+ "Modified: 18.5.1996 / 09:03:35 / cg"
+! !
+
+!EpsonFX1PrinterStream methodsFor:'layout'!
+
+linesPerPage:n
+ "change the lines-per-page setting"
+
+ "send: <ESC>C<n>"
+
+ super escape:$C.
+ super nextPut:(Character value:n)
+
+ "Modified: 18.5.1996 / 09:03:50 / cg"
+!
+
+newPage
+ "force a newPage"
+
+ super nextPut:(Character value:12)
+
+ "Modified: 18.5.1996 / 09:04:04 / cg"
+!
+
+noTopMargin
+ "turn off topMargin in the printer"
+
+ "send <ESC>0"
+
+ super escape:$O
+
+ "Modified: 18.5.1996 / 09:04:19 / cg"
+!
+
+pageHeight:inches
+ "set the pageHeight in inches"
+
+ "send <ESC>G<0><inch>"
+
+ super escape:$C.
+ super nextPut:(Character value:0).
+ super nextPut:(Character value:inches)
+
+ "Modified: 18.5.1996 / 09:04:38 / cg"
+!
+
+proportional:aBoolean
+ "turn on/off proportional printing"
+
+ "send <ESC>p0 or <ESC>p1"
+
+ super escape:$p.
+ super nextPut:(aBoolean ifTrue:[$1] ifFalse:[$0])
+
+ "Modified: 18.5.1996 / 09:05:18 / cg"
+!
+
+reset
+ "reset the printer - send <ESC>@"
+
+ super escape:$@
+
+ "Modified: 18.5.1996 / 09:05:27 / cg"
+!
+
+topMargin:n
+ "set the topMargin"
+
+ "send <ESC>N<n>"
+
+ super escape:$N.
+ super nextPut:(Character value:n)
+
+ "Modified: 18.5.1996 / 09:05:43 / cg"
+! !
+
+!EpsonFX1PrinterStream methodsFor:'private'!
+
character:char fromCharacterSet:set
"send a character from an alternate character set"
@@ -75,118 +234,10 @@
super nextPut:char.
super escape:$R.
super nextPut:(Character value:0)
-!
-
-cr
- "have to output cr-nl here"
-
- super nextPutUntranslated:(Character value:13).
- super nextPutUntranslated:(Character value:10).
- self spaces:LeftMargin
-!
-
-italic
- "set font to italic"
-
- "send: <ESC>4 will do that"
-
- super escape:$4
-!
-
-nextPut:aCharacter
- "catch special characters
- - currently only german umlauts are handled - needs more"
-
- |ascii|
-
- ascii := aCharacter asciiValue.
- (ascii < 128) ifTrue:[
- ^ super nextPut:aCharacter
- ].
- (ascii == 16rfc) ifTrue:[ "udiaeresis"
- ^ self character:$} fromCharacterSet:2
- ].
- (ascii == 16re4) ifTrue:[ "adiaeresis"
- ^ self character:${ fromCharacterSet:2
- ].
- (ascii == 16rf6) ifTrue:[ "odiaeresis"
- ^ self character:$| fromCharacterSet:2
- ].
- (ascii == 16rdc) ifTrue:[ "Udiaeresis"
- ^ self character:$] fromCharacterSet:2
- ].
- (ascii == 16rc4) ifTrue:[ "Adiaeresis"
- ^ self character:$[ fromCharacterSet:2
- ].
- (ascii == 16rd6) ifTrue:[ "Odiaeresis"
- ^ self character:$\ fromCharacterSet:2
- ].
- (ascii == 16rdf) ifTrue:[ "ssharp"
- ^ self character:$~ fromCharacterSet:2
- ]
-!
-
-normal
- "set font to normal"
-
- "send: <ESC>H<ESC>5"
-
- super escape:$H. super escape:$5
-! !
-
-!EpsonFX1PrinterStream methodsFor:'layout'!
-
-linesPerPage:n
- "send: <ESC>C<n>"
-
- super escape:$C.
- super nextPut:(Character value:n)
-!
-
-newPage
- super nextPut:(Character value:12)
-!
-
-noTopMargin
- "send <ESC>0"
-
- super escape:$O
-!
-
-pageHeight:inch
- "send <ESC>G<0><inch>"
-
- super escape:$C.
- super nextPut:(Character value:0).
- super nextPut:(Character value:inch)
-!
-
-proportional:aBoolean
- "send <ESC>p0 or <ESC>p1"
-
- super escape:$p.
- aBoolean ifTrue:[
- super nextPut:$1
- ] ifFalse:[
- super nextPut:$0
- ]
-!
-
-reset
- "send <ESC>@"
-
- super escape:$@
-!
-
-topMargin:n
- "send <ESC>N<n>"
-
- super escape:$N.
- super nextPut:(Character value:n)
! !
!EpsonFX1PrinterStream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/EpsonFX1PrinterStream.st,v 1.14 1996-04-25 17:01:15 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/EpsonFX1PrinterStream.st,v 1.15 1996-05-18 07:14:27 cg Exp $'
! !
--- a/FX1PrStr.st Fri May 17 16:46:19 1996 +0200
+++ b/FX1PrStr.st Sat May 18 09:14:51 1996 +0200
@@ -35,12 +35,24 @@
documentation
"
- This class defines protocol for simple text prinitng on an Epson-FX1
+ This class defines protocol for simple text printing on an Epson-FX1
(and compatible) printer.
It does not support multiple fonts, but knows how to print bold, italic etc.
+ Graphics printing is not supported - you need a postscriptprinter for this.
+
I cannot tell, if this is really an Epson -
- all I had to test was a Citizen 120D - its documentation claims it to be FX1 compatible.
+ all I had to test was a Citizen 120D - its documentation claims it to be
+ FX1 compatible.
+
+ Notice:
+ This class only defines some minimum protocol for printing on
+ Epsons - you really should use a PostscriptPrinter ...
+ ... however, if you own an Epson, here is some class to start with.
+ It may need to be enhanced at some places (for example: provide more
+ fonts/emphasis's; better international character translation etc.)
+
+ This class is not officially supported - take it or leave it.
[author:]
Claus Gittinger
@@ -57,14 +69,161 @@
!EpsonFX1PrinterStream methodsFor:'access writing'!
+cr
+ "send a carriage return (newLine).
+ We have to output cr-nl here"
+
+ super nextPutUntranslated:(Character value:13).
+ super nextPutUntranslated:(Character value:10).
+ self spaces:LeftMargin
+
+ "Modified: 18.5.1996 / 09:02:07 / cg"
+!
+
+nextPut:aCharacter
+ "send aCharacter to the printer.
+ Catch special characters
+ - currently only german umlauts are handled - If you own this type
+ of printer and depend on it, add more translation here ..."
+
+ |ascii|
+
+ ascii := aCharacter asciiValue.
+ (ascii < 128) ifTrue:[
+ ^ super nextPut:aCharacter
+ ].
+ (ascii == 16rfc) ifTrue:[ "udiaeresis"
+ ^ self character:$} fromCharacterSet:2
+ ].
+ (ascii == 16re4) ifTrue:[ "adiaeresis"
+ ^ self character:${ fromCharacterSet:2
+ ].
+ (ascii == 16rf6) ifTrue:[ "odiaeresis"
+ ^ self character:$| fromCharacterSet:2
+ ].
+ (ascii == 16rdc) ifTrue:[ "Udiaeresis"
+ ^ self character:$] fromCharacterSet:2
+ ].
+ (ascii == 16rc4) ifTrue:[ "Adiaeresis"
+ ^ self character:$[ fromCharacterSet:2
+ ].
+ (ascii == 16rd6) ifTrue:[ "Odiaeresis"
+ ^ self character:$\ fromCharacterSet:2
+ ].
+ (ascii == 16rdf) ifTrue:[ "ssharp"
+ ^ self character:$~ fromCharacterSet:2
+ ]
+
+ "Modified: 18.5.1996 / 09:03:18 / cg"
+! !
+
+!EpsonFX1PrinterStream methodsFor:'emphasis change'!
+
bold
- "set font to bold"
+ "set emphasis to bold"
"send: <ESC>G "
super escape:$G
+
+ "Modified: 18.5.1996 / 09:03:31 / cg"
!
+italic
+ "set emphasis to italic"
+
+ "send: <ESC>4 will do that"
+
+ super escape:$4
+
+ "Modified: 18.5.1996 / 09:03:33 / cg"
+!
+
+normal
+ "set emphasis to normal"
+
+ "send: <ESC>H<ESC>5"
+
+ super escape:$H. super escape:$5
+
+ "Modified: 18.5.1996 / 09:03:35 / cg"
+! !
+
+!EpsonFX1PrinterStream methodsFor:'layout'!
+
+linesPerPage:n
+ "change the lines-per-page setting"
+
+ "send: <ESC>C<n>"
+
+ super escape:$C.
+ super nextPut:(Character value:n)
+
+ "Modified: 18.5.1996 / 09:03:50 / cg"
+!
+
+newPage
+ "force a newPage"
+
+ super nextPut:(Character value:12)
+
+ "Modified: 18.5.1996 / 09:04:04 / cg"
+!
+
+noTopMargin
+ "turn off topMargin in the printer"
+
+ "send <ESC>0"
+
+ super escape:$O
+
+ "Modified: 18.5.1996 / 09:04:19 / cg"
+!
+
+pageHeight:inches
+ "set the pageHeight in inches"
+
+ "send <ESC>G<0><inch>"
+
+ super escape:$C.
+ super nextPut:(Character value:0).
+ super nextPut:(Character value:inches)
+
+ "Modified: 18.5.1996 / 09:04:38 / cg"
+!
+
+proportional:aBoolean
+ "turn on/off proportional printing"
+
+ "send <ESC>p0 or <ESC>p1"
+
+ super escape:$p.
+ super nextPut:(aBoolean ifTrue:[$1] ifFalse:[$0])
+
+ "Modified: 18.5.1996 / 09:05:18 / cg"
+!
+
+reset
+ "reset the printer - send <ESC>@"
+
+ super escape:$@
+
+ "Modified: 18.5.1996 / 09:05:27 / cg"
+!
+
+topMargin:n
+ "set the topMargin"
+
+ "send <ESC>N<n>"
+
+ super escape:$N.
+ super nextPut:(Character value:n)
+
+ "Modified: 18.5.1996 / 09:05:43 / cg"
+! !
+
+!EpsonFX1PrinterStream methodsFor:'private'!
+
character:char fromCharacterSet:set
"send a character from an alternate character set"
@@ -75,118 +234,10 @@
super nextPut:char.
super escape:$R.
super nextPut:(Character value:0)
-!
-
-cr
- "have to output cr-nl here"
-
- super nextPutUntranslated:(Character value:13).
- super nextPutUntranslated:(Character value:10).
- self spaces:LeftMargin
-!
-
-italic
- "set font to italic"
-
- "send: <ESC>4 will do that"
-
- super escape:$4
-!
-
-nextPut:aCharacter
- "catch special characters
- - currently only german umlauts are handled - needs more"
-
- |ascii|
-
- ascii := aCharacter asciiValue.
- (ascii < 128) ifTrue:[
- ^ super nextPut:aCharacter
- ].
- (ascii == 16rfc) ifTrue:[ "udiaeresis"
- ^ self character:$} fromCharacterSet:2
- ].
- (ascii == 16re4) ifTrue:[ "adiaeresis"
- ^ self character:${ fromCharacterSet:2
- ].
- (ascii == 16rf6) ifTrue:[ "odiaeresis"
- ^ self character:$| fromCharacterSet:2
- ].
- (ascii == 16rdc) ifTrue:[ "Udiaeresis"
- ^ self character:$] fromCharacterSet:2
- ].
- (ascii == 16rc4) ifTrue:[ "Adiaeresis"
- ^ self character:$[ fromCharacterSet:2
- ].
- (ascii == 16rd6) ifTrue:[ "Odiaeresis"
- ^ self character:$\ fromCharacterSet:2
- ].
- (ascii == 16rdf) ifTrue:[ "ssharp"
- ^ self character:$~ fromCharacterSet:2
- ]
-!
-
-normal
- "set font to normal"
-
- "send: <ESC>H<ESC>5"
-
- super escape:$H. super escape:$5
-! !
-
-!EpsonFX1PrinterStream methodsFor:'layout'!
-
-linesPerPage:n
- "send: <ESC>C<n>"
-
- super escape:$C.
- super nextPut:(Character value:n)
-!
-
-newPage
- super nextPut:(Character value:12)
-!
-
-noTopMargin
- "send <ESC>0"
-
- super escape:$O
-!
-
-pageHeight:inch
- "send <ESC>G<0><inch>"
-
- super escape:$C.
- super nextPut:(Character value:0).
- super nextPut:(Character value:inch)
-!
-
-proportional:aBoolean
- "send <ESC>p0 or <ESC>p1"
-
- super escape:$p.
- aBoolean ifTrue:[
- super nextPut:$1
- ] ifFalse:[
- super nextPut:$0
- ]
-!
-
-reset
- "send <ESC>@"
-
- super escape:$@
-!
-
-topMargin:n
- "send <ESC>N<n>"
-
- super escape:$N.
- super nextPut:(Character value:n)
! !
!EpsonFX1PrinterStream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/Attic/FX1PrStr.st,v 1.14 1996-04-25 17:01:15 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/Attic/FX1PrStr.st,v 1.15 1996-05-18 07:14:27 cg Exp $'
! !
--- a/HPIIPrStr.st Fri May 17 16:46:19 1996 +0200
+++ b/HPIIPrStr.st Sat May 18 09:14:51 1996 +0200
@@ -41,6 +41,16 @@
Graphics printing is not supported - you need a postscriptprinter for this.
+ Notice:
+ This class only defines some minimum protocol for printing on
+ HP-LJ - you really should use a PostscriptPrinter ...
+ ... however, if you own a LJ, here is some class to start with.
+ It may need to be enhanced at some places (for example: provide more
+ fonts/emphasis's, better international character translation,
+ image printing etc.)
+
+ This class is not officially supported - take it or leave it.
+
[author:]
Claus Gittinger
"
@@ -56,49 +66,62 @@
!HPLjetIIPrinterStream methodsFor:'access writing'!
+cr
+ "send a carriage-return (newLine) to the printer.
+ We have to output cr-nl here"
+
+ super nextPutUntranslated:(Character value:13).
+ super nextPutUntranslated:(Character value:10).
+ self spaces:LeftMargin
+
+ "Modified: 18.5.1996 / 09:11:05 / cg"
+! !
+
+!HPLjetIIPrinterStream methodsFor:'emphasis change'!
+
bold
- "switch to bold font-face"
+ "switch to bold emphasis"
"send <ESC>(s0S<ESC>(s3B"
super escapeAll:'(s0S'.
super escapeAll:'(s3B'
+
+ "Modified: 18.5.1996 / 09:10:39 / cg"
!
+italic
+ "switch to italic/oblique emphasis"
+
+ super escapeAll:'(s1S'.
+ super escapeAll:'(s0B'
+
+ "Modified: 18.5.1996 / 09:10:44 / cg"
+!
+
+normal
+ "switch to normal/roman emphasis"
+
+ super escapeAll:'(s0S'.
+ super escapeAll:'(s0B'
+
+ "Modified: 18.5.1996 / 09:10:48 / cg"
+! !
+
+!HPLjetIIPrinterStream methodsFor:'font change'!
+
courier
"switch to courier font"
super escapeAll:'(s3T'
!
-cr
- "have to output cr-nl here"
-
- super nextPutUntranslated:(Character value:13).
- super nextPutUntranslated:(Character value:10).
- self spaces:LeftMargin
-!
-
helvetica
"switch to helvetica font"
super escapeAll:'(s4T'
!
-italic
- "switch to italic/oblique font-face"
-
- super escapeAll:'(s1S'.
- super escapeAll:'(s0B'
-!
-
-normal
- "switch to normal/roman font-face"
-
- super escapeAll:'(s0S'.
- super escapeAll:'(s0B'
-!
-
times
"switch to times font"
@@ -108,5 +131,5 @@
!HPLjetIIPrinterStream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/Attic/HPIIPrStr.st,v 1.13 1996-04-25 17:01:18 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/Attic/HPIIPrStr.st,v 1.14 1996-05-18 07:14:31 cg Exp $'
! !
--- a/HPLjetIIPrinterStream.st Fri May 17 16:46:19 1996 +0200
+++ b/HPLjetIIPrinterStream.st Sat May 18 09:14:51 1996 +0200
@@ -41,6 +41,16 @@
Graphics printing is not supported - you need a postscriptprinter for this.
+ Notice:
+ This class only defines some minimum protocol for printing on
+ HP-LJ - you really should use a PostscriptPrinter ...
+ ... however, if you own a LJ, here is some class to start with.
+ It may need to be enhanced at some places (for example: provide more
+ fonts/emphasis's, better international character translation,
+ image printing etc.)
+
+ This class is not officially supported - take it or leave it.
+
[author:]
Claus Gittinger
"
@@ -56,49 +66,62 @@
!HPLjetIIPrinterStream methodsFor:'access writing'!
+cr
+ "send a carriage-return (newLine) to the printer.
+ We have to output cr-nl here"
+
+ super nextPutUntranslated:(Character value:13).
+ super nextPutUntranslated:(Character value:10).
+ self spaces:LeftMargin
+
+ "Modified: 18.5.1996 / 09:11:05 / cg"
+! !
+
+!HPLjetIIPrinterStream methodsFor:'emphasis change'!
+
bold
- "switch to bold font-face"
+ "switch to bold emphasis"
"send <ESC>(s0S<ESC>(s3B"
super escapeAll:'(s0S'.
super escapeAll:'(s3B'
+
+ "Modified: 18.5.1996 / 09:10:39 / cg"
!
+italic
+ "switch to italic/oblique emphasis"
+
+ super escapeAll:'(s1S'.
+ super escapeAll:'(s0B'
+
+ "Modified: 18.5.1996 / 09:10:44 / cg"
+!
+
+normal
+ "switch to normal/roman emphasis"
+
+ super escapeAll:'(s0S'.
+ super escapeAll:'(s0B'
+
+ "Modified: 18.5.1996 / 09:10:48 / cg"
+! !
+
+!HPLjetIIPrinterStream methodsFor:'font change'!
+
courier
"switch to courier font"
super escapeAll:'(s3T'
!
-cr
- "have to output cr-nl here"
-
- super nextPutUntranslated:(Character value:13).
- super nextPutUntranslated:(Character value:10).
- self spaces:LeftMargin
-!
-
helvetica
"switch to helvetica font"
super escapeAll:'(s4T'
!
-italic
- "switch to italic/oblique font-face"
-
- super escapeAll:'(s1S'.
- super escapeAll:'(s0B'
-!
-
-normal
- "switch to normal/roman font-face"
-
- super escapeAll:'(s0S'.
- super escapeAll:'(s0B'
-!
-
times
"switch to times font"
@@ -108,5 +131,5 @@
!HPLjetIIPrinterStream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/HPLjetIIPrinterStream.st,v 1.13 1996-04-25 17:01:18 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/HPLjetIIPrinterStream.st,v 1.14 1996-05-18 07:14:31 cg Exp $'
! !
--- a/PSPrStr.st Fri May 17 16:46:19 1996 +0200
+++ b/PSPrStr.st Sat May 18 09:14:51 1996 +0200
@@ -115,6 +115,8 @@
drawable := PSGraphicsContext on:s.
drawable displayLineFrom:(0@0) to:(100@100).
+ drawable displayLineFrom:(100@0) to:(0@100).
+ drawable displayCircle:(150@150) radius:50.
(Image fromFile:'bitmaps/SBrowser.xbm') displayOn:drawable at:(50@30).
drawable close.
@@ -127,6 +129,8 @@
drawable := (View extent:200@200) openAndWait.
drawable displayLineFrom:(0@0) to:(100@100).
+ drawable displayLineFrom:(100@0) to:(0@100).
+ drawable displayCircle:(150@150) radius:50.
(Image fromFile:'bitmaps/SBrowser.xbm') displayOn:drawable at:(50@30).
[exEnd]
"
@@ -339,68 +343,6 @@
"Created: 10.2.1996 / 16:23:23 / cg"
! !
-!PostscriptPrinterStream methodsFor:'access font change'!
-
-bold
- "further printing is in bold"
-
- self flushLine.
- fStyle := Bold.
- self setFont
-
- "Modified: 10.4.1996 / 13:34:37 / cg"
-!
-
-courier
- "further printing is in the courier font"
-
- self flushLine.
- fFamily := Courier.
- self setFont
-
- "Modified: 10.4.1996 / 13:34:49 / cg"
-!
-
-helvetica
- "further printing is in the helvetica font"
-
- self flushLine.
- fFamily := Helvetica.
- self setFont
-
- "Modified: 10.4.1996 / 13:34:58 / cg"
-!
-
-italic
- "further printing is in italic"
-
- self flushLine.
- fStyle := Italic.
- self setFont
-
- "Modified: 10.4.1996 / 13:35:16 / cg"
-!
-
-normal
- "further printing is in normal style (i.e. non-bold/non-italic)"
-
- self flushLine.
- fStyle := Normal.
- self setFont
-
- "Modified: 10.4.1996 / 13:35:57 / cg"
-!
-
-times
- "further printing is in the times font"
-
- self flushLine.
- fFamily := Times.
- self setFont
-
- "Modified: 10.4.1996 / 13:36:07 / cg"
-! !
-
!PostscriptPrinterStream methodsFor:'access writing'!
cr
@@ -461,6 +403,70 @@
"Modified: 23.4.1996 / 20:05:59 / cg"
! !
+!PostscriptPrinterStream methodsFor:'emphasis change'!
+
+bold
+ "further printing is in bold"
+
+ self flushLine.
+ fStyle := Bold.
+ self setFont
+
+ "Modified: 10.4.1996 / 13:34:37 / cg"
+!
+
+italic
+ "further printing is in italic"
+
+ self flushLine.
+ fStyle := Italic.
+ self setFont
+
+ "Modified: 10.4.1996 / 13:35:16 / cg"
+!
+
+normal
+ "further printing is in normal style (i.e. non-bold/non-italic)"
+
+ self flushLine.
+ fStyle := Normal.
+ self setFont
+
+ "Modified: 10.4.1996 / 13:35:57 / cg"
+! !
+
+!PostscriptPrinterStream methodsFor:'font change'!
+
+courier
+ "further printing is in the courier font"
+
+ self flushLine.
+ fFamily := Courier.
+ self setFont
+
+ "Modified: 10.4.1996 / 13:34:49 / cg"
+!
+
+helvetica
+ "further printing is in the helvetica font"
+
+ self flushLine.
+ fFamily := Helvetica.
+ self setFont
+
+ "Modified: 10.4.1996 / 13:34:58 / cg"
+!
+
+times
+ "further printing is in the times font"
+
+ self flushLine.
+ fFamily := Times.
+ self setFont
+
+ "Modified: 10.4.1996 / 13:36:07 / cg"
+! !
+
!PostscriptPrinterStream methodsFor:'open/close'!
endPrint
@@ -568,6 +574,6 @@
!PostscriptPrinterStream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/Attic/PSPrStr.st,v 1.24 1996-04-27 18:03:53 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/Attic/PSPrStr.st,v 1.25 1996-05-18 07:14:36 cg Exp $'
! !
PostscriptPrinterStream initialize!
--- a/PostscriptPrinterStream.st Fri May 17 16:46:19 1996 +0200
+++ b/PostscriptPrinterStream.st Sat May 18 09:14:51 1996 +0200
@@ -115,6 +115,8 @@
drawable := PSGraphicsContext on:s.
drawable displayLineFrom:(0@0) to:(100@100).
+ drawable displayLineFrom:(100@0) to:(0@100).
+ drawable displayCircle:(150@150) radius:50.
(Image fromFile:'bitmaps/SBrowser.xbm') displayOn:drawable at:(50@30).
drawable close.
@@ -127,6 +129,8 @@
drawable := (View extent:200@200) openAndWait.
drawable displayLineFrom:(0@0) to:(100@100).
+ drawable displayLineFrom:(100@0) to:(0@100).
+ drawable displayCircle:(150@150) radius:50.
(Image fromFile:'bitmaps/SBrowser.xbm') displayOn:drawable at:(50@30).
[exEnd]
"
@@ -339,68 +343,6 @@
"Created: 10.2.1996 / 16:23:23 / cg"
! !
-!PostscriptPrinterStream methodsFor:'access font change'!
-
-bold
- "further printing is in bold"
-
- self flushLine.
- fStyle := Bold.
- self setFont
-
- "Modified: 10.4.1996 / 13:34:37 / cg"
-!
-
-courier
- "further printing is in the courier font"
-
- self flushLine.
- fFamily := Courier.
- self setFont
-
- "Modified: 10.4.1996 / 13:34:49 / cg"
-!
-
-helvetica
- "further printing is in the helvetica font"
-
- self flushLine.
- fFamily := Helvetica.
- self setFont
-
- "Modified: 10.4.1996 / 13:34:58 / cg"
-!
-
-italic
- "further printing is in italic"
-
- self flushLine.
- fStyle := Italic.
- self setFont
-
- "Modified: 10.4.1996 / 13:35:16 / cg"
-!
-
-normal
- "further printing is in normal style (i.e. non-bold/non-italic)"
-
- self flushLine.
- fStyle := Normal.
- self setFont
-
- "Modified: 10.4.1996 / 13:35:57 / cg"
-!
-
-times
- "further printing is in the times font"
-
- self flushLine.
- fFamily := Times.
- self setFont
-
- "Modified: 10.4.1996 / 13:36:07 / cg"
-! !
-
!PostscriptPrinterStream methodsFor:'access writing'!
cr
@@ -461,6 +403,70 @@
"Modified: 23.4.1996 / 20:05:59 / cg"
! !
+!PostscriptPrinterStream methodsFor:'emphasis change'!
+
+bold
+ "further printing is in bold"
+
+ self flushLine.
+ fStyle := Bold.
+ self setFont
+
+ "Modified: 10.4.1996 / 13:34:37 / cg"
+!
+
+italic
+ "further printing is in italic"
+
+ self flushLine.
+ fStyle := Italic.
+ self setFont
+
+ "Modified: 10.4.1996 / 13:35:16 / cg"
+!
+
+normal
+ "further printing is in normal style (i.e. non-bold/non-italic)"
+
+ self flushLine.
+ fStyle := Normal.
+ self setFont
+
+ "Modified: 10.4.1996 / 13:35:57 / cg"
+! !
+
+!PostscriptPrinterStream methodsFor:'font change'!
+
+courier
+ "further printing is in the courier font"
+
+ self flushLine.
+ fFamily := Courier.
+ self setFont
+
+ "Modified: 10.4.1996 / 13:34:49 / cg"
+!
+
+helvetica
+ "further printing is in the helvetica font"
+
+ self flushLine.
+ fFamily := Helvetica.
+ self setFont
+
+ "Modified: 10.4.1996 / 13:34:58 / cg"
+!
+
+times
+ "further printing is in the times font"
+
+ self flushLine.
+ fFamily := Times.
+ self setFont
+
+ "Modified: 10.4.1996 / 13:36:07 / cg"
+! !
+
!PostscriptPrinterStream methodsFor:'open/close'!
endPrint
@@ -568,6 +574,6 @@
!PostscriptPrinterStream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/PostscriptPrinterStream.st,v 1.24 1996-04-27 18:03:53 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/PostscriptPrinterStream.st,v 1.25 1996-05-18 07:14:36 cg Exp $'
! !
PostscriptPrinterStream initialize!
--- a/PrinterStream.st Fri May 17 16:46:19 1996 +0200
+++ b/PrinterStream.st Sat May 18 09:14:51 1996 +0200
@@ -36,8 +36,9 @@
documentation
"
a stream for printing; this (concrete or abstract) class can handle only
- very dumb printers. No attributes (italic, bold etc) and no multiple fonts
- are supported - just plain single font text printing.
+ very dumb printers.
+ No attributes (italic, bold etc) and no multiple fonts are supported
+ - just plain single font text printing.
More intelligence is added by subclasses (see PostscriptPrinterStream among others.)
@@ -45,6 +46,9 @@
text; although some limited font functionality (such as bold or italic printing)
may be supported by some subclasses.
+
+ [usage:]
+
The concrete printer class is bound to the global variable Printer,
which is either set to PrinterStream (for dumb printers) or to one of
the subclasses (PostscriptPrinterStream etc.).
@@ -62,6 +66,14 @@
See users of the Printer global variable for more examples.
+ [class variables:]
+ PrintCommand <String> the operatingSystem command for printing.
+ Usually something like 'lp' or 'lpr'
+
+ LeftMargin <Integer> optional default left margin.
+ Defaults to 0.
+
+
[author:]
Claus Gittinger
"
@@ -131,13 +143,15 @@
!
printCommand
- "return command used for printing (usually lp or lpr)"
+ "return the command used for printing (usually 'lp' or 'lpr')"
^ PrintCommand
+
+ "Modified: 18.5.1996 / 09:12:35 / cg"
!
printCommand:aString
- "set the command for printing (usually lp or lpr)"
+ "set the command for printing (usually 'lp' or 'lpr')"
PrintCommand := aString
@@ -147,6 +161,8 @@
PrinterStream printCommand:'rsh ibm lpr -h'
PrinterStream printCommand:'gs -sDEVICE=djet500 -sOutputFile=/tmp/stx.ps -sPAPERSIZE=a4 -q -; cat /tmp/stx.ps | rsh ibm lpr -h'
"
+
+ "Modified: 18.5.1996 / 09:12:48 / cg"
! !
!PrinterStream class methodsFor:'queries'!
@@ -167,81 +183,6 @@
"Created: 10.2.1996 / 16:23:07 / cg"
! !
-!PrinterStream methodsFor:'access font change'!
-
-bold
- "set font to bold
- - ignore here, since this class does not know anything about the printer"
-
- ^ self
-!
-
-boldItalic
- "set font to boldItalic
- - ignore here, since this class does not know anything about the printer"
-
- ^ self
-
- "Created: 14.5.1996 / 18:53:43 / cg"
-!
-
-courier
- "set font to courier
- - ignore here, since this class does not know anything about the printer"
-
- ^ self
-!
-
-emphasis:anEmphasis
- "change the emphasis"
-
- anEmphasis isNil ifTrue:[
- ^ self normal
- ].
- anEmphasis == #bold ifTrue:[
- ^ self bold
- ].
- anEmphasis == #italic ifTrue:[
- ^ self italic
- ].
- anEmphasis == #underline ifTrue:[
- ^ self underline
- ].
- anEmphasis == #strikeout ifTrue:[
- ^ self strikeout
- ].
-
- "Created: 14.5.1996 / 18:53:54 / cg"
-!
-
-helvetica
- "set font to helvetic
- - ignore here, since this class does not know anything about the printer"
-
- ^ self
-!
-
-italic
- "set font to italic
- - ignore here, since this class does not know anything about the printer"
-
- ^ self
-!
-
-normal
- "set font to normal (non-bold, non-italic)
- - ignore here, since this class does not know anything about the printer"
-
- ^ self
-!
-
-times
- "set font to times
- - ignore here, since this class does not know anything about the printer"
-
- ^ self
-! !
-
!PrinterStream methodsFor:'access writing'!
cr
@@ -275,11 +216,21 @@
!
nextPutAll:aCollection
- "send some characters to the printer - translate as needed"
+ "send some characters to the printer - translate as needed.
+ The argument, aCollection can be a Text (i.e. include emphasis)"
- aCollection do:[:aChar |
- self nextPut:aChar
+ aCollection hasChangeOfEmphasis ifTrue:[
+ aCollection keysAndValuesDo:[:idx :aChar |
+ self emphasis:(aCollection emphasisAt:idx).
+ self nextPut:aChar.
+ ]
+ ] ifFalse:[
+ aCollection do:[:aChar |
+ self nextPut:aChar
+ ]
]
+
+ "Modified: 18.5.1996 / 09:01:00 / cg"
!
nextPutAllUntranslated:aCollection
@@ -298,6 +249,110 @@
"Modified: 10.4.1996 / 13:08:28 / cg"
! !
+!PrinterStream methodsFor:'emphasis change'!
+
+bold
+ "set emphasis to bold
+ - ignore here, since this class does not know anything about the printer"
+
+ ^ self
+
+ "Modified: 18.5.1996 / 08:55:10 / cg"
+!
+
+boldItalic
+ "set emphasis to boldItalic
+ - ignore here, since this class does not know anything about the printer"
+
+ ^ self
+
+ "Created: 14.5.1996 / 18:53:43 / cg"
+ "Modified: 18.5.1996 / 08:55:14 / cg"
+!
+
+emphasis:anEmphasis
+ "change the emphasis"
+
+ anEmphasis isNil ifTrue:[
+ ^ self normal
+ ].
+ anEmphasis == #bold ifTrue:[
+ ^ self bold
+ ].
+ anEmphasis == #italic ifTrue:[
+ ^ self italic
+ ].
+ anEmphasis == #underline ifTrue:[
+ ^ self underline
+ ].
+ anEmphasis == #strikeout ifTrue:[
+ ^ self strikeout
+ ].
+
+ "Created: 14.5.1996 / 18:53:54 / cg"
+!
+
+italic
+ "set emphasis to italic
+ - ignore here, since this class does not know anything about the printer"
+
+ ^ self
+
+ "Modified: 18.5.1996 / 08:55:18 / cg"
+!
+
+normal
+ "set emphasis to normal (non-bold, non-italic)
+ - ignore here, since this class does not know anything about the printer"
+
+ ^ self
+
+ "Modified: 18.5.1996 / 08:55:21 / cg"
+!
+
+strikeout
+ "set emphasis to strikeout
+ - ignore here, since this class does not know anything about the printer"
+
+ ^ self
+
+ "Modified: 18.5.1996 / 08:55:10 / cg"
+ "Created: 18.5.1996 / 08:56:13 / cg"
+!
+
+underline
+ "set emphasis to underline
+ - ignore here, since this class does not know anything about the printer"
+
+ ^ self
+
+ "Modified: 18.5.1996 / 08:55:10 / cg"
+ "Created: 18.5.1996 / 08:56:24 / cg"
+! !
+
+!PrinterStream methodsFor:'font change'!
+
+courier
+ "set font to courier
+ - ignore here, since this class does not know anything about the printer"
+
+ ^ self
+!
+
+helvetica
+ "set font to helvetic
+ - ignore here, since this class does not know anything about the printer"
+
+ ^ self
+!
+
+times
+ "set font to times
+ - ignore here, since this class does not know anything about the printer"
+
+ ^ self
+! !
+
!PrinterStream methodsFor:'helpers writing'!
escape:aCharacter
@@ -349,6 +404,6 @@
!PrinterStream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/PrinterStream.st,v 1.22 1996-05-14 16:54:02 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/PrinterStream.st,v 1.23 1996-05-18 07:14:51 cg Exp $'
! !
PrinterStream initialize!