Created
April 2, 2021 05:31
-
-
Save bergel/e7b4372a99b22a58f6b959494f3f91e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Script of the day: Playing with the fonts | |
By Milton Mamani | |
https://github.com/ObjectProfile/Roassal3 | |
https://twitter.com/Roassal1 | |
" | |
text := 'La donna è mobile | |
Qual piuma al vento | |
Muta d''accento | |
E di pensiero | |
Sempre un amabile | |
Leggiadro viso | |
In pianto o in riso | |
È menzognero | |
La donna è mobile | |
Qual piuma al vento | |
Muta d''accento | |
E di pensier | |
E di pensier | |
E di pensier | |
È sempre misero | |
Chi a lei s''affida | |
Chi le confida | |
Mal cauto il core | |
Pur mai non sentesi | |
Felice appieno | |
Chi su quel seno | |
Non liba amore | |
La donna è mobile | |
Qual piuma al vento | |
Muta d''accento | |
E di pensier | |
E di pensier | |
E di pensier | |
'. | |
count := 0. | |
vertical := RSVerticalLineLayout new gapSize: 0. | |
horizontal := RSHorizontalLineLayout new alignLabel. | |
groups := (text splitOn: String cr,String cr) collect: [ :p | | |
| lines | | |
lines := p lines collect: [ :line | | |
| words | | |
words := (line splitOn: ' ') collect: [ :word | | |
RSLabel new | |
text: word; | |
ifNotNil: [ :lbl | | |
word = 'donna' | |
ifTrue: [ lbl bold; fontSize: 14 ]. | |
word = 'misero' | |
ifTrue: [ lbl fontSize: 20; color: 'red' ]. | |
word = 'pensier' | |
ifTrue: [ | |
lbl italic; underline; color: 'blue'; fontSize: (count*4)+10. | |
count := count+1. ] | |
]; | |
yourself | |
]. | |
horizontal on: words. | |
words asGroup asShape | |
]. | |
vertical on: lines. | |
lines asGroup asShape. | |
]. | |
canvas := RSCanvas new. | |
canvas addAll: groups. | |
RSHorizontalFlowLayout new | |
gapSize: 30; | |
on: groups. | |
canvas @ RSCanvasController. | |
canvas open |
Author
bergel
commented
Apr 2, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment