HPLjetIIPrinterStream.st
changeset 179 38773360f4b7
parent 126 fca9404da9d4
child 259 6d36f3ac42a2
equal deleted inserted replaced
178:102f75c21a74 179:38773360f4b7
    33 "
    33 "
    34 !
    34 !
    35 
    35 
    36 documentation
    36 documentation
    37 "
    37 "
    38     This class defines protocol for simple text prinitng on an HP Laserjet 2
    38     This class defines protocol for simple text prinitng on an HP Laserjet 2/3
    39     (and compatible) printer. It knows the escape codes for bold, italic etc.
    39     (and compatible) printer. 
       
    40     It does not support multiple fonts, but knows how to print bold, italic etc.
       
    41 
       
    42     Graphics printing is not supported - you need a postscriptprinter for this.
    40 "
    43 "
    41 !
    44 !
    42 
    45 
    43 version
    46 version
    44     ^ '$Header: /cvs/stx/stx/libbasic2/HPLjetIIPrinterStream.st,v 1.11 1995-11-23 01:50:58 cg Exp $'
    47     ^ '$Header: /cvs/stx/stx/libbasic2/HPLjetIIPrinterStream.st,v 1.12 1996-02-02 19:53:48 cg Exp $'
       
    48 ! !
       
    49 
       
    50 !HPLjetIIPrinterStream class methodsFor:'queries'!
       
    51 
       
    52 printerTypeName
       
    53     "return a descriptive name"
       
    54 
       
    55     ^ 'hp laserjet III compatible printer'
    45 ! !
    56 ! !
    46 
    57 
    47 !HPLjetIIPrinterStream methodsFor:'access writing'!
    58 !HPLjetIIPrinterStream methodsFor:'access writing'!
    48 
    59 
    49 bold
    60 bold
    50     "switch to bold font-face"
    61     "switch to bold font-face"
    51 
    62 
    52     super nextPut:(Character esc).
    63     "send <ESC>(s0S<ESC>(s3B"
    53     super nextPutAll:'(s0S'.
    64 
    54     super nextPut:(Character esc).
    65     super escapeAll:'(s0S'.
    55     super nextPutAll:'(s3B'
    66     super escapeAll:'(s3B'
    56 !
    67 !
    57 
    68 
    58 courier
    69 courier
    59     "switch to courier font"
    70     "switch to courier font"
    60 
    71 
    61     super nextPut:(Character esc).
    72     super escapeAll:'(s3T'
    62     super nextPutAll:'(s3T'
       
    63 !
    73 !
    64 
    74 
    65 cr
    75 cr
    66     "have to output cr-nl here"
    76     "have to output cr-nl here"
    67 
    77 
    71 !
    81 !
    72 
    82 
    73 helvetica
    83 helvetica
    74     "switch to helvetica font"
    84     "switch to helvetica font"
    75 
    85 
    76     super nextPut:(Character esc).
    86     super escapeAll:'(s4T'
    77     super nextPutAll:'(s4T'
       
    78 !
    87 !
    79 
    88 
    80 italic
    89 italic
    81     "switch to italic/oblique font-face"
    90     "switch to italic/oblique font-face"
    82 
    91 
    83     super nextPut:(Character esc).
    92     super escapeAll:'(s1S'.
    84     super nextPutAll:'(s1S'.
    93     super escapeAll:'(s0B'
    85     super nextPut:(Character esc).
       
    86     super nextPutAll:'(s0B'
       
    87 !
    94 !
    88 
    95 
    89 normal
    96 normal
    90     "switch to normal/roman font-face"
    97     "switch to normal/roman font-face"
    91 
    98 
    92     super nextPut:(Character esc).
    99     super escapeAll:'(s0S'.
    93     super nextPutAll:'(s0S'.
   100     super escapeAll:'(s0B'
    94     super nextPut:(Character esc).
       
    95     super nextPutAll:'(s0B'
       
    96 !
   101 !
    97 
   102 
    98 times
   103 times
    99     "switch to times font"
   104     "switch to times font"
   100 
   105 
   101     super nextPut:(Character esc).
   106     super escapeAll:'(s5T'
   102     super nextPutAll:'(s5T'
       
   103 ! !
   107 ! !
   104