How to display a text with a really large font?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to display a text with a really large font?

stepharo
Hi

I read the comment of TextMorph

| font1 font2 t1 t2 tMorph|
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.

but I could not get it to work.

Now I will ask google to see if I can find an example.

Stef

Reply | Threaded
Open this post in threaded view
|

Re: How to display a text with a really large font?

Nicolai Hess
Don't know for sure what the maximum StrikeFont size, but for FT - Fonts you can use any (?) size:
(of course, the FT/TTF-font should be in the system/image).

| font1 font2 t1 t2 tMorph|
tMorph := TextMorph new.
font1 := (TextFontReference toFont: (StrikeFont familyName: 'Bitmap DejaVu Sans' size: 38)).
font2 := (TextFontReference toFont: (LogicalFont familyName: 'Source Sans Pro' pointSize: 81)).
t1 := 'this is font1' asText addAttribute: font1.
t2 := ' and this is font2' asText addAttribute: font2.
tMorph contents: (t1,t2).
tMorph openInHand.



2015-05-04 13:23 GMT+02:00 stepharo <[hidden email]>:
Hi

I read the comment of TextMorph

| font1 font2 t1 t2 tMorph|
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.

but I could not get it to work.

Now I will ask google to see if I can find an example.

Stef


Reply | Threaded
Open this post in threaded view
|

Re: How to display a text with a really large font?

stepharo
Thanks
Of course I was stupid not to see that it was doing a ref to font not loaded.

I would like to design a big display showing keybinding the first time you open a tool.
A bit like the growl but...
I'm not sure that I should play with that but this is tempting.

Stef


Le 4/5/15 13:31, Nicolai Hess a écrit :
Don't know for sure what the maximum StrikeFont size, but for FT - Fonts you can use any (?) size:
(of course, the FT/TTF-font should be in the system/image).

| font1 font2 t1 t2 tMorph|
tMorph := TextMorph new.
font1 := (TextFontReference toFont: (StrikeFont familyName: 'Bitmap DejaVu Sans' size: 38)).
font2 := (TextFontReference toFont: (LogicalFont familyName: 'Source Sans Pro' pointSize: 81)).
t1 := 'this is font1' asText addAttribute: font1.
t2 := ' and this is font2' asText addAttribute: font2.
tMorph contents: (t1,t2).
tMorph openInHand.



2015-05-04 13:23 GMT+02:00 stepharo <[hidden email]>:
Hi

I read the comment of TextMorph

| font1 font2 t1 t2 tMorph|
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.

but I could not get it to work.

Now I will ask google to see if I can find an example.

Stef