author | Claus Gittinger <cg@exept.de> |
Thu, 09 Jun 2016 17:48:53 +0200 | |
changeset 3928 | d1133788cbba |
parent 1649 | 5b56cd237a28 |
child 4196 | bb2ff928a16d |
permissions | -rw-r--r-- |
0 | 1 |
" |
4 | 2 |
COPYRIGHT (c) 1988 by Claus Gittinger |
84 | 3 |
All Rights Reserved |
0 | 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 |
||
1317 | 13 |
"{ Package: 'stx:libbasic2' }" |
14 |
||
0 | 15 |
PrinterStream subclass:#HPLjetIIPrinterStream |
259 | 16 |
instanceVariableNames:'' |
17 |
classVariableNames:'' |
|
18 |
poolDictionaries:'' |
|
1649 | 19 |
category:'Interface-Printing' |
0 | 20 |
! |
21 |
||
1317 | 22 |
!HPLjetIIPrinterStream class methodsFor:'documentation'! |
31 | 23 |
|
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1988 by Claus Gittinger |
|
84 | 27 |
All Rights Reserved |
31 | 28 |
|
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
38 |
documentation |
|
39 |
" |
|
179
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
126
diff
changeset
|
40 |
This class defines protocol for simple text prinitng on an HP Laserjet 2/3 |
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
126
diff
changeset
|
41 |
(and compatible) printer. |
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
126
diff
changeset
|
42 |
It does not support multiple fonts, but knows how to print bold, italic etc. |
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
126
diff
changeset
|
43 |
|
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
126
diff
changeset
|
44 |
Graphics printing is not supported - you need a postscriptprinter for this. |
259 | 45 |
|
348 | 46 |
Notice: |
47 |
This class only defines some minimum protocol for printing on |
|
48 |
HP-LJ - you really should use a PostscriptPrinter ... |
|
49 |
... however, if you own a LJ, here is some class to start with. |
|
50 |
It may need to be enhanced at some places (for example: provide more |
|
51 |
fonts/emphasis's, better international character translation, |
|
52 |
image printing etc.) |
|
53 |
||
54 |
This class is not officially supported - take it or leave it. |
|
55 |
||
259 | 56 |
[author:] |
57 |
Claus Gittinger |
|
31 | 58 |
" |
179
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
126
diff
changeset
|
59 |
! ! |
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
126
diff
changeset
|
60 |
|
1317 | 61 |
!HPLjetIIPrinterStream class methodsFor:'initialization'! |
441 | 62 |
|
63 |
initialize |
|
64 |
DefaultCommands := #('lpr' |
|
65 |
'lpr -P<your-printer>' |
|
66 |
'cat | rsh <printHost> lpr -h' |
|
67 |
). |
|
68 |
super initialize |
|
69 |
||
70 |
" |
|
71 |
self initialize |
|
72 |
" |
|
73 |
||
74 |
! ! |
|
75 |
||
1317 | 76 |
!HPLjetIIPrinterStream class methodsFor:'queries'! |
179
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
126
diff
changeset
|
77 |
|
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
126
diff
changeset
|
78 |
printerTypeName |
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
126
diff
changeset
|
79 |
"return a descriptive name" |
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
126
diff
changeset
|
80 |
|
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
126
diff
changeset
|
81 |
^ 'hp laserjet III compatible printer' |
31 | 82 |
! ! |
83 |
||
0 | 84 |
!HPLjetIIPrinterStream methodsFor:'access writing'! |
85 |
||
348 | 86 |
cr |
87 |
"send a carriage-return (newLine) to the printer. |
|
88 |
We have to output cr-nl here" |
|
89 |
||
90 |
super nextPutUntranslated:(Character value:13). |
|
91 |
super nextPutUntranslated:(Character value:10). |
|
370 | 92 |
self spaces:self class leftMargin |
348 | 93 |
|
370 | 94 |
"Modified: 1.6.1996 / 00:13:42 / cg" |
1317 | 95 |
! |
96 |
||
97 |
nextPut:aCharacter |
|
98 |
stream nextPut:aCharacter |
|
348 | 99 |
! ! |
100 |
||
101 |
!HPLjetIIPrinterStream methodsFor:'emphasis change'! |
|
102 |
||
126 | 103 |
bold |
348 | 104 |
"switch to bold emphasis" |
0 | 105 |
|
179
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
126
diff
changeset
|
106 |
"send <ESC>(s0S<ESC>(s3B" |
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
126
diff
changeset
|
107 |
|
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
126
diff
changeset
|
108 |
super escapeAll:'(s0S'. |
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
126
diff
changeset
|
109 |
super escapeAll:'(s3B' |
348 | 110 |
|
111 |
"Modified: 18.5.1996 / 09:10:39 / cg" |
|
0 | 112 |
! |
113 |
||
348 | 114 |
italic |
115 |
"switch to italic/oblique emphasis" |
|
116 |
||
117 |
super escapeAll:'(s1S'. |
|
118 |
super escapeAll:'(s0B' |
|
119 |
||
120 |
"Modified: 18.5.1996 / 09:10:44 / cg" |
|
121 |
! |
|
122 |
||
123 |
normal |
|
124 |
"switch to normal/roman emphasis" |
|
125 |
||
126 |
super escapeAll:'(s0S'. |
|
127 |
super escapeAll:'(s0B' |
|
128 |
||
129 |
"Modified: 18.5.1996 / 09:10:48 / cg" |
|
130 |
! ! |
|
131 |
||
132 |
!HPLjetIIPrinterStream methodsFor:'font change'! |
|
133 |
||
0 | 134 |
courier |
135 |
"switch to courier font" |
|
136 |
||
179
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
126
diff
changeset
|
137 |
super escapeAll:'(s3T' |
0 | 138 |
! |
139 |
||
140 |
helvetica |
|
141 |
"switch to helvetica font" |
|
142 |
||
179
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
126
diff
changeset
|
143 |
super escapeAll:'(s4T' |
0 | 144 |
! |
145 |
||
126 | 146 |
times |
147 |
"switch to times font" |
|
148 |
||
179
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
126
diff
changeset
|
149 |
super escapeAll:'(s5T' |
0 | 150 |
! ! |
259 | 151 |
|
1317 | 152 |
!HPLjetIIPrinterStream class methodsFor:'documentation'! |
259 | 153 |
|
154 |
version |
|
1649 | 155 |
^ '$Header: /cvs/stx/stx/libbasic2/HPLjetIIPrinterStream.st,v 1.18 2006-08-07 13:26:59 fm Exp $' |
259 | 156 |
! ! |
1317 | 157 |
|
441 | 158 |
HPLjetIIPrinterStream initialize! |