0
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1988-93 by Claus Gittinger
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
PrinterStream subclass:#EpsonFX1PrinterStream
|
|
14 |
instanceVariableNames:''
|
|
15 |
classVariableNames:''
|
|
16 |
poolDictionaries:''
|
|
17 |
category:'Streams-External'
|
|
18 |
!
|
|
19 |
|
|
20 |
EpsonFX1PrinterStream comment:'
|
|
21 |
%W% %E%
|
|
22 |
|
|
23 |
cannot tell, if this is really an Epson -
|
|
24 |
all I have is a Citizen 120D to test - the doc says its an FX1
|
|
25 |
|
|
26 |
written Feb 91 by claus
|
|
27 |
'!
|
|
28 |
|
|
29 |
!EpsonFX1PrinterStream methodsFor:'layout'!
|
|
30 |
|
|
31 |
reset
|
|
32 |
super nextPut:(Character esc).
|
|
33 |
super nextPut:$@
|
|
34 |
!
|
|
35 |
|
|
36 |
pageHeight:inch
|
|
37 |
super nextPut:(Character esc).
|
|
38 |
super nextPut:$C.
|
|
39 |
super nextPut:(Character value:0).
|
|
40 |
super nextPut:(Character value:inch)
|
|
41 |
!
|
|
42 |
|
|
43 |
linesPerPage:n
|
|
44 |
super nextPut:(Character esc).
|
|
45 |
super nextPut:$C.
|
|
46 |
super nextPut:(Character value:n)
|
|
47 |
!
|
|
48 |
|
|
49 |
noTopMargin
|
|
50 |
super nextPut:(Character esc).
|
|
51 |
super nextPut:$O
|
|
52 |
!
|
|
53 |
|
|
54 |
topMargin:n
|
|
55 |
super nextPut:(Character esc).
|
|
56 |
super nextPut:$N.
|
|
57 |
super nextPut:(Character value:n)
|
|
58 |
!
|
|
59 |
|
|
60 |
leftMargin:n
|
|
61 |
leftMargin := n
|
|
62 |
!
|
|
63 |
|
|
64 |
proportional:aBoolean
|
|
65 |
super nextPut:(Character esc).
|
|
66 |
super nextPut:$p.
|
|
67 |
aBoolean ifTrue:[
|
|
68 |
super nextPut:$1
|
|
69 |
] ifFalse:[
|
|
70 |
super nextPut:$0
|
|
71 |
]
|
|
72 |
!
|
|
73 |
|
|
74 |
newPage
|
|
75 |
super nextPut:(Character value:12)
|
|
76 |
! !
|
|
77 |
|
|
78 |
!EpsonFX1PrinterStream methodsFor:'access writing'!
|
|
79 |
|
|
80 |
character:char fromCharacterSet:set
|
|
81 |
super nextPut:(Character esc).
|
|
82 |
super nextPut:$R.
|
|
83 |
super nextPut:(Character value:set).
|
|
84 |
super nextPut:char.
|
|
85 |
super nextPut:(Character esc).
|
|
86 |
super nextPut:$R.
|
|
87 |
super nextPut:(Character value:0)
|
|
88 |
!
|
|
89 |
|
|
90 |
nextPut:aCharacter
|
|
91 |
"catch special characters"
|
|
92 |
|ascii|
|
|
93 |
|
|
94 |
ascii := aCharacter asciiValue.
|
|
95 |
(ascii < 128) ifTrue:[
|
|
96 |
^ super nextPut:aCharacter
|
|
97 |
].
|
|
98 |
(ascii == 16rfc) ifTrue:[ "udiaeresis"
|
|
99 |
^ self character:$} fromCharacterSet:2
|
|
100 |
].
|
|
101 |
(ascii == 16re4) ifTrue:[ "adiaeresis"
|
|
102 |
^ self character:${ fromCharacterSet:2
|
|
103 |
].
|
|
104 |
(ascii == 16rf6) ifTrue:[ "odiaeresis"
|
|
105 |
^ self character:$| fromCharacterSet:2
|
|
106 |
].
|
|
107 |
(ascii == 16rdc) ifTrue:[ "Udiaeresis"
|
|
108 |
^ self character:$] fromCharacterSet:2
|
|
109 |
].
|
|
110 |
(ascii == 16rc4) ifTrue:[ "Adiaeresis"
|
|
111 |
^ self character:$[ fromCharacterSet:2
|
|
112 |
].
|
|
113 |
(ascii == 16rd6) ifTrue:[ "Odiaeresis"
|
|
114 |
^ self character:$\ fromCharacterSet:2
|
|
115 |
].
|
|
116 |
(ascii == 16rdf) ifTrue:[ "ssharp"
|
|
117 |
^ self character:$~ fromCharacterSet:2
|
|
118 |
]
|
|
119 |
!
|
|
120 |
|
|
121 |
cr
|
|
122 |
"have to output cr-nl here"
|
|
123 |
|
|
124 |
super nextPutUntranslated:(Character value:13).
|
|
125 |
super nextPutUntranslated:(Character value:10).
|
|
126 |
self spaces:leftMargin
|
|
127 |
!
|
|
128 |
|
|
129 |
bold
|
|
130 |
"switch to bold font-face"
|
|
131 |
|
|
132 |
super nextPut:(Character esc).
|
|
133 |
super nextPutAll:'G'
|
|
134 |
!
|
|
135 |
|
|
136 |
italic
|
|
137 |
"switch to italic/oblique font-face"
|
|
138 |
|
|
139 |
super nextPut:(Character esc).
|
|
140 |
super nextPutAll:'4'
|
|
141 |
!
|
|
142 |
|
|
143 |
normal
|
|
144 |
"switch to normal font-face"
|
|
145 |
|
|
146 |
super nextPut:(Character esc).
|
|
147 |
super nextPutAll:'H'.
|
|
148 |
super nextPut:(Character esc).
|
|
149 |
super nextPutAll:'5'
|
|
150 |
! !
|