Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
How to create a text with different font sizes
Last updated at 4:29 am UTC on 11 May 2017
 textStream := TextStream on: (Text new: 5000).
 
 string := 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.

 aFontWithDifferentSizes :=  TextConstants at: #BitstreamVeraSans. 
 
 aFontWithDifferentSizes fontArray do: [:aFont | 
 textStream withAttribute: 
                 (TextFontReference toFont: aFont)
                     do: [textStream nextPutAll: aFont pointSize asString, ': ', string; cr].
 ].	


BitstreamVeraSans_Text.png