Search code examples
smalltalksqueak

How do I make really large text in Smalltalk?


I'm trying to make a large text banner in Squeak Smalltalk, with the following code:

t := TextMorph new.
t string: 'You win!' fontName: 'BitstreamVeraSans' size: 400.
t extent: 600@100.
t center: Display center.
t openInWorld.

But the text size seems to max out at about 60. Am I using the wrong class? I don't need the text to be editable.


Solution

  • Two ways:

    1. Add another font size: (TextStyle named: #BitstreamVeraSans) addNewFontSize: 200 and use a regular text morph as before.

    2. Use a "Truetype banner" which can be arbitrarily scaled: Either get one from the object catalog, or use TTSampleStringMorph new initializeToStandAlone openInHand. Look into the initializeToStandAlone method to make your own.

    For a large heading I probably would use the