0
|
1 |
'From Smalltalk/X, Version:2.5.1 on 29-Jan-1993 at 12:13:27'!
|
|
2 |
|
|
3 |
Font subclass:#HersheyFont
|
86
|
4 |
instanceVariableNames:'glyphs scale'
|
|
5 |
classVariableNames:'GlyphData'
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Graphics-Support'
|
0
|
8 |
!
|
|
9 |
|
86
|
10 |
HersheyFont comment:'
|
|
11 |
Support for hershey fonts is based on a freeware cd-rom distribution
|
0
|
12 |
by DEC. This disk contains the hershey outlines and glyph maps of
|
|
13 |
the following fonts:
|
|
14 |
|
|
15 |
Fonts:
|
86
|
16 |
Roman: Plain, Simplex, Duplex, Complex Small, Complex, Triplex
|
0
|
17 |
Italic: Complex Small, Complex, Triplex
|
|
18 |
Script: Simplex, Complex
|
|
19 |
Gothic: German, English, Italian
|
86
|
20 |
Greek: Plain, Simplex, Complex Small, Complex
|
0
|
21 |
Cyrillic: Complex
|
|
22 |
|
|
23 |
Symbols:
|
86
|
24 |
Mathematical
|
|
25 |
Daggers
|
|
26 |
Astronomical
|
|
27 |
Astrological
|
|
28 |
Musical
|
|
29 |
Typesetting (ffl,fl,fi sorts of things)
|
|
30 |
Miscellaneous:
|
|
31 |
- Playing card suits
|
|
32 |
- Meteorology
|
|
33 |
- Graphics (lines, curves)
|
|
34 |
- Electrical
|
|
35 |
- Geometric (shapes)
|
|
36 |
- Cartographic
|
|
37 |
- Naval
|
|
38 |
- Agricultural
|
|
39 |
- Highways
|
|
40 |
- Etc...
|
0
|
41 |
|
|
42 |
Legal notice:
|
86
|
43 |
This distribution of the Hershey Fonts may be used by anyone for
|
|
44 |
any purpose, commercial or otherwise, providing that:
|
|
45 |
|
|
46 |
1. The following acknowledgements must be distributed with
|
|
47 |
the font data:
|
|
48 |
- The Hershey Fonts were originally created by Dr.
|
|
49 |
A. V. Hershey while working at the U. S.
|
|
50 |
National Bureau of Standards.
|
|
51 |
- The format of the Font data in this distribution
|
|
52 |
was originally created by
|
|
53 |
James Hurt
|
|
54 |
Cognition, Inc.
|
|
55 |
900 Technology Park Drive
|
|
56 |
Billerica, MA 01821
|
|
57 |
(mit-eddie!!ci-dandelion!!hurt)
|
|
58 |
|
|
59 |
2. The font data in this distribution may be converted into
|
|
60 |
any other format *EXCEPT* the format distributed by
|
|
61 |
the U.S. NTIS (which organization holds the rights
|
|
62 |
to the distribution and use of the font data in that
|
|
63 |
particular format). Not that anybody would really
|
|
64 |
*want* to use their format... each point is described
|
|
65 |
in eight bytes as "xxx yyy:", where xxx and yyy are
|
|
66 |
the coordinate values as ASCII numbers.
|
0
|
67 |
'!
|
|
68 |
|
|
69 |
!HersheyFont class methodsFor:'private'!
|
|
70 |
|
86
|
71 |
hersheyFontPath
|
|
72 |
"the directory, where the glyph data is found;
|
|
73 |
you may have to modify this a bit ..."
|
|
74 |
|
|
75 |
^ '/LocalLibrary/Fonts/hershey/data/hersh.oc'
|
|
76 |
!
|
|
77 |
|
0
|
78 |
readDataFile
|
|
79 |
|inStream b5 b3 chars moves glyphNo nPairs char1 char2 index|
|
|
80 |
|
86
|
81 |
inStream := FileStream readonlyFileNamed:(self hersheyFontPath).
|
|
82 |
inStream isNil ifTrue:[
|
|
83 |
self error:'no glyph data file found'.
|
|
84 |
^ self
|
|
85 |
].
|
0
|
86 |
|
86
|
87 |
GlyphData isNil ifTrue:[
|
|
88 |
Transcript showCr:'reading hershey glyphs ...'.
|
|
89 |
GlyphData := VariableArray new:4000.
|
|
90 |
b5 := String new:5.
|
|
91 |
b3 := String new:3.
|
|
92 |
[inStream atEnd] whileFalse:[
|
|
93 |
chars := inStream nextBytes:5 into:b5.
|
|
94 |
glyphNo := Number readFromString:b5.
|
|
95 |
chars := inStream nextBytes:3 into:b3.
|
|
96 |
nPairs := Number readFromString:b3.
|
|
97 |
moves := String new:(nPairs * 2).
|
|
98 |
index := 1.
|
|
99 |
1 to:nPairs do:[:i |
|
|
100 |
char1 := inStream next.
|
|
101 |
char1 == Character nl ifTrue:[
|
|
102 |
char1 := inStream next
|
|
103 |
].
|
|
104 |
char2 := inStream next.
|
|
105 |
char2 == Character nl ifTrue:[
|
|
106 |
char2 := inStream next
|
|
107 |
].
|
|
108 |
moves at:index put:char1.
|
|
109 |
index := index + 1.
|
|
110 |
moves at:index put:char2.
|
|
111 |
index := index + 1
|
|
112 |
].
|
|
113 |
GlyphData at:glyphNo put:moves.
|
|
114 |
[inStream peek == Character nl] whileTrue:[inStream next]
|
|
115 |
].
|
|
116 |
inStream close
|
0
|
117 |
]
|
|
118 |
|
|
119 |
"HersheyFont readDataFile"
|
|
120 |
!
|
|
121 |
|
|
122 |
name:aFileName family:family face:face style:style size:sz
|
|
123 |
"return a font with glyph-data from aFileName"
|
|
124 |
|
|
125 |
|newFont|
|
|
126 |
|
|
127 |
newFont := self basicNew readGlyphsFrom:aFileName.
|
|
128 |
newFont family:family face:face style:style size:sz.
|
|
129 |
^ newFont
|
|
130 |
|
|
131 |
"HersheyFont name:'gothger'"
|
|
132 |
! !
|
|
133 |
|
|
134 |
!HersheyFont class methodsFor:'drawing'!
|
|
135 |
|
|
136 |
drawGlyph:glyphNo in:aGC x:x y:y scale:aScale
|
|
137 |
|moves c1 c2 xPos yPos nX nY draw w h savedLW|
|
|
138 |
|
86
|
139 |
moves := GlyphData at:glyphNo.
|
0
|
140 |
moves isNil ifTrue:[
|
86
|
141 |
Transcript showCr:('no glyph for ' , glyphNo printString).
|
|
142 |
^ self
|
0
|
143 |
].
|
|
144 |
savedLW := aGC lineWidth.
|
|
145 |
aGC lineWidth:(aScale * 2) rounded.
|
|
146 |
|
|
147 |
xPos := 0 "x".
|
|
148 |
yPos := 0 "y".
|
|
149 |
draw := false. "start with a skip"
|
|
150 |
w := ((moves at:1) asciiValue - $R asciiValue)" * aScale".
|
|
151 |
h := ($R asciiValue - (moves at:2) asciiValue)" negated * aScale".
|
|
152 |
w := w negated * aScale * 2.
|
|
153 |
h := h negated * aScale * 2.
|
|
154 |
|
|
155 |
3 to:(moves size) by:2 do:[:index |
|
86
|
156 |
c1 := moves at:index.
|
|
157 |
c2 := moves at:(index + 1).
|
|
158 |
c1 == Character space ifTrue:[
|
|
159 |
draw := false
|
|
160 |
] ifFalse:[
|
|
161 |
nX := "xPos +" ((c1 asciiValue - $R asciiValue) * aScale).
|
|
162 |
nY := "yPos +" (($R asciiValue - c2 asciiValue) negated * aScale).
|
|
163 |
draw ifTrue:[
|
|
164 |
aGC displayLineFromX:((x + xPos) truncated "rounded")
|
|
165 |
y:((y + yPos) truncated "rounded")
|
|
166 |
toX:((x + nX) truncated "rounded")
|
|
167 |
y:((y + nY) truncated "rounded").
|
|
168 |
].
|
|
169 |
xPos := nX.
|
|
170 |
yPos := nY.
|
|
171 |
draw := true
|
|
172 |
]
|
0
|
173 |
].
|
|
174 |
aGC lineWidth:savedLW
|
|
175 |
|
|
176 |
"Smalltalk at:#v put:nil.
|
|
177 |
Smalltalk at:#f put:nil.
|
|
178 |
v := View new realize.
|
|
179 |
|
|
180 |
v clear.
|
|
181 |
v font:(f := HersheyFont family:'hershey-times' face:'bold' style:'roman' size:12).
|
|
182 |
v displayString:'hello' x:50 y:50"
|
|
183 |
!
|
|
184 |
|
|
185 |
widthOfGlyph:glyphNo scale:aScale
|
|
186 |
|moves w|
|
|
187 |
|
86
|
188 |
moves := GlyphData at:glyphNo.
|
0
|
189 |
moves isNil ifTrue:[
|
86
|
190 |
Transcript showCr:('no glyph for ' , glyphNo printString).
|
|
191 |
^ 0
|
0
|
192 |
].
|
|
193 |
|
|
194 |
w := ((moves at:1) asciiValue - $R asciiValue).
|
|
195 |
w := w negated * aScale * 2.
|
|
196 |
^ w
|
|
197 |
|
|
198 |
"HersheyFont widthOfGlyph:3401 scale:1"
|
|
199 |
!
|
|
200 |
|
|
201 |
heightOfGlyph:glyphNo scale:aScale
|
|
202 |
|moves h|
|
|
203 |
|
86
|
204 |
moves := GlyphData at:glyphNo.
|
0
|
205 |
moves isNil ifTrue:[
|
86
|
206 |
Transcript showCr:('no glyph for ' , glyphNo printString).
|
|
207 |
^ 0
|
0
|
208 |
].
|
|
209 |
|
|
210 |
h := ($R asciiValue - (moves at:2) asciiValue)" negated * aScale".
|
|
211 |
h := h negated * aScale * 2.
|
|
212 |
^ h
|
|
213 |
! !
|
|
214 |
|
|
215 |
!HersheyFont class methodsFor:'instance creation'!
|
|
216 |
|
|
217 |
family:family face:face style:style size:sz
|
|
218 |
|fontNames|
|
|
219 |
|
|
220 |
fontNames := #(
|
86
|
221 |
('hershey-times' 'bold' 'roman' 'romant')
|
|
222 |
('hershey-times' 'medium' 'roman' 'romanc')
|
|
223 |
('hershey-times' 'medium' 'italic' 'italicc')
|
|
224 |
('hershey-times' 'bold' 'italic' 'italict')
|
|
225 |
('hershey-times' 'bold' 'greek' 'greekc')
|
0
|
226 |
|
86
|
227 |
('hershey-japan' 'bold' 'normal' 'japan')
|
0
|
228 |
|
86
|
229 |
('hershey-gothic-german' 'bold' 'roman' 'gothger')
|
|
230 |
('hershey-gothic-english' 'bold' 'roman' 'gotheng')
|
|
231 |
('hershey-gothic-italian' 'bold' 'roman' 'gothita')
|
0
|
232 |
|
86
|
233 |
('hershey-cursive' 'medium' 'roman' 'scripts')
|
|
234 |
('hershey-script' 'bold' 'roman' 'scriptc')
|
0
|
235 |
|
86
|
236 |
('hershey-futura' 'medium' 'roman' 'romans')
|
|
237 |
('hershey-futura' 'bold' 'roman' 'romand')
|
0
|
238 |
|
86
|
239 |
('hershey-markers' 'medium' 'roman' 'marker')
|
|
240 |
('hershey-math1' 'medium' 'roman' 'lowmat')
|
|
241 |
('hershey-math2' 'medium' 'roman' 'uppmat')
|
|
242 |
('hershey-symbol' 'medium' 'roman' 'symbol')
|
0
|
243 |
|
86
|
244 |
('hershey-astrology' 'bold' 'roman' 'astrol')
|
|
245 |
('hershey-meteorology' 'medium' 'roman' 'meteo')
|
|
246 |
('hershey-music' 'bold' 'roman' 'music')
|
0
|
247 |
).
|
|
248 |
|
|
249 |
fontNames do:[:entry |
|
86
|
250 |
(entry at:1) = family ifTrue:[
|
|
251 |
(entry at:2) = face ifTrue:[
|
|
252 |
(entry at:3) = style ifTrue:[
|
|
253 |
^ self name:(entry at:4) family:family face:face style:style size:sz
|
|
254 |
]
|
|
255 |
]
|
|
256 |
]
|
0
|
257 |
].
|
|
258 |
^ nil
|
|
259 |
|
|
260 |
"HersheyFont family:'hershey-gothic-german' face:'medium' style:'roman' size:12"
|
|
261 |
! !
|
|
262 |
|
|
263 |
!HersheyFont class methodsFor:'examples'!
|
|
264 |
|
|
265 |
showFont:f in:aView
|
|
266 |
"
|
|
267 |
Smalltalk at:#aView put:(View new extent:500@200) realize.
|
|
268 |
aView backingStore:true.
|
|
269 |
HersheyFont showFont:(HersheyFont family:'hershey-astrology'
|
86
|
270 |
face:'bold'
|
|
271 |
style:'roman'
|
|
272 |
size:24) in:aView
|
0
|
273 |
|
|
274 |
HersheyFont showFont:(HersheyFont family:'hershey-music'
|
86
|
275 |
face:'bold'
|
|
276 |
style:'roman'
|
|
277 |
size:24) in:aView
|
0
|
278 |
|
|
279 |
HersheyFont showFont:(HersheyFont family:'hershey-meteorology'
|
86
|
280 |
face:'medium'
|
|
281 |
style:'roman'
|
|
282 |
size:24) in:aView
|
0
|
283 |
|
|
284 |
HersheyFont showFont:(HersheyFont family:'hershey-cursive'
|
86
|
285 |
face:'medium'
|
|
286 |
style:'roman'
|
|
287 |
size:10) in:aView
|
0
|
288 |
|
|
289 |
HersheyFont showFont:(HersheyFont family:'hershey-cursive'
|
86
|
290 |
face:'medium'
|
|
291 |
style:'roman'
|
|
292 |
size:24) in:aView
|
0
|
293 |
|
|
294 |
HersheyFont showFont:(HersheyFont family:'hershey-cursive'
|
86
|
295 |
face:'medium'
|
|
296 |
style:'roman'
|
|
297 |
size:48) in:aView
|
0
|
298 |
|
|
299 |
HersheyFont showFont:(HersheyFont family:'hershey-script'
|
86
|
300 |
face:'bold'
|
|
301 |
style:'roman'
|
|
302 |
size:24) in:aView
|
0
|
303 |
|
|
304 |
HersheyFont showFont:(HersheyFont family:'hershey-times'
|
86
|
305 |
face:'medium'
|
|
306 |
style:'roman'
|
|
307 |
size:12) in:aView
|
0
|
308 |
|
|
309 |
HersheyFont showFont:(HersheyFont family:'hershey-times'
|
86
|
310 |
face:'medium'
|
|
311 |
style:'roman'
|
|
312 |
size:24) in:aView
|
0
|
313 |
|
|
314 |
HersheyFont showFont:(HersheyFont family:'hershey-times'
|
86
|
315 |
face:'medium'
|
|
316 |
style:'roman'
|
|
317 |
size:48) in:aView
|
0
|
318 |
|
|
319 |
HersheyFont showFont:(HersheyFont family:'hershey-times'
|
86
|
320 |
face:'bold'
|
|
321 |
style:'roman'
|
|
322 |
size:24) in:aView
|
0
|
323 |
|
|
324 |
HersheyFont showFont:(HersheyFont family:'hershey-times'
|
86
|
325 |
face:'medium'
|
|
326 |
style:'italic'
|
|
327 |
size:24) in:aView
|
0
|
328 |
|
|
329 |
HersheyFont showFont:(HersheyFont family:'hershey-times'
|
86
|
330 |
face:'bold'
|
|
331 |
style:'italic'
|
|
332 |
size:24) in:aView
|
0
|
333 |
|
|
334 |
HersheyFont showFont:(HersheyFont family:'hershey-futura'
|
86
|
335 |
face:'medium'
|
|
336 |
style:'roman'
|
|
337 |
size:24) in:aView
|
0
|
338 |
|
|
339 |
HersheyFont showFont:(HersheyFont family:'hershey-futura'
|
86
|
340 |
face:'bold'
|
|
341 |
style:'roman'
|
|
342 |
size:24) in:aView
|
0
|
343 |
|
|
344 |
HersheyFont showFont:(HersheyFont family:'hershey-markers'
|
86
|
345 |
face:'medium'
|
|
346 |
style:'roman'
|
|
347 |
size:24) in:aView
|
0
|
348 |
|
|
349 |
HersheyFont showFont:(HersheyFont family:'hershey-math1'
|
86
|
350 |
face:'medium'
|
|
351 |
style:'roman'
|
|
352 |
size:24) in:aView
|
0
|
353 |
|
|
354 |
HersheyFont showFont:(HersheyFont family:'hershey-math2'
|
86
|
355 |
face:'medium'
|
|
356 |
style:'roman'
|
|
357 |
size:24) in:aView
|
0
|
358 |
|
|
359 |
HersheyFont showFont:(HersheyFont family:'hershey-symbol'
|
86
|
360 |
face:'medium'
|
|
361 |
style:'roman'
|
|
362 |
size:24) in:aView
|
0
|
363 |
|
|
364 |
HersheyFont showFont:(HersheyFont family:'hershey-gothic-italian'
|
86
|
365 |
face:'bold'
|
|
366 |
style:'roman'
|
|
367 |
size:24) in:aView
|
0
|
368 |
|
|
369 |
HersheyFont showFont:(HersheyFont family:'hershey-gothic-german'
|
86
|
370 |
face:'bold'
|
|
371 |
style:'roman'
|
|
372 |
size:24) in:aView
|
0
|
373 |
|
|
374 |
HersheyFont showFont:(HersheyFont family:'hershey-gothic-english'
|
86
|
375 |
face:'bold'
|
|
376 |
style:'roman'
|
|
377 |
size:24) in:aView
|
0
|
378 |
"
|
|
379 |
|
|
380 |
|x y dy|
|
|
381 |
|
|
382 |
dy := f heightOn:aView device.
|
|
383 |
aView clear.
|
|
384 |
x := 100. y := dy.
|
|
385 |
32 to:47 do:[:i |
|
86
|
386 |
f drawCharacter:i in:aView x:x y:y.
|
|
387 |
x := x + 30
|
0
|
388 |
].
|
|
389 |
|
|
390 |
x := 100. y := y + dy.
|
|
391 |
48 to:57 do:[:i |
|
86
|
392 |
f drawCharacter:i in:aView x:x y:y.
|
|
393 |
x := x + 30
|
0
|
394 |
].
|
|
395 |
|
|
396 |
x := 100. y := y + dy.
|
|
397 |
58 to:64 do:[:i |
|
86
|
398 |
f drawCharacter:i in:aView x:x y:y.
|
|
399 |
x := x + 30
|
0
|
400 |
].
|
|
401 |
|
|
402 |
x := 100. y := y + dy.
|
|
403 |
65 to:90 do:[:i |
|
86
|
404 |
f drawCharacter:i in:aView x:x y:y.
|
|
405 |
x := x + 30
|
0
|
406 |
].
|
|
407 |
|
|
408 |
x := 100. y := y + dy.
|
|
409 |
91 to:96 do:[:i |
|
86
|
410 |
f drawCharacter:i in:aView x:x y:y.
|
|
411 |
x := x + 30
|
0
|
412 |
].
|
|
413 |
|
|
414 |
x := 100. y := y + dy.
|
|
415 |
97 to:122 do:[:i |
|
86
|
416 |
f drawCharacter:i in:aView x:x y:y.
|
|
417 |
x := x + 30
|
0
|
418 |
].
|
|
419 |
|
|
420 |
x := 100. y := y + dy.
|
|
421 |
123 to:127 do:[:i |
|
86
|
422 |
f drawCharacter:i in:aView x:x y:y.
|
|
423 |
x := x + 30
|
0
|
424 |
]
|
|
425 |
! !
|
|
426 |
|
|
427 |
!HersheyFont methodsFor:'private'!
|
|
428 |
|
|
429 |
readGlyphsFrom:aFileName
|
|
430 |
"read glyph definitions from aFileName"
|
|
431 |
|
|
432 |
|inStream ascii index1 index2|
|
|
433 |
|
|
434 |
self class readDataFile.
|
|
435 |
glyphs := Array new:(256 - 32).
|
|
436 |
inStream := FileStream readonlyFileNamed:('/LocalLibrary/Fonts/hershey/fonts/',aFileName,'.hmp').
|
|
437 |
ascii := 32.
|
|
438 |
[inStream atEnd] whileFalse:[
|
86
|
439 |
index1 := Number readFrom:inStream.
|
|
440 |
index2 := Number readFrom:inStream.
|
|
441 |
index2 == 0 ifTrue:[
|
|
442 |
index2 := index1
|
|
443 |
].
|
|
444 |
index1 to:index2 do:[:pos |
|
|
445 |
glyphs at:(ascii - 32 + 1) put:pos.
|
|
446 |
ascii := ascii + 1
|
|
447 |
].
|
|
448 |
inStream skipSeparators
|
0
|
449 |
].
|
|
450 |
inStream close.
|
|
451 |
^ self
|
|
452 |
!
|
|
453 |
|
|
454 |
scale:aScale
|
|
455 |
scale := aScale
|
|
456 |
!
|
|
457 |
|
|
458 |
family:fam face:fac style:st size:sz
|
|
459 |
family := fam.
|
|
460 |
face := fac.
|
|
461 |
style := st.
|
|
462 |
size := sz.
|
|
463 |
scale := sz / 24
|
|
464 |
! !
|
|
465 |
|
|
466 |
!HersheyFont methodsFor:'queries'!
|
|
467 |
|
|
468 |
ascentOn:aDevice
|
|
469 |
^ 0
|
|
470 |
!
|
|
471 |
|
|
472 |
descentOn:aDevice
|
|
473 |
^ self heightOn:aDevice
|
|
474 |
!
|
|
475 |
|
|
476 |
heightOn:aDevice
|
|
477 |
^ scale * (24 + 12)
|
|
478 |
!
|
|
479 |
|
|
480 |
widthOfCharacter:ascii
|
|
481 |
|glyphNo|
|
|
482 |
|
|
483 |
(ascii between:32 and:127) ifFalse:[^ 0].
|
|
484 |
glyphNo := glyphs at:(ascii - 32 + 1).
|
|
485 |
glyphNo isNil ifTrue:[^ 0].
|
|
486 |
^ self class widthOfGlyph:glyphNo scale:scale
|
|
487 |
!
|
|
488 |
|
|
489 |
heightOfCharacter:ascii
|
|
490 |
|glyphNo|
|
|
491 |
|
|
492 |
(ascii between:32 and:127) ifFalse:[^ 0].
|
|
493 |
glyphNo := glyphs at:(ascii - 32 + 1).
|
|
494 |
glyphNo isNil ifTrue:[^ 0].
|
|
495 |
^ self class heightOfGlyph:glyphNo scale:scale
|
|
496 |
!
|
|
497 |
|
|
498 |
widthOf:aString from:start to:stop
|
|
499 |
"return the width of a substring"
|
|
500 |
|
|
501 |
|sumW|
|
|
502 |
|
|
503 |
(stop < start) ifTrue:[^ 0].
|
|
504 |
sumW := 0.
|
|
505 |
start to:stop do:[:index |
|
86
|
506 |
sumW := sumW + (self widthOfCharacter:(aString at:index) asciiValue)
|
0
|
507 |
].
|
|
508 |
^ sumW
|
|
509 |
!
|
|
510 |
|
|
511 |
widthOf:aString
|
|
512 |
|sumW|
|
|
513 |
|
|
514 |
sumW := 0.
|
|
515 |
aString do:[:character |
|
86
|
516 |
sumW := sumW + (self widthOfCharacter:character asciiValue)
|
0
|
517 |
].
|
|
518 |
^ sumW
|
|
519 |
!
|
|
520 |
|
|
521 |
on:aDevice
|
|
522 |
^ self
|
|
523 |
! !
|
|
524 |
|
|
525 |
!HersheyFont methodsFor:'drawing'!
|
|
526 |
|
|
527 |
drawCharacter:ascii in:aGC x:x y:y
|
|
528 |
|glyphNo|
|
|
529 |
|
|
530 |
(ascii between:32 and:127) ifFalse:[^ self].
|
|
531 |
glyphNo := glyphs at:(ascii - 32 + 1).
|
|
532 |
glyphNo isNil ifTrue:[^ self].
|
|
533 |
self class drawGlyph:glyphNo in:aGC x:x y:y scale:scale
|
|
534 |
!
|
|
535 |
|
|
536 |
displayString:aString from:index1 to:index2 x:x0 y:y in:aGC
|
|
537 |
|x|
|
|
538 |
|
|
539 |
x := x0.
|
|
540 |
index1 to:index2 do:[:index |
|
86
|
541 |
self drawCharacter:(aString at:index) asciiValue in:aGC x:x y:y.
|
|
542 |
x := x + (self widthOfCharacter:(aString at:index) asciiValue)
|
0
|
543 |
]
|
|
544 |
!
|
|
545 |
|
|
546 |
displayString:aString x:x0 y:y in:aGC
|
|
547 |
|x|
|
|
548 |
|
|
549 |
x := x0.
|
|
550 |
aString do:[:character |
|
86
|
551 |
self drawCharacter:character asciiValue in:aGC x:x y:y.
|
|
552 |
x := x + (self widthOfCharacter:character asciiValue)
|
0
|
553 |
]
|
|
554 |
! !
|