StrikeFont(NewYork12 15) becomes bold after #saveOnFile

Boris Gaertner Boris.Gaertner at gmx.net
Sun Jun 1 07:01:46 UTC 2003


From: Stéphane Rollandin <hepta at zogotounga.net>


> it seems that the text becomes bold on saving.. attached is a TextMorph
> which when I saved it had plain text, and which when loaded is bold (in a
> fresh 3.5 image). is that useful to you ?
>

Yes, the file contains emphasis = 1 for the font at size 15.
You can place a 'self halt' into
      StrikeFont class>>familyName: size: emphasized:
to see that.

When you save a TextMorph, the font information is
filed out with method
StrikeFont>>objectForDataStream:

In this method you find this statement:

 dp _ DiskProxy global: #StrikeFont
                         selector: #familyName:size:emphasized:
                         args: (Array with: self familyName
                                            with: self height
                                            with: self emphasis).

This descriptor contains a class, a class method and three
method arguments. To reconstruct the instance from this
descriptor, the method and its arguments are sent to the
class. That's all.

I think it is that place where the unwanted boldness is written into
the file. You should place a 'self halt' before this statement
and explore the values  self familyName, self height, self emphasis.
Emphasis should be zero for plain fonts and 1 for bold  fonts.

Can you tell me what you see?

Greetings, Boris




More information about the Squeak-dev mailing list