0
|
1 |
"
|
6
|
2 |
COPYRIGHT (c) 1992 by Claus Gittinger
|
0
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
Object subclass:#Font
|
|
14 |
instanceVariableNames:'family face style size encoding
|
|
15 |
device fontId replacementFont
|
|
16 |
ascent descent height width isFixedWidth
|
2
|
17 |
minWidth maxWidth'
|
23
|
18 |
classVariableNames:'Lobby Replacements'
|
0
|
19 |
poolDictionaries:''
|
|
20 |
category:'Graphics-Support'
|
|
21 |
!
|
|
22 |
|
|
23 |
Font comment:'
|
|
24 |
|
6
|
25 |
COPYRIGHT (c) 1992 by Claus Gittinger
|
0
|
26 |
All Rights Reserved
|
|
27 |
|
|
28 |
see Font class documentation for more info
|
|
29 |
|
23
|
30 |
$Header: /cvs/stx/stx/libview/Font.st,v 1.6 1994-01-08 17:12:58 claus Exp $
|
0
|
31 |
|
|
32 |
total rewrite from XFont summer 92 by claus
|
|
33 |
'!
|
|
34 |
|
|
35 |
!Font class methodsFor:'documentation'!
|
|
36 |
|
|
37 |
documentation
|
|
38 |
"
|
|
39 |
Font represents fonts in a device independent manner; after beeing
|
|
40 |
created using 'Font family:family face:face style:style size:size',
|
|
41 |
the returned font is not associated to a specific device.
|
|
42 |
|
|
43 |
To get a device font, any font can be sent the message
|
|
44 |
'aFont on:aDevice' which returns an instance of Font which is
|
|
45 |
associated to a device (it returns the receiver, if that is already
|
12
|
46 |
associated to that device).
|
0
|
47 |
|
|
48 |
For proper operation, each graphics operation working with fonts
|
|
49 |
must get a device font before doing the draw.
|
12
|
50 |
Most draw methods in DeviceDrawable do that automatically for you,
|
|
51 |
before doing the draw.
|
0
|
52 |
|
|
53 |
Sometimes, a font cannot be represented on a device, then a replacement
|
|
54 |
font is chosen and kept in the replacementFont instance variable.
|
|
55 |
|
|
56 |
Instance variables:
|
|
57 |
|
2
|
58 |
family <String> the fonts family ('courier', 'helvetica' etc)
|
|
59 |
face <String> the fonts face ('bold', 'medium' etc)
|
|
60 |
style <String> the fonts style ('roman', 'italic', 'oblique')
|
|
61 |
size <String> the fonts size (not in pixels)
|
|
62 |
encoding <Symbol> the fonts encoding (usually #iso8859)
|
0
|
63 |
|
2
|
64 |
device <Object> the device the font is associated to, or nil
|
|
65 |
fontId <Object> the id of the font on that device, or nil
|
|
66 |
replacement <Font> the replacement font or nil
|
0
|
67 |
|
2
|
68 |
ascent <Integer> the fonts ascent in device units on device
|
|
69 |
descent <Integer> the fonts descent in device units on device
|
|
70 |
height <Integer> the fonts height in device units on device
|
|
71 |
width <Integer> the character width in device units on device
|
|
72 |
(for variable fonts, its the width of a space)
|
|
73 |
isFixedWidth <Boolean> true if font is a fixed width font
|
|
74 |
minWidth <Integer> width of the smallest-width character in
|
|
75 |
in device units on device
|
|
76 |
maxWidth <Integer> width of the largest-width character in
|
|
77 |
in device units on device
|
0
|
78 |
|
|
79 |
class variables:
|
|
80 |
|
23
|
81 |
Lobby <Registry> keeps track of all known fonts
|
0
|
82 |
|
2
|
83 |
Replacements <Dictionary> replacement fonts
|
0
|
84 |
"
|
|
85 |
! !
|
|
86 |
|
|
87 |
!Font class methodsFor:'initialization'!
|
|
88 |
|
|
89 |
initialize
|
|
90 |
"initialize the font tracking array"
|
|
91 |
|
23
|
92 |
Lobby isNil ifTrue:[
|
|
93 |
Lobby := Registry new.
|
0
|
94 |
|
|
95 |
"want to be informed when returning from snapshot"
|
|
96 |
ObjectMemory addDependent:self.
|
|
97 |
|
2
|
98 |
Replacements := Dictionary new.
|
0
|
99 |
|
2
|
100 |
Replacements at:'clean' put:'courier'.
|
|
101 |
Replacements at:'fixed' put:'courier'.
|
|
102 |
Replacements at:'new century schoolbook' put:'times'.
|
|
103 |
Replacements at:'lucida' put:'helvetica'.
|
|
104 |
Replacements at:'lucidabright' put:'helvetica'.
|
|
105 |
Replacements at:'lucidatypewriter' put:'courier'.
|
|
106 |
Replacements at:'charter' put:'times'.
|
|
107 |
Replacements at:'terminal' put:'courier'.
|
0
|
108 |
]
|
|
109 |
!
|
|
110 |
|
|
111 |
flushDeviceFonts
|
|
112 |
"unassign all fonts from their device"
|
|
113 |
|
23
|
114 |
Lobby contentsDo:[:aFont |
|
2
|
115 |
aFont restored.
|
23
|
116 |
Lobby changed:aFont
|
0
|
117 |
]
|
|
118 |
!
|
|
119 |
|
|
120 |
update:something
|
|
121 |
(something == #restarted) ifTrue:[
|
|
122 |
self flushDeviceFonts
|
|
123 |
]
|
|
124 |
! !
|
|
125 |
|
|
126 |
!Font class methodsFor:'instance creation'!
|
|
127 |
|
|
128 |
family:familyString face:faceString style:styleString size:sizeNum
|
|
129 |
"returns a font for given family, face, style and size.
|
12
|
130 |
The returned font is not associated to a specific device"
|
0
|
131 |
|
12
|
132 |
^ self family:familyString
|
23
|
133 |
face:faceString
|
|
134 |
style:styleString
|
|
135 |
size:sizeNum
|
|
136 |
encoding:#iso8859
|
0
|
137 |
!
|
|
138 |
|
|
139 |
family:familyString face:faceString style:styleString size:sizeNum encoding:encodingSym
|
|
140 |
"returns a font for given family, face, style, size and encoding.
|
|
141 |
The returned font is not associated to s specific device"
|
|
142 |
|
|
143 |
|family "<String>"
|
|
144 |
newFont "<Font>" |
|
|
145 |
|
|
146 |
(familyString at:1) isUppercase ifTrue:[
|
|
147 |
family := familyString asLowercase
|
|
148 |
] ifFalse:[
|
|
149 |
family := familyString
|
|
150 |
].
|
|
151 |
|
|
152 |
"look if this font is already known"
|
|
153 |
|
23
|
154 |
Lobby contentsDo:[:aFont |
|
0
|
155 |
(aFont family = family) ifTrue:[
|
|
156 |
(aFont face = faceString) ifTrue:[
|
|
157 |
(aFont style = styleString) ifTrue:[
|
|
158 |
(aFont size == sizeNum) ifTrue:[
|
|
159 |
(encodingSym isNil or:[aFont encoding == encodingSym]) ifTrue:[
|
|
160 |
^ aFont
|
|
161 |
]
|
|
162 |
]
|
|
163 |
]
|
|
164 |
]
|
|
165 |
]
|
|
166 |
].
|
12
|
167 |
newFont := self basicNew setFamily:familyString
|
23
|
168 |
face:faceString
|
12
|
169 |
style:styleString
|
23
|
170 |
size:sizeNum
|
|
171 |
encoding:encodingSym
|
|
172 |
device:nil.
|
|
173 |
Lobby register:newFont.
|
0
|
174 |
^ newFont
|
|
175 |
! !
|
|
176 |
|
|
177 |
!Font methodsFor:'instance release'!
|
|
178 |
|
|
179 |
disposed
|
|
180 |
"some Font has been collected - tell it to the x-server"
|
|
181 |
|
|
182 |
fontId notNil ifTrue:[
|
|
183 |
device releaseFont:fontId.
|
|
184 |
]
|
|
185 |
! !
|
|
186 |
|
|
187 |
!Font methodsFor:'getting a device font'!
|
|
188 |
|
|
189 |
on:aDevice
|
|
190 |
"create a new Font representing the same font as
|
|
191 |
myself on aDevice; if one already exists, return the one."
|
|
192 |
|
23
|
193 |
|newFont id rep|
|
0
|
194 |
|
|
195 |
"if I am already assigned to that device ..."
|
|
196 |
(device == aDevice) ifTrue:[^ self].
|
|
197 |
|
|
198 |
"first look if not already there"
|
23
|
199 |
Lobby contentsDo:[:aFont |
|
0
|
200 |
(aDevice == aFont device) ifTrue:[
|
|
201 |
(size == aFont size) ifTrue:[
|
|
202 |
(family = aFont family) ifTrue:[
|
|
203 |
(face = aFont face) ifTrue:[
|
|
204 |
(style = aFont style) ifTrue:[
|
|
205 |
(encoding == aFont encoding) ifTrue:[
|
|
206 |
^ aFont
|
|
207 |
]
|
|
208 |
]
|
|
209 |
]
|
|
210 |
]
|
|
211 |
]
|
|
212 |
]
|
|
213 |
].
|
|
214 |
|
|
215 |
"ask that device for the font"
|
|
216 |
id := aDevice getFontWithFamily:family face:face style:style size:size encoding:encoding.
|
|
217 |
id isNil ifTrue:[
|
|
218 |
"oops did not work - (device has no such font)"
|
|
219 |
|
2
|
220 |
rep := self replacementFontOn:aDevice.
|
|
221 |
device isNil ifTrue:[
|
|
222 |
device := aDevice.
|
|
223 |
replacementFont := rep.
|
23
|
224 |
Lobby changed:self.
|
2
|
225 |
^ self
|
|
226 |
].
|
|
227 |
newFont := (self class basicNew)
|
0
|
228 |
setFamily:family face:face style:style size:size encoding:encoding device:aDevice.
|
2
|
229 |
newFont setReplacementFont:rep.
|
23
|
230 |
Lobby register:newFont.
|
2
|
231 |
^ newFont
|
0
|
232 |
].
|
|
233 |
|
|
234 |
"receiver was not associated - do it now"
|
|
235 |
device isNil ifTrue:[
|
|
236 |
device := aDevice.
|
|
237 |
fontId := id.
|
|
238 |
|
|
239 |
self getFontInfos.
|
23
|
240 |
Lobby changed:self.
|
0
|
241 |
^ self
|
|
242 |
].
|
|
243 |
|
|
244 |
"receiver was already associated to another device - need a new font"
|
12
|
245 |
newFont := (self class basicNew) setFamily:family
|
23
|
246 |
face:face
|
|
247 |
style:style
|
|
248 |
size:size
|
|
249 |
encoding:encoding
|
|
250 |
device:aDevice.
|
0
|
251 |
newFont setFontId:id.
|
|
252 |
newFont getFontInfos.
|
23
|
253 |
Lobby register:newFont.
|
0
|
254 |
^ newFont
|
|
255 |
!
|
|
256 |
|
|
257 |
replacementFontOn:aDevice
|
12
|
258 |
"return a replacement font for the receiver - this is needed, if
|
|
259 |
an image is restored on another type of display, or one which has
|
|
260 |
a different set of fonts."
|
0
|
261 |
|
|
262 |
|id f alternative|
|
|
263 |
|
|
264 |
alternative := Replacements at:family.
|
|
265 |
alternative notNil ifTrue:[
|
12
|
266 |
id := aDevice getFontWithFamily:alternative
|
23
|
267 |
face:face
|
|
268 |
style:style
|
|
269 |
size:size
|
|
270 |
encoding:encoding.
|
2
|
271 |
id notNil ifTrue:[
|
|
272 |
('replaced ' , family , '- with ' , alternative , '-font') print.
|
|
273 |
] ifFalse:[
|
0
|
274 |
id := aDevice getDefaultFont.
|
2
|
275 |
('replaced ' , family , '- with default-font') print.
|
|
276 |
]
|
0
|
277 |
].
|
|
278 |
id isNil ifTrue:[
|
|
279 |
"oops did not work - this is a serious an error"
|
|
280 |
self error:'cannot get default font'.
|
|
281 |
^ nil
|
|
282 |
].
|
|
283 |
f := self class basicNew.
|
|
284 |
f setDevice:aDevice fontId:id.
|
|
285 |
f getFontInfos.
|
23
|
286 |
Lobby register:f.
|
0
|
287 |
^ f
|
|
288 |
! !
|
|
289 |
|
|
290 |
!Font methodsFor:'instance creation'!
|
|
291 |
|
|
292 |
bold
|
|
293 |
"return the bold font corresponding to the receiver"
|
|
294 |
|
|
295 |
^ self class family:family face:'bold' style:style size:size encoding:encoding
|
|
296 |
! !
|
|
297 |
|
|
298 |
!Font methodsFor:'private'!
|
|
299 |
|
|
300 |
setFamily:familyString face:faceString style:styleString size:sizeNum encoding:encodingSym device:aDevice
|
|
301 |
family := familyString.
|
|
302 |
face := faceString.
|
|
303 |
style := styleString.
|
|
304 |
size := sizeNum.
|
|
305 |
encoding := encodingSym.
|
|
306 |
device := aDevice
|
|
307 |
!
|
|
308 |
|
2
|
309 |
restored
|
0
|
310 |
device := nil.
|
|
311 |
fontId := nil.
|
|
312 |
replacementFont := nil
|
|
313 |
!
|
|
314 |
|
|
315 |
setReplacementFont:aFont
|
|
316 |
replacementFont := aFont
|
|
317 |
!
|
|
318 |
|
|
319 |
setDevice:aDevice
|
|
320 |
device := aDevice
|
|
321 |
!
|
|
322 |
|
|
323 |
setFontId:aFontId
|
|
324 |
fontId := aFontId
|
|
325 |
!
|
|
326 |
|
|
327 |
setDevice:aDevice fontId:aFontId
|
|
328 |
device := aDevice.
|
|
329 |
fontId := aFontId
|
|
330 |
!
|
|
331 |
|
|
332 |
getFontInfos
|
|
333 |
replacementFont isNil ifTrue:[
|
|
334 |
ascent := device ascentOf:fontId.
|
|
335 |
descent := device descentOf:fontId.
|
|
336 |
height := descent + ascent.
|
|
337 |
width := device widthOf:' ' inFont:fontId.
|
2
|
338 |
minWidth := device minWidthOfFont:fontId.
|
|
339 |
maxWidth := device maxWidthOfFont:fontId.
|
0
|
340 |
] ifFalse:[
|
|
341 |
ascent := replacementFont ascent.
|
|
342 |
descent := replacementFont descent.
|
|
343 |
height := descent + ascent.
|
|
344 |
width := replacementFont width.
|
|
345 |
minWidth := replacementFont minWidth.
|
|
346 |
maxWidth := replacementFont maxWidth.
|
|
347 |
].
|
|
348 |
isFixedWidth := minWidth == maxWidth
|
|
349 |
! !
|
|
350 |
|
|
351 |
!Font methodsFor:'comparing'!
|
|
352 |
|
|
353 |
= aFont
|
|
354 |
"two fonts are considered equal, if the font-name components are;
|
|
355 |
independent of the device, the font is on"
|
|
356 |
|
|
357 |
(aFont isKindOf:Font) ifTrue:[
|
|
358 |
(size == aFont size) ifTrue:[
|
|
359 |
(family = aFont family) ifTrue:[
|
|
360 |
(face = aFont face) ifTrue:[
|
|
361 |
(style = aFont style) ifTrue:[
|
|
362 |
(encoding == aFont encoding) ifTrue:[
|
|
363 |
^ true
|
|
364 |
]
|
|
365 |
]
|
|
366 |
]
|
|
367 |
]
|
|
368 |
]
|
|
369 |
].
|
|
370 |
^ false
|
|
371 |
! !
|
|
372 |
|
|
373 |
!Font methodsFor:'accessing'!
|
|
374 |
|
|
375 |
family
|
|
376 |
"return the family, a string"
|
|
377 |
|
|
378 |
^ family
|
|
379 |
!
|
|
380 |
|
|
381 |
face
|
|
382 |
"return the face, a string"
|
|
383 |
|
|
384 |
^ face
|
|
385 |
!
|
|
386 |
|
|
387 |
style
|
|
388 |
"return the style, a string"
|
|
389 |
|
|
390 |
^ style
|
|
391 |
!
|
|
392 |
|
|
393 |
size
|
|
394 |
"return the size, a number"
|
|
395 |
|
|
396 |
^ size
|
|
397 |
!
|
|
398 |
|
|
399 |
encoding
|
|
400 |
"return the encoding, a symbol such as #iso8859"
|
|
401 |
|
|
402 |
^ encoding
|
|
403 |
!
|
|
404 |
|
|
405 |
fontId
|
|
406 |
"return the device-dependent font-id"
|
|
407 |
|
|
408 |
^ fontId
|
|
409 |
!
|
|
410 |
|
|
411 |
device
|
|
412 |
"return the device I am on"
|
|
413 |
|
|
414 |
^ device
|
|
415 |
! !
|
|
416 |
|
|
417 |
!Font methodsFor:'errors'!
|
|
418 |
|
|
419 |
errorNoDevice
|
|
420 |
"a query was made for device-specific info"
|
|
421 |
|
|
422 |
self error:'query device independent font for for device specific info'
|
|
423 |
! !
|
|
424 |
|
|
425 |
!Font methodsFor:'queries'!
|
|
426 |
|
|
427 |
isFixedWidth
|
|
428 |
"return true, if all characters have same width (as in courier"
|
|
429 |
|
|
430 |
device isNil ifTrue:[
|
|
431 |
self errorNoDevice
|
|
432 |
].
|
|
433 |
^ isFixedWidth
|
|
434 |
!
|
|
435 |
|
|
436 |
height
|
|
437 |
"return the characters maximum height;
|
|
438 |
That is the number of units (usually pixels) on the device"
|
|
439 |
|
|
440 |
device isNil ifTrue:[
|
|
441 |
self errorNoDevice
|
|
442 |
].
|
|
443 |
^ height
|
|
444 |
!
|
|
445 |
|
|
446 |
width
|
|
447 |
"return the characters width;
|
|
448 |
That is the number of units (usually pixels) on the device.
|
|
449 |
For variable pitch fonts, the width of the space character is returned"
|
|
450 |
|
|
451 |
device isNil ifTrue:[
|
|
452 |
self errorNoDevice
|
|
453 |
].
|
|
454 |
^ width
|
|
455 |
!
|
|
456 |
|
|
457 |
minWidth
|
|
458 |
"return the width of the smallest character;
|
|
459 |
if the receiver is a fixed width font its the width of every character"
|
|
460 |
|
|
461 |
device isNil ifTrue:[
|
|
462 |
self errorNoDevice
|
|
463 |
].
|
|
464 |
^ minWidth
|
|
465 |
!
|
|
466 |
|
|
467 |
maxWidth
|
|
468 |
"return the width of the widest character;
|
|
469 |
if the receiver is a fixed width font its the width of every character"
|
|
470 |
|
|
471 |
device isNil ifTrue:[
|
|
472 |
self errorNoDevice
|
|
473 |
].
|
|
474 |
^ maxWidth
|
|
475 |
!
|
|
476 |
|
|
477 |
ascent
|
|
478 |
"return the font-ascent i.e. the maximum of all characters;
|
|
479 |
That is the number of units (usually pixels) above the baseline"
|
|
480 |
|
|
481 |
device isNil ifTrue:[
|
|
482 |
self errorNoDevice
|
|
483 |
].
|
|
484 |
^ ascent
|
|
485 |
!
|
|
486 |
|
|
487 |
descent
|
|
488 |
"return the font-descent i.e. the maximum of all characters;
|
|
489 |
That is the number of units (usually pixels) below the baseline"
|
|
490 |
|
|
491 |
device isNil ifTrue:[
|
|
492 |
self errorNoDevice
|
|
493 |
].
|
|
494 |
^ descent
|
|
495 |
!
|
|
496 |
|
|
497 |
widthOf:aStringOrText
|
|
498 |
"return the width (device specific) of the argument;
|
|
499 |
the argument may be a String or some Text;
|
|
500 |
in the later case the width of the longest line in the text is returned"
|
|
501 |
|
|
502 |
|this max|
|
|
503 |
|
|
504 |
device isNil ifTrue:[
|
|
505 |
self errorNoDevice.
|
|
506 |
^ 0
|
|
507 |
].
|
|
508 |
replacementFont notNil ifTrue:[
|
2
|
509 |
^ replacementFont widthOf:aStringOrText
|
0
|
510 |
].
|
|
511 |
|
|
512 |
(aStringOrText isMemberOf:String) ifTrue:[
|
|
513 |
isFixedWidth ifFalse:[
|
|
514 |
^ device widthOf:aStringOrText inFont:fontId
|
|
515 |
].
|
|
516 |
^ width * aStringOrText size
|
|
517 |
].
|
|
518 |
|
|
519 |
max := 0.
|
|
520 |
isFixedWidth ifFalse:[
|
|
521 |
aStringOrText do:[:line |
|
|
522 |
line notNil ifTrue:[
|
|
523 |
this := device widthOf:line inFont:fontId.
|
|
524 |
(this > max) ifTrue:[max := this]
|
|
525 |
]
|
|
526 |
].
|
|
527 |
^ max
|
|
528 |
].
|
|
529 |
|
|
530 |
aStringOrText do:[:lineString |
|
|
531 |
this := lineString size.
|
|
532 |
(this > max) ifTrue:[max := this]
|
|
533 |
].
|
|
534 |
^ max * width
|
|
535 |
!
|
|
536 |
|
|
537 |
widthOf:aString from:start to:stop
|
|
538 |
"return the width of a substring"
|
|
539 |
|
|
540 |
device isNil ifTrue:[
|
|
541 |
self errorNoDevice.
|
|
542 |
^ 0
|
|
543 |
].
|
|
544 |
replacementFont notNil ifTrue:[
|
2
|
545 |
^ replacementFont widthOf:aString from:start to:stop
|
0
|
546 |
].
|
|
547 |
(stop < start) ifTrue:[^ 0].
|
|
548 |
isFixedWidth ifFalse:[
|
|
549 |
^ device widthOf:aString from:start to:stop inFont:fontId
|
|
550 |
].
|
|
551 |
^ (stop - start + 1) * width
|
|
552 |
! !
|
|
553 |
|
2
|
554 |
!Font methodsFor:'st-80 queries'!
|
|
555 |
|
|
556 |
serif
|
|
557 |
"return true, if this font has serifs"
|
|
558 |
|
|
559 |
"this should be done in a better way ..."
|
|
560 |
|
|
561 |
family = 'Times' ifTrue:[^ true].
|
|
562 |
family = 'times' ifTrue:[^ true].
|
|
563 |
^ false.
|
|
564 |
!
|
|
565 |
|
|
566 |
fixedWidth
|
|
567 |
"return true, if this font is a fixed width font -
|
|
568 |
for st-80 compatibility"
|
|
569 |
|
|
570 |
^ self isFixedWidth
|
|
571 |
!
|
|
572 |
|
|
573 |
pixelSize
|
|
574 |
"return the height of the font in pixels -
|
|
575 |
for st-80 compatibility"
|
|
576 |
|
|
577 |
^ self height
|
|
578 |
!
|
|
579 |
|
|
580 |
italic
|
|
581 |
"return true if this is an italic font -
|
|
582 |
for st-80 compatibility"
|
|
583 |
|
|
584 |
face = 'italic' ifTrue:[^ true].
|
|
585 |
face = 'obligue' ifTrue:[^ true].
|
|
586 |
^ false
|
|
587 |
!
|
|
588 |
|
|
589 |
boldness
|
|
590 |
"return the boldness of the characters in this font 0 .. 1 -
|
|
591 |
for st-80 compatibility"
|
|
592 |
|
|
593 |
style = 'roman' ifTrue:[^ 0.5].
|
|
594 |
style = 'normal' ifTrue:[^ 0.5].
|
|
595 |
style = 'bold' ifTrue:[^ 0.75].
|
|
596 |
style = 'light' ifTrue:[^ 0.25].
|
|
597 |
^ 0.5
|
|
598 |
! !
|
|
599 |
|
0
|
600 |
!Font methodsFor:'printing & storing'!
|
|
601 |
|
|
602 |
printString
|
|
603 |
^ 'a ' , family , '-', face, '-', style, '-', size printString, '-Font'
|
|
604 |
!
|
|
605 |
|
|
606 |
storeString
|
|
607 |
"return a String with a representation of myself, from which I can be
|
|
608 |
recreated"
|
|
609 |
|
|
610 |
^ ('(Font family:' , family ,
|
|
611 |
' face:' , face ,
|
|
612 |
' style:' , style ,
|
|
613 |
' size:' , size printString ,
|
|
614 |
' encoding:' , encoding storeString , ')')
|
|
615 |
! !
|
2
|
616 |
|
|
617 |
!Font methodsFor: 'binary storage'!
|
|
618 |
|
|
619 |
readBinaryContentsFrom: stream manager: manager
|
|
620 |
"tell the newly restored Font about restoration"
|
|
621 |
|
|
622 |
super readBinaryContentsFrom: stream manager: manager.
|
|
623 |
self restored
|
|
624 |
! !
|