How to get font size to "stick" on a TextMorph

Ned Konz ned at bike-nomad.com
Mon Sep 10 17:39:54 UTC 2001


On Monday 10 September 2001 10:16 am, Randal L. Schwartz wrote:
> >>>>> "Ned" == Ned Konz <ned at bike-nomad.com> writes:
>
> Ned> If you're doing this programmatically, what you want to do is to pass
> a Text Ned> (which has styles in it) rather than a String (which would use
> a default Ned> font).
>
> Is there a way to set the "default font" for a TextMorph then?

Yes; beAllFont: works. TextMorphs have a textStyle instvar.

t _ TextMorph new 
		beAllFont: (TextStyle default fontOfSize: 26);
		contents: 'test big stuff'.
t openInWorld.

Another way to get a font is explicitly:
	StrikeFont familyName: #NewYork size: 18

> If so,
> how come the halo doesn't do it?  I just want to be able to say
> "update the string you're displaying to be FOO now".  That shouldn't
> be hard in this eToys world. :)

How does the halo let you change the text? I just select all the characters 
with the mouse or keyboard (cmd-A) and type in new text.

> Or, is there a more appropriate string holder container?

What are you trying to do?

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com




More information about the Squeak-dev mailing list