Help with textmorph
ducasse
ducasse at iam.unibe.ch
Fri Feb 20 22:28:52 UTC 2004
thanks a lot. I saw that I had to go directly to the text object that's
why I abandoned the textMorph.
I was fighting with the TextStyle interface but in fact going from the
StrikeFont one is indeed much better.
Stef
On 20 févr. 04, at 22:47, Steven Swerling wrote:
> You can change fonts w/in the Text object itself using TextAttributes.
>
> Try this:
>
> | font1 font2 t1 t2 |
> tMorph _ TextMorph new.
> font1 _ (TextFontReference toFont: (StrikeFont familyName: 'Atlanta'
> size: 22)).
> font2 _ (TextFontReference toFont: (StrikeFont familyName: 'Atlanta'
> size: 11)).
> t1 _ 'this is font1' asText addAttribute: font1.
> t2 _ ' and this is font2' asText addAttribute: font2.
> tMorph contents: (t1,t2).
> tMorph openInHand.
>
>
> ducasse wrote:
>
>> hi all
>> I would like to have a textMorph (if you have soemthing better please
>> say it)
>> that contains different fonts.
>> I tried
>> TextMorph new openInWorld; string: 'JJLLJL' fontName: #Atlanta size:
>> 22 wrap: false
>> It works. What I do not succeed to do is to add another text with
>> another font.
>> I tried
>> fontName: #Atlanta size: 18. contents: 'stéphane in
>> accuate18'
>> So any help is really appreciated
>> Stef
>
>
More information about the Squeak-dev
mailing list
|