364 |
364 |
365 font:aFont |
365 font:aFont |
366 "set the font for all shown text. |
366 "set the font for all shown text. |
367 Redraws everything. |
367 Redraws everything. |
368 CAVEAT: with the addition of Text objects, |
368 CAVEAT: with the addition of Text objects, |
369 this method is going to be obsoleted by a textStyle |
369 this method is going to be obsoleted by a textStyle |
370 method, which allows specific control over |
370 method, which allows specific control over |
371 normalFont/boldFont/italicFont parameters." |
371 normalFont/boldFont/italicFont parameters." |
372 |
372 |
373 aFont isNil ifTrue:[ |
373 aFont isNil ifTrue:[ |
374 ^ self error:'nil font' |
374 ^ self error:'nil font' |
375 ]. |
375 ]. |
376 font ~~ aFont ifTrue:[ |
376 font ~~ aFont ifTrue:[ |
377 super font:aFont. |
377 super font:(aFont on:device). |
378 realized ifTrue:[ |
378 preferredExtent := nil. |
379 widthOfWidestLine := nil. "/ i.e. unknown |
379 widthOfWidestLine := nil. "/ i.e. unknown |
380 (font graphicsDevice == device) ifTrue:[ |
380 self getFontParameters. |
381 self getFontParameters. |
381 realized ifTrue:[ |
382 self computeNumberOfLinesShown. |
382 (font graphicsDevice == device) ifTrue:[ |
383 shown ifTrue:[ |
383 self getFontParameters. |
384 self redrawFromVisibleLine:1 to:nLinesShown |
384 self computeNumberOfLinesShown. |
385 ] |
385 shown ifTrue:[ |
386 ]. |
386 self redrawFromVisibleLine:1 to:nLinesShown |
387 self contentsChanged |
387 ] |
388 ] |
388 ]. |
|
389 self contentsChanged |
|
390 ] |
389 ] |
391 ] |
390 |
392 |
391 "Modified: 5.7.1996 / 17:55:34 / cg" |
393 "Modified: 5.7.1996 / 17:55:34 / cg" |
392 ! |
394 ! |
393 |
395 |