[squeak-dev] Setting default font breaks DefaultTextStyle font list

Bob Arning arning315 at comcast.net
Sun Apr 23 10:31:48 UTC 2017


You might want to look at something like:

setSystemFontTo: aFont
     "Establish the default text font and style"

     | aStyle newDefaultStyle |
     aFont ifNil: [^ self].
     aStyle := aFont textStyle ifNil: [^ self].
     newDefaultStyle := aStyle copy.
     newDefaultStyle defaultFontIndex: (aStyle fontIndexOf: aFont).

     UserInterfaceTheme current
         set: #standardSystemFont to: aFont;
         apply.

     TextStyle setDefault: newDefaultStyle.
     Flaps replaceToolsFlap.
     ScriptingSystem resetStandardPartsBin.

which when you change the system font does an #apply of the current 
theme. I found that changing the font from 12 point serif to 12 point 
sans serif made radical changes in the size of open windows.


On 4/23/17 12:26 AM, tim Rowledge wrote:
>> On 22-04-2017, at 10:51 AM, tim Rowledge <tim at rowledge.org> wrote:
>>
>> A side-weirdness just to make life interesting was that the first time I changed the default find using the font chooser the screen background suddenly reverted to the dark gray linen pattern. I haven’t been able to spot a code path that could explain that and it doesn’t seem to happen now so… haunted image?
> I’ve tried this again in a recent image - I tried a 16963 update- and 'World menu’->’appearance’->’system fonts’-> ‘default text font’, then choose a font and apply. Whoosh, desktop pattern changes.
>
> Funny thing is this won’t repeat. And it doesn’t happen in a completely plain image, only one where I had loaded my.prefs some time previously; and yet not in a plain 16549 image where I loaded my.prefs and tried the font change. Curiouser and curiouserer. I can offer a sample image if anyone (like say, Marcel or TimF) is interested.
>
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Useful Latin Phrases:- Quantum materiae materietur marmota monax si marmota monax materiam possit materiari? = How much wood would a woodchuck chuck if a woodchuck could chuck wood?
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20170423/e396e365/attachment.html>


More information about the Squeak-dev mailing list