PostscriptPrinterStream.st
author Claus Gittinger <cg@exept.de>
Sat, 08 Jun 1996 11:10:06 +0200
changeset 390 3f22865fa873
parent 386 cebdfb2e9cf0
child 391 244f0e731912
permissions -rw-r--r--
fixed handling of underline; no longer affects bold/italic setting. prepared for strikeout.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
     1
"
4
1f66800df351 *** empty log message ***
claus
parents: 2
diff changeset
     2
 COPYRIGHT (c) 1988 by Claus Gittinger
71
claus
parents: 36
diff changeset
     3
	      All Rights Reserved
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
     4
1cf8d1747859 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
1cf8d1747859 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
1cf8d1747859 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
1cf8d1747859 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
1cf8d1747859 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
1cf8d1747859 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
1cf8d1747859 Initial revision
claus
parents:
diff changeset
    11
"
1cf8d1747859 Initial revision
claus
parents:
diff changeset
    12
1cf8d1747859 Initial revision
claus
parents:
diff changeset
    13
PrinterStream subclass:#PostscriptPrinterStream
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    14
	instanceVariableNames:'xPos yPos lineBuffer colNr lineNr fFamily fStyle
382
113b013200d3 implement underline
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
    15
		pageStartAction pageEndAction'
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    16
	classVariableNames:'Prolog Trailer PageProlog PageTrailer FontNames FontHeight
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
    17
		FontWidth LeftX TopY PageHeight LinesPerPage PhysicalPageHeight
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
    18
		Italic Bold Normal BoldItalic Courier Times Helvetica TopInset
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
    19
		LeftInset BottomInset'
186
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
    20
	poolDictionaries:''
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
    21
	category:'Streams-External'
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
    22
!
1cf8d1747859 Initial revision
claus
parents:
diff changeset
    23
6
claus
parents: 4
diff changeset
    24
!PostscriptPrinterStream class methodsFor:'documentation'!
claus
parents: 4
diff changeset
    25
31
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    26
copyright
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    27
"
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    28
 COPYRIGHT (c) 1988 by Claus Gittinger
71
claus
parents: 36
diff changeset
    29
	      All Rights Reserved
31
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    30
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    31
 This software is furnished under a license and may be used
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    32
 only in accordance with the terms of that license and with the
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    33
 inclusion of the above copyright notice.   This software may not
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    34
 be provided or otherwise made available to, or used by, any
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    35
 other person.  No title to or ownership of the software is
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    36
 hereby transferred.
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    37
"
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    38
!
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    39
6
claus
parents: 4
diff changeset
    40
documentation
claus
parents: 4
diff changeset
    41
"
28
350f8e9493a4 *** empty log message ***
claus
parents: 10
diff changeset
    42
    This class provides simple text output to postscript printers;
31
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    43
    to use it, evaluate 
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    44
	Smalltalk at:#Printer put:PostscriptPrinterStream
179
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 170
diff changeset
    45
    (usually in some rc file).
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
    46
    or change it via the launchers settings-menu.
179
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 170
diff changeset
    47
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    48
    See examples on how to send something to the printer.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    49
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    50
    For now, only Helvetica, Courier and Times fonts in italic, roman and bold
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    51
    are supported.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    52
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    53
    It does not directly support graphics and other fancy features of Postscript,
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    54
    but provides a compatible interface for simple text line-printing 
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    55
    (see other subclasses of PrinterStream).
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    56
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    57
    If you already have a postscript string at hand, this can be sent to
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    58
    the printer in native mode.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    59
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    60
    To output graphics, you need the PSGraphicsContext (and friend-) classes.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    61
    These provide protocol similar to the one provided by display graphicContexts.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    62
    Notice, that these postscript classes are derived from public domain code;
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    63
    there is no warranty.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    64
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    65
    [see also:]
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    66
	PSGraphicsContext 
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    67
	EpsonFX1PrinterStream HPLjetIIPrinterStream PrinterStream
259
6d36f3ac42a2 documentation
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    68
6d36f3ac42a2 documentation
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    69
    [author:]
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    70
	Claus Gittinger
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    71
"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    72
!
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    73
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    74
examples
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    75
"
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
    76
    For text printing, use:
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    77
									[exBegin]
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    78
	|s|
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
    79
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    80
	s := Printer new.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    81
	s nextPutAll:'hello'; cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    82
	s nextPutAll:'normal '.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    83
	s bold.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    84
	s nextPutAll:'this is bold'; cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    85
	s normal.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    86
	s nextPutAll:'normal '.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    87
	s italic.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    88
	s nextPutAll:'this is italic'; cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    89
	s normal.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    90
	s nextPutAll:'normal '.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    91
	s boldItalic.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    92
	s nextPutAll:'this is boldItalic'; cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    93
	s normal.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    94
	s nextPutAll:'normal '.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    95
	s underline.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    96
	s nextPutAll:'this is underlined'; cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    97
	s normal.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    98
	s nextPutAll:'normal again'; cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    99
	s helvetica.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   100
	s nextPutAll:'helvetica'; cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   101
	s times.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   102
	s nextPutAll:'times'; cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   103
	s courier.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   104
	s nextPutAll:'courier'; cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   105
	s close
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   106
									[exEnd]
349
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   107
    or, if you already have emphasized text at hand:
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   108
									[exBegin]
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   109
	|s|
349
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   110
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   111
	s := Printer new.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   112
	s nextPutAll:'hello'; cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   113
	s nextPutAll:'this is '; 
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   114
	  nextPutAll:(Text string:'bold' emphasis:#bold); 
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   115
	  cr;
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   116
	  nextPutAll:'this is '; 
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   117
	  nextPutAll:(Text string:'italic' emphasis:#italic); 
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   118
	  cr;
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   119
	  nextPutAll:'this is ';
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   120
	  nextPutAll:(Text string:'boldItalic' emphasis:#(bold italic)); 
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   121
	  cr;
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   122
	  nextPutAll:'normal again'; 
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   123
	  cr;
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   124
	  helvetica;
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   125
	  nextPutAll:'helvetica';
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   126
	  cr;
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   127
	  times;
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   128
	  nextPutAll:'times'; 
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   129
	  cr;
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   130
	  courier;
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   131
	  nextPutAll:'courier';
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   132
	  cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   133
	s close
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   134
									[exEnd]
179
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 170
diff changeset
   135
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   136
    placing a page-hook, to add a page number:
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   137
    (page hooks require that you understand some postscript ...
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   138
     ... and have a look at how this class generates its postscript code)
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   139
									[exBegin]
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   140
	|s hook pageNr|
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   141
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   142
	s := Printer new.
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   143
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   144
	pageNr := 0.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   145
	hook := [ 
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   146
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   147
		    pageNr := pageNr + 1.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   148
		    s placeString:('page ' , pageNr printString) at:(5500 @ 400).
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   149
		].
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   150
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   151
	s pageEndAction:hook.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   152
	(1 to:200) do:[:lineNr |
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   153
	    s nextPutAll:'line ' , lineNr printString.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   154
	    s cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   155
	].
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   156
	s close.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   157
									[exEnd]
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   158
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   159
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   160
    placing a page-hook, to add a custom frame, logo or company letter-head:
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   161
    (page hooks require that you understand some postscript ...
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   162
     ... and have a look at how this class generates its postscript code.
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   163
     ... and notice that the code below is a q&d demo, working with letter-sized
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   164
     pages only; a real program should ask the printerStream about the actual 
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   165
     pageHeight/pageWidth.)
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   166
									[exBegin]
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   167
	|s hook pageNr|
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   168
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   169
	s := Printer new.
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   170
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   171
	pageNr := 0.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   172
	hook := [ 
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   173
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   174
		    pageNr := pageNr + 1.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   175
		    s placeString:('page ' , pageNr printString) at:(5500 @ 400).
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   176
		    s placeString:('Document revision:') at:(900 @ 1200).
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   177
		    s placeString:('Revieved by:')       at:(900 @ 900).
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   178
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   179
		    s setNative:true.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   180
		    s nextPutAll:'0 setlinewidth'; cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   181
		    s nextPutAll:'800 800 moveto'; cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   182
		    s nextPutAll:'11000 800 lineto'; cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   183
		    s nextPutAll:'11000 15500 lineto'; cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   184
		    s nextPutAll:'800 15500 lineto'; cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   185
		    s nextPutAll:'800 800 lineto'; cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   186
		    s nextPutAll:'stroke'; cr.
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   187
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   188
		    s nextPutAll:'800 1100 moveto'; cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   189
		    s nextPutAll:'11000 1100 lineto'; cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   190
		    s nextPutAll:'stroke'; cr.
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   191
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   192
		    s nextPutAll:'800 1400 moveto'; cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   193
		    s nextPutAll:'11000 1400 lineto'; cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   194
		    s nextPutAll:'stroke'; cr.
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   195
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   196
		    s setNative:false.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   197
		].
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   198
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   199
	s pageEndAction:hook.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   200
	(1 to:200) do:[:lineNr |
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   201
	    s nextPutAll:'line ' , lineNr printString.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   202
	    s cr.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   203
	].
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   204
	s close.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   205
									[exEnd]
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   206
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   207
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   208
    If you already have a postscript string at hand, this can be sent to
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   209
    the printer in native mode:
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   210
									[exBegin]
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   211
	|s|
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   212
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   213
	s := Printer newNative.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   214
	s nextPutAll:<your postscript string>.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   215
									[exEnd]
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   216
	s close
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   217
179
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 170
diff changeset
   218
    To output graphics, you need the PSGraphicsContext (and friend-) classes.
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 170
diff changeset
   219
    These provide protocol similar to the one provided by display graphicContexts.
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   220
    Notice, that these postscript classes are derived from public domain code;
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   221
    there is no warranty.
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   222
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   223
    Usage:
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   224
									[exBegin]
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   225
	|drawable s|
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   226
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   227
	s := Printer newNative.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   228
	drawable := PSGraphicsContext on:s.
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   229
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   230
	drawable displayLineFrom:(0@0) to:(100@100).
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   231
	drawable displayLineFrom:(100@0) to:(0@100).
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   232
	drawable displayCircle:(150@150) radius:50.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   233
	(Image fromFile:'bitmaps/SBrowser.xbm') displayOn:drawable at:(50@30).
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   234
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   235
	drawable close.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   236
									[exEnd]
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   237
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   238
      the same in a view:
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   239
									[exBegin]
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   240
	|drawable|
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   241
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   242
	drawable := (View extent:200@200) openAndWait.
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   243
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   244
	drawable displayLineFrom:(0@0) to:(100@100).
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   245
	drawable displayLineFrom:(100@0) to:(0@100).
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   246
	drawable displayCircle:(150@150) radius:50.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   247
	(Image fromFile:'bitmaps/SBrowser.xbm') displayOn:drawable at:(50@30).
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   248
									[exEnd]
6
claus
parents: 4
diff changeset
   249
"
claus
parents: 4
diff changeset
   250
! !
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   251
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   252
!PostscriptPrinterStream class methodsFor:'initialization'!
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   253
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   254
initCharacterSize
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   255
    "setup the character parameters"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   256
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   257
    FontHeight := 200.   "/ used to scale fonts - corresponds to a 10 point font size
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   258
    FontWidth := 120.    "/ used to compute width of tabs
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   259
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   260
    "Created: 23.4.1996 / 19:53:34 / cg"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   261
    "Modified: 23.4.1996 / 20:05:17 / cg"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   262
    "Modified: 30.5.1996 / 17:24:05 / ca"
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   263
!
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   264
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   265
initFonts
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   266
    "setup the font names.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   267
     initProlog uses those parameters."
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   268
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   269
    Italic := 0.     "/ offset from base-font# to italic version
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   270
    Bold := 1.       "/ offset from base-font# to bold version
349
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   271
    BoldItalic := 2. "/ offset from base-font# to boldItalic version
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   272
    Normal := 3.     "/ offset from base-font# to normal version
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   273
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   274
    Helvetica := 0.  "/ # of helvetica base font
349
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   275
    Times := 4.      "/ # of times base font
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   276
    Courier := 8.    "/ # of courier base font
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   277
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   278
    FontNames := #( 
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   279
		    '/Helvetica-Oblique'
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   280
		    '/Helvetica-Bold'
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   281
		    '/Helvetica-BoldOblique'
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   282
		    '/Helvetica'
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   283
		    '/Times-Italic'
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   284
		    '/Times-Bold'
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   285
		    '/Times-BoldItalic'
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   286
		    '/Times'
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   287
		    '/Courier-Oblique'
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   288
		    '/Courier-Bold'
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   289
		    '/Courier-BoldOblique'
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   290
		    '/Courier' 
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   291
		  )
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   292
349
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   293
    "Modified: 18.5.1996 / 09:37:48 / cg"
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   294
!
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   295
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   296
initPage
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   297
    "setup the page parameters.
370
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   298
     All coordinates are scaled by 20 w.r.t the PS coordinates (i.e. in twips)."
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   299
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   300
    PageFormat isNil ifTrue:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   301
	PageFormat := #letter
370
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   302
    ].
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   303
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   304
    TopInset isNil ifTrue:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   305
	TopInset := 0.6.      "/ inches
370
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   306
    ].
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   307
    BottomInset isNil ifTrue:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   308
	BottomInset := 1.2    "/ inches
370
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   309
    ].
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   310
    LeftInset isNil ifTrue:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   311
	LeftInset := 0.6.     "/ inches
370
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   312
    ].
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   313
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   314
    "/     +-----------------------------------------------+  PageHeight
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   315
    "/     |                                               |
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   316
    "/     | LeftX +---------------------------------------|  TopY
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   317
    "/     |       |1st printed line                       |
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   318
    "/     |       |                                       |
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   319
    "/     |       |                                       |
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   320
    "/     |       |                                       |
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   321
    "/     |       |                                       |
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   322
    "/     |       |last line (linesPerPage)               |
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   323
    "/     |       +---------------------------------------|
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   324
    "/     |                                               |
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   325
    "/     (0/0)-------------------------------------------+  0
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   326
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   327
    LeftX := (UnitConverter convert:LeftInset from:#inch to:#twip) rounded.
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   328
370
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   329
    PhysicalPageHeight := (UnitConverter convert:1 from:(PageFormat , 'H') to:#twip) rounded.
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   330
    Landscape ifTrue:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   331
	PageHeight := (UnitConverter convert:1 from:(PageFormat , 'lH') to:#twip) rounded.
370
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   332
    ] ifFalse:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   333
	PageHeight := (UnitConverter convert:1 from:(PageFormat , 'H') to:#twip) rounded.
370
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   334
    ].
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   335
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   336
    TopY := PageHeight - (UnitConverter convert:TopInset from:#inch to:#twip) rounded.
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   337
    LinesPerPage := TopY - (UnitConverter convert:BottomInset from:#inch to:#twip) rounded // 200.
370
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   338
386
cebdfb2e9cf0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 382
diff changeset
   339
    "
cebdfb2e9cf0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 382
diff changeset
   340
     TopInset := LeftInset := BottomInset := nil.
cebdfb2e9cf0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 382
diff changeset
   341
     self initPage
cebdfb2e9cf0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 382
diff changeset
   342
    "
cebdfb2e9cf0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 382
diff changeset
   343
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   344
    "Modified: 30.5.1996 / 17:24:55 / ca"
386
cebdfb2e9cf0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 382
diff changeset
   345
    "Modified: 4.6.1996 / 17:18:25 / cg"
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   346
!
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   347
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   348
initPageProlog
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   349
    "define the page prolog"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   350
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   351
    PageProlog :=
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   352
'StartPage
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   353
'.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   354
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   355
    "Created: 23.4.1996 / 19:56:16 / cg"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   356
!
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   357
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   358
initPageTrailer
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   359
    "define the page epilog"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   360
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   361
    PageTrailer :=
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   362
'EndPage
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   363
'.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   364
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   365
    "Modified: 23.4.1996 / 19:55:50 / cg"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   366
    "Created: 23.4.1996 / 19:56:30 / cg"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   367
!
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   368
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   369
initProlog
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   370
    "define the documents prolog"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   371
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   372
    |tmpString t fontNr|
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   373
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   374
    tmpString :=
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   375
'%!!PS-Adobe-1.0
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   376
%%Creator: Smalltalk/X
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   377
%%DocumentFonts: Courier-Oblique Courier-Bold Courier Times-Italic Times-Bold Times
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   378
save/SmalltalkJob exch def
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   379
/OriginalState gstate def
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   380
/StartSmalltalkDoc{$smalltalk begin}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   381
/$smalltalk 50 dict def $smalltalk begin
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   382
/EndSmalltalkDoc{end}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   383
/S/show load def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   384
/X{exch 0 rmoveto S}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   385
/Y{exch 0 exch rmoveto S}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   386
/B{3 1 roll moveto S}def
382
113b013200d3 implement underline
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   387
/SUL {gsave currentpoint currentfont /FontInfo get /UnderlinePosition get
113b013200d3 implement underline
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   388
 0 exch currentfont /FontMatrix get dtransform exch pop add newpath moveto
113b013200d3 implement underline
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   389
 dup stringwidth rlineto stroke grestore S} def
113b013200d3 implement underline
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   390
/BUL{3 1 roll moveto SUL}def
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   391
/F{$fd exch get setfont}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   392
/StartPage{/svpg save def .05 dup scale}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   393
/EndPage{svpg restore showpage}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   394
/DoPreFeed{/statusdict where{pop
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   395
 statusdict/prefeed known{statusdict exch/prefeed exch put 0}if}if pop}def
373
6834d6a61ea9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   396
/Landscape{90 rotate 0 -' , PageHeight printString "15840", ' translate}def
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   397
/ISOrecode {findfont dup length dict begin
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   398
 {1 index /FID ne {def} {pop pop} ifelse} forall
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   399
 /Encoding ISOLatin1Encoding def
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   400
 currentdict end definefont pop} def
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   401
/SetUpFonts
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   402
 {dup/$fd exch array def{findfont exch scalefont $fd 3 1 roll put}repeat}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   403
/InitGaudy{/TwoColumn exch def /BarLength exch def
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   404
/ftD /ISO-Times-Bold findfont 12 UP scalefont def
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   405
/ftF /ISO-Times-Roman findfont 14 UP scalefont def
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   406
/ftP /ISO-Helvetica-Bold findfont 30 UP scalefont def}def
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   407
/U{1440 mul}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   408
/UP{U 72 div}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   409
/LB{/pts exch UP def /charcolor exch def /boxcolor exch def /font exch def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   410
 /label exch def /dy exch def /dx exch def /lly exch def /llx exch def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   411
 gsave boxcolor setgray
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   412
 llx lly moveto dx 0 rlineto 0 dy rlineto dx neg 0 rlineto closepath fill
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   413
 /lines label length def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   414
 /yp lly dy add dy lines pts mul sub 2 div sub pts .85 mul sub def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   415
 font setfont charcolor setgray
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   416
 label {dup stringwidth pop 2 div llx dx 2 div add exch sub yp moveto show
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   417
   /yp yp pts sub def}forall grestore}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   418
/Gaudy{/Page exch def /Date exch def /File exch def /Comment exch def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   419
 .25 U 10.2 U BarLength .1 sub U .25 U [File] ftF .97 0 14 LB
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   420
 .25 U 10.45 U BarLength .1 sub U .25 U [Comment] ftF 1 0 14 LB
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   421
 .25 U 10.2 U 1 U .5 U Date ftD .7 0 12 LB
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   422
 BarLength .75 sub U 10.2 U 1 U .5 U [Page] ftP .7 1 30 LB
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   423
 TwoColumn{BarLength 2 div .19 add U 10.2 U moveto 0 -10 U rlineto stroke}if
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   424
}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   425
end
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   426
StartSmalltalkDoc 
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   427
% end of fixed prolog
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   428
'.
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   429
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   430
    t := ''.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   431
    FontNames do:[:aName |
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   432
	t := t , '/ISO-' , aName , ' ' , aName , ' ISOrecode
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   433
'.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   434
    ].
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   435
    t := t , '
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   436
'.
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   437
    tmpString := tmpString , t.
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   438
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   439
    t := ''.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   440
    fontNr := 0.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   441
    FontNames do:[:aName |
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   442
	t := t , (fontNr printString) , ' ' 
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   443
	       , (FontHeight printString) , ' '
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   444
	       , aName , (Character nl) asString.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   445
	fontNr := fontNr + 1
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   446
    ].
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   447
    tmpString := tmpString , t.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   448
    tmpString := tmpString , fontNr printString , ' SetUpFonts
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   449
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   450
% end of prolog
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   451
'.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   452
    Prolog := tmpString.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   453
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   454
    "
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   455
     PostscriptPrinterStream initProlog
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   456
    "
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   457
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   458
    "Created: 23.4.1996 / 19:40:44 / cg"
382
113b013200d3 implement underline
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   459
    "Modified: 3.6.1996 / 16:54:33 / cg"
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   460
!
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   461
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   462
initTrailer
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   463
    "define the documents epilog"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   464
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   465
	Trailer :=
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   466
'EndSmalltalkDoc
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   467
SmalltalkJob restore
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   468
'
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   469
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   470
    "Created: 23.4.1996 / 19:55:24 / cg"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   471
    "Modified: 23.4.1996 / 19:55:38 / cg"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   472
!
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   473
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   474
initialize
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   475
    Normal isNil ifTrue:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   476
	self initFonts.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   477
	self initPage.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   478
	self initCharacterSize.
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   479
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   480
	self initProlog.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   481
	self initTrailer.
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   482
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   483
	self initPageProlog.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   484
	self initPageTrailer
170
7194ef17f5b8 only init once
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   485
    ]
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   486
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   487
    "
349
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   488
     Normal := nil.
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   489
     self initialize
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   490
    "
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   491
349
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   492
    "Modified: 18.5.1996 / 09:46:15 / cg"
370
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   493
!
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   494
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   495
reInitPage
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   496
    self initPage.
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   497
    self initProlog.
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   498
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   499
    "Created: 31.5.1996 / 23:35:18 / cg"
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   500
! !
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   501
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   502
!PostscriptPrinterStream class methodsFor:'accessing - defaults'!
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   503
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   504
bottomInset
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   505
    "return the bottom margin (in inches)"
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   506
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   507
    ^ BottomInset
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   508
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   509
    "Created: 1.6.1996 / 13:07:43 / cg"
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   510
    "Modified: 3.6.1996 / 10:44:44 / cg"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   511
!
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   512
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   513
bottomInset:inches
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   514
    "set the bottom margin (in inches)"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   515
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   516
    BottomInset := inches.
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   517
    self reInitPage.
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   518
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   519
    "Created: 3.6.1996 / 10:46:25 / cg"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   520
    "Modified: 3.6.1996 / 10:47:16 / cg"
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   521
!
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   522
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   523
leftInset
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   524
    "return the left margin (in inches)"
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   525
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   526
    ^ LeftInset
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   527
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   528
    "Created: 1.6.1996 / 13:07:12 / cg"
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   529
    "Modified: 3.6.1996 / 10:45:11 / cg"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   530
!
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   531
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   532
leftInset:inches
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   533
    "set the left margin (in inches)"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   534
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   535
    LeftInset := inches.
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   536
    self reInitPage.
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   537
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   538
    "Created: 3.6.1996 / 10:46:33 / cg"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   539
    "Modified: 3.6.1996 / 10:47:21 / cg"
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   540
!
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   541
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   542
topInset
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   543
    "return the top margin (in inches)"
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   544
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   545
    ^ TopInset
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   546
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   547
    "Created: 1.6.1996 / 13:07:20 / cg"
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   548
    "Modified: 3.6.1996 / 10:45:17 / cg"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   549
!
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   550
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   551
topInset:inches
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   552
    "set the top margin (in inches)"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   553
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   554
    TopInset := inches.
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   555
    self reInitPage.
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   556
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   557
    "Created: 3.6.1996 / 10:46:41 / cg"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   558
    "Modified: 3.6.1996 / 10:47:26 / cg"
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   559
! !
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   560
186
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   561
!PostscriptPrinterStream class methodsFor:'queries'!
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   562
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   563
printerTypeName
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   564
    "return a descriptive name"
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   565
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   566
    ^ 'postscript printer'
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   567
!
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   568
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   569
supportsMargins
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   570
    "return true if this printer supports margins"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   571
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   572
    ^ true
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   573
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   574
    "Created: 3.6.1996 / 10:48:04 / cg"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   575
!
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   576
368
423cf3f4e522 added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
   577
supportsPageSizes
423cf3f4e522 added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
   578
    "return true if this printer supports different page sizes"
423cf3f4e522 added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
   579
423cf3f4e522 added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
   580
    ^ true
423cf3f4e522 added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
   581
423cf3f4e522 added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
   582
    "Created: 31.5.1996 / 22:35:39 / cg"
423cf3f4e522 added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
   583
!
423cf3f4e522 added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
   584
186
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   585
supportsPostscript
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   586
    "return true if this is a postscript printer"
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   587
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   588
    ^ true
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   589
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   590
    "Created: 10.2.1996 / 16:23:23 / cg"
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   591
! !
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   592
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   593
!PostscriptPrinterStream methodsFor:'access writing'!
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   594
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   595
cr
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   596
    "send line termination"
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   597
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   598
    self flushLine.
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   599
    native == true ifTrue:[^ super cr].
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   600
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   601
    xPos := LeftX.
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   602
    colNr := 0.
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   603
    yPos := yPos - FontHeight.
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   604
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   605
    lineNr := lineNr + 1.
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   606
    lineNr > LinesPerPage ifTrue:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   607
	self nextPage
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   608
    ]
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   609
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   610
    "Modified: 1.6.1996 / 13:09:30 / cg"
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   611
!
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   612
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   613
nextPut:aCharacter
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   614
    |code|
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   615
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   616
    (aCharacter == Character cr) ifTrue:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   617
	^ self cr
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   618
    ].
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   619
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   620
    native == true ifTrue:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   621
	self flushLine.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   622
	^ super nextPut:aCharacter
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   623
    ].
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   624
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   625
    (aCharacter == $( ) ifTrue:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   626
	lineBuffer := lineBuffer , '\(' .
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   627
	^ self
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   628
    ].
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   629
    (aCharacter == $) ) ifTrue:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   630
	lineBuffer := lineBuffer , '\)' .
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   631
	^ self
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   632
    ].
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   633
    (aCharacter == $\ ) ifTrue:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   634
	lineBuffer := lineBuffer , '\\' .
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   635
	^ self
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   636
    ].
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   637
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   638
    (aCharacter == Character tab ) ifTrue:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   639
	self flushLine.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   640
	colNr := ((colNr + 8) // 8) * 8. 
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   641
	xPos := LeftX + (colNr * FontWidth).
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   642
	^ self
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   643
    ].
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   644
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   645
    (code := aCharacter asciiValue) > 16r7F ifTrue:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   646
	lineBuffer := lineBuffer , '\' , (code printStringRadix:8)
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   647
    ] ifFalse:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   648
	lineBuffer := lineBuffer copyWith:aCharacter
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   649
    ].
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   650
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   651
    "Modified: 23.4.1996 / 20:05:59 / cg"
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   652
! !
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   653
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   654
!PostscriptPrinterStream methodsFor:'accessing'!
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   655
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   656
pageEndAction:something
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   657
    "set pageEndAction - if non-nil, that will be called before
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   658
     and EndPage is emmitted. 
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   659
     An example use is a private block,
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   660
     which draws a company frame around the page ..."
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   661
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   662
    pageEndAction := something.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   663
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   664
    "Modified: 30.5.1996 / 16:45:09 / ca"
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   665
!
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   666
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   667
pageStartAction:something
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   668
    "set pageStartAction - if nonNil, that is evaluated prior to every page."
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   669
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   670
    pageStartAction := something.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   671
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   672
    "Modified: 30.5.1996 / 16:44:20 / ca"
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   673
! !
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   674
348
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   675
!PostscriptPrinterStream methodsFor:'emphasis change'!
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   676
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   677
bold
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   678
    "further printing is in bold"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   679
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   680
    (fStyle ~~ Bold) ifTrue:[
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   681
	self flushLine.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   682
	fStyle := Bold.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   683
	self setFont.
382
113b013200d3 implement underline
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   684
    ].
348
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   685
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   686
    "Modified: 8.6.1996 / 08:17:15 / cg"
348
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   687
!
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   688
349
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   689
boldItalic
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   690
    "further printing is in boldItalic"
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   691
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   692
    (fStyle ~~ BoldItalic) ifTrue:[
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   693
	self flushLine.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   694
	fStyle := BoldItalic.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   695
	self setFont.
382
113b013200d3 implement underline
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   696
    ].
349
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   697
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   698
    "Created: 18.5.1996 / 09:36:36 / cg"
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   699
    "Modified: 8.6.1996 / 08:17:21 / cg"
349
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   700
!
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   701
348
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   702
italic
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   703
    "further printing is in italic"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   704
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   705
    (fStyle ~~ Italic) ifTrue:[
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   706
	self flushLine.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   707
	fStyle := Italic.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   708
	self setFont.
382
113b013200d3 implement underline
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   709
    ].
348
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   710
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   711
    "Modified: 8.6.1996 / 08:17:28 / cg"
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   712
!
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   713
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   714
noUnderline
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   715
    "further printing is not underlined"
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   716
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   717
    underline ifTrue:[
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   718
	self flushLine.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   719
	underline := false
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   720
    ]
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   721
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   722
    "Created: 8.6.1996 / 08:11:07 / cg"
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   723
    "Modified: 8.6.1996 / 08:15:56 / cg"
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   724
!
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   725
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   726
noStrikeout
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   727
    "further printing is not strikedout"
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   728
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   729
    strikeout ifTrue:[
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   730
	self flushLine.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   731
	strikeout := false
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   732
    ]
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   733
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   734
    "Modified: 8.6.1996 / 08:15:56 / cg"
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   735
    "Created: 8.6.1996 / 08:16:35 / cg"
348
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   736
!
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   737
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   738
normal
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   739
    "further printing is in normal style (i.e. non-bold/non-italic)"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   740
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   741
    (fStyle ~~ Normal) ifTrue:[
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   742
	self flushLine.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   743
	fStyle := Normal.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   744
	self setFont.
380
fa5adc326473 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
   745
    ].
348
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   746
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   747
    "Modified: 8.6.1996 / 08:17:34 / cg"
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   748
!
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   749
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   750
strikeout
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   751
    "further printing is strikedout"
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   752
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   753
    strikeout ifFalse:[
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   754
	self flushLine.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   755
	strikeout := true
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   756
    ]
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   757
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   758
    "Modified: 8.6.1996 / 08:10:49 / cg"
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   759
    "Created: 8.6.1996 / 08:16:18 / cg"
382
113b013200d3 implement underline
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   760
!
113b013200d3 implement underline
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   761
113b013200d3 implement underline
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   762
underline
113b013200d3 implement underline
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   763
    "further printing is underlined"
113b013200d3 implement underline
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   764
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   765
    underline ifFalse:[
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   766
	self flushLine.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   767
	underline := true
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   768
    ]
382
113b013200d3 implement underline
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   769
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   770
    "Modified: 8.6.1996 / 08:16:05 / cg"
348
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   771
! !
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   772
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   773
!PostscriptPrinterStream methodsFor:'font change'!
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   774
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   775
courier
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   776
    "further printing is in the courier font"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   777
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   778
    self flushLine.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   779
    fFamily := Courier.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   780
    self setFont
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   781
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   782
    "Modified: 10.4.1996 / 13:34:49 / cg"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   783
!
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   784
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   785
helvetica
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   786
    "further printing is in the helvetica font"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   787
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   788
    self flushLine.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   789
    fFamily := Helvetica.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   790
    self setFont
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   791
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   792
    "Modified: 10.4.1996 / 13:34:58 / cg"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   793
!
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   794
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   795
times
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   796
    "further printing is in the times font"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   797
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   798
    self flushLine.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   799
    fFamily := Times.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   800
    self setFont
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   801
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   802
    "Modified: 10.4.1996 / 13:36:07 / cg"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   803
! !
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   804
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   805
!PostscriptPrinterStream methodsFor:'open/close'!
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   806
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   807
endPrint
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   808
    "finish a document - finish page; then send documentTrailer.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   809
     Send nothing if nativePrinting."
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   810
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   811
    native == true ifFalse:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   812
	self endPage.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   813
	super nextPutAllUntranslated:Trailer.
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   814
    ].
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   815
    super endPrint
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   816
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   817
    "Modified: 23.4.1996 / 20:03:26 / cg"
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   818
!
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   819
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   820
startPrint
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   821
    "start a document - send documentProlog & start a page.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   822
     Send nothing if nativePrinting."
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   823
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   824
    fFamily := Courier.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   825
    fStyle := Normal.
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   826
    underline := false.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   827
    strikeout := false.
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   828
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   829
    native == true ifFalse:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   830
	Prolog isNil ifTrue:[
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   831
	    self class initialize
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   832
	].
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   833
	super writingTo:(self class printCommand).
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   834
	super nextPutAllUntranslated:Prolog.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   835
	self startPage
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   836
    ]
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   837
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   838
    "Modified: 8.6.1996 / 08:16:50 / cg"
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   839
! !
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   840
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   841
!PostscriptPrinterStream methodsFor:'private'!
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   842
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   843
endPage
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   844
    "end a page - flush buffered text & send pageTrailer"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   845
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   846
    self flushLine.
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   847
    pageEndAction notNil ifTrue:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   848
	pageEndAction value
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   849
    ].
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   850
    super nextPutAllUntranslated:PageTrailer
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   851
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   852
    "Modified: 23.4.1996 / 20:00:01 / cg"
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   853
!
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   854
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   855
flushLine
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   856
    "flush buffered line text"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   857
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   858
    (lineBuffer size > 0) ifTrue:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   859
	colNr == 0 ifTrue:[
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   860
	    super nextPutAllUntranslated:(xPos printString ).
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   861
	    super nextPutAllUntranslated:' '.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   862
	    super nextPutAllUntranslated:(yPos printString).
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   863
	].
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   864
	super nextPutAllUntranslated:'('.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   865
	super nextPutAllUntranslated:lineBuffer.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   866
	super nextPutAllUntranslated:')B'.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   867
	underline == true ifTrue:[
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   868
	    super nextPutAllUntranslated:'UL'.
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   869
	].
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   870
	super nextPutUntranslated:(Character cr).
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   871
	xPos := xPos + (FontWidth * lineBuffer size).
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   872
	colNr := colNr + lineBuffer size
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   873
    ].
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   874
    lineBuffer := ''
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   875
382
113b013200d3 implement underline
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   876
    "Modified: 3.6.1996 / 17:04:18 / cg"
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   877
!
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   878
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   879
nextPage
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   880
    "new page - finish previous page & start enew.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   881
     Should not be sent when nativePrinting."
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   882
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   883
    self endPage.
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   884
    self startPage
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   885
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   886
    "Modified: 23.4.1996 / 20:04:07 / cg"
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   887
!
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   888
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   889
placeString:aString at:pos
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   890
    "special entry: place a string at some particular position in my ps-coordinate
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   891
     system. Can be used with endPageActions to place a page-number."
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   892
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   893
    self flushLine.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   894
    super nextPutAllUntranslated:(pos x printString ).
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   895
    super nextPutAllUntranslated:' '.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   896
    super nextPutAllUntranslated:(pos y printString).
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   897
    super nextPutAllUntranslated:'('.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   898
    super nextPutAllUntranslated:aString.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   899
    super nextPutAllUntranslated:')B'.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   900
    super nextPutUntranslated:(Character cr).
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   901
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   902
    "Created: 30.5.1996 / 17:06:36 / ca"
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   903
!
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   904
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   905
setFont
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   906
    "change the font. 
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   907
     Uses current fFamily and fStyle (which give the fonts nr)"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   908
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   909
    |fontNumber|
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   910
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   911
    fontNumber := fFamily + fStyle.
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   912
    super nextPutAllUntranslated:fontNumber printString.
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   913
    super nextPutAllUntranslated:' F'. 
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   914
    super nextPutUntranslated:(Character cr)
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   915
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   916
    "Modified: 23.4.1996 / 20:01:28 / cg"
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   917
!
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   918
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   919
startPage
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   920
    "start a page - send pageProlog, reset x/y position and line/col."
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   921
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   922
    pageStartAction notNil ifTrue:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   923
	pageStartAction value
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   924
    ].
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   925
    super nextPutAllUntranslated:PageProlog.
373
6834d6a61ea9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   926
    self class landscape ifTrue:[
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
   927
	super nextPutAllUntranslated:'Landscape
373
6834d6a61ea9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   928
'.
6834d6a61ea9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   929
    ].
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   930
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   931
    self setFont.
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   932
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   933
    yPos := TopY.
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   934
    xPos := LeftX.
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   935
    lineBuffer := ''.
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   936
    lineNr := 1.
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   937
    colNr := 0
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   938
373
6834d6a61ea9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   939
    "Modified: 1.6.1996 / 00:44:10 / cg"
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   940
! !
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   941
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   942
!PostscriptPrinterStream methodsFor:'queries'!
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   943
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   944
fontHeight
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   945
    "the used fonts height in my postscript coordinate system 
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   946
     (i.e. in twips, which is 1/20th of a point)"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   947
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   948
    ^ FontHeight
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   949
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   950
    "Modified: 30.5.1996 / 16:47:37 / ca"
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   951
    "Modified: 1.6.1996 / 13:14:51 / cg"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   952
!
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   953
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   954
leftX
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   955
    "the left x startPosition (i.e. leftMargin) in my postscript coordinate system.
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   956
     (i.e. in twips, which is 1/20th of a point)"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   957
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   958
    ^ LeftX
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   959
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   960
    "Modified: 30.5.1996 / 16:48:56 / ca"
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   961
    "Modified: 1.6.1996 / 13:14:59 / cg"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   962
!
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   963
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   964
linesPerPage
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   965
    "the number of lines per page"
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   966
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   967
    ^ LinesPerPage
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   968
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   969
    "Modified: 30.5.1996 / 16:48:20 / ca"
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   970
!
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   971
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   972
overAllPageSize
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   973
    "the overAll pageSize in my postscript coordinate system.
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   974
     (i.e. in twips, which is 1/20th of a point)"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   975
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   976
    ^ PageHeight
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   977
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   978
    "Created: 30.5.1996 / 16:56:51 / ca"
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   979
    "Modified: 30.5.1996 / 16:58:01 / ca"
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   980
    "Modified: 1.6.1996 / 13:15:06 / cg"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   981
!
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   982
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   983
topMargin
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   984
    "return the topMargin in my postscript coordinate system.
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   985
     (i.e. in twips, which is 1/20th of a point)"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   986
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   987
    ^ PageHeight - TopY
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   988
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   989
    "Modified: 30.5.1996 / 16:58:01 / ca"
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   990
    "Created: 30.5.1996 / 17:02:02 / ca"
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   991
    "Modified: 1.6.1996 / 13:15:50 / cg"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   992
!
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   993
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   994
topY
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   995
    "the top y startPosition (i.e. page-size - topMargin) in my own coordinate system
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   996
     (i.e. in twips, which is 1/20th of a point)"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   997
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   998
    ^ TopY
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   999
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
  1000
    "Modified: 30.5.1996 / 16:48:48 / ca"
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
  1001
    "Modified: 1.6.1996 / 13:15:23 / cg"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
  1002
! !
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
  1003
186
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
  1004
!PostscriptPrinterStream class methodsFor:'documentation'!
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
  1005
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
  1006
version
390
3f22865fa873 fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
  1007
    ^ '$Header: /cvs/stx/stx/libbasic2/PostscriptPrinterStream.st,v 1.38 1996-06-08 09:10:00 cg Exp $'
186
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
  1008
! !
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1009
PostscriptPrinterStream initialize!