|
Re: Fonts with non-standard sizes?: msg#00062lang.smalltalk.squeak.beginners
Simon, What version of Squeak are you using? > I know I can choose my own size using StrikeFont class>>fromUser, but > what's the best way to do this in my code, non-interactively? This is a good starting point. StrikeFont class>fromUser calls: StrikeFont class>fromUser:allowKeyboard:, and down in the method, you find lines like: ptMenu add: 'new size' target ... #addNewFontSizeDialog: ... This suggests that for the 'new size' menu item, a message whose selector is addNewFontSizeDialog: is sent to an object. And if you look at the implementors of the method, it is TextStyle. So, if you evaluate: (TextStyle named: 'BitstreamVeraSans') addNewFontSize: 120. you can add the new size. > Oh, and should I prefer TTCFont or StrikeFont, or does it not > matter? StrikeFont is pixel font and not good for making new size programatically. Your safe bet is on TTCFont. > And what should I use for the font family, for maximum portability? > Can I assume BitstreamVeraSans is always available? What's better > than assuming that? Nobody would lobby to remove it but you could do: TTFontDescription default name to figure out the "default TrueType font" in the current system. -- Yoshiki
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: TestFailure: Assertion failed in first practice from Squeak by Example, Eric Eisaman |
|---|---|
| Next by Date: | Re: Fonts with non-standard sizes?, Simon Guest |
| Previous by Thread: | Fonts with non-standard sizes?, Simon Guest |
| Next by Thread: | Re: Fonts with non-standard sizes?, Simon Guest |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |