hello list,
I'm submitting again this problem I've had for a while since my previous post (a few weeks ago) did not get any answer.
here we go:
----
my default font is NewYork12 15
when I save a TextMorph or a MenuItemMorph with #saveOnFile, then import the .morph file back in the image, the font becomes NewYork12B 15, bold.
OTOH there is no problem with NewYork10 12 (the default one in Squeak 3.4).
no problem with StringMorph either.
how could I fix this ?
Stef
On Friday 16 May 2003 06:52 am, Stephane Rollandin wrote:
my default font is NewYork12 15
when I save a TextMorph or a MenuItemMorph with #saveOnFile, then import the .morph file back in the image, the font becomes NewYork12B 15, bold.
OTOH there is no problem with NewYork10 12 (the default one in Squeak 3.4).
no problem with StringMorph either.
how could I fix this ?
I'm not seeing this in my image.
What version? What packages have you loaded into it?
Thanks,
my default font is NewYork12 15
when I save a TextMorph or a MenuItemMorph with #saveOnFile, then import the .morph file back in the image, the font becomes NewYork12B 15, bold.
OTOH there is no problem with NewYork10 12 (the default one in Squeak 3.4).
no problem with StringMorph either.
how could I fix this ?
I'm not seeing this in my image.
sorry about that, I should have checked before asking :(
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 ?
What version?
3.4
What packages have you loaded into it?
many... RePlugin, StarBrowser, Whisker, Connectors, OSProcess, Prolog, NamedProcess, Atomic, I guess a couple more.
well I should do that job myself: I'll try to isolate the responsible package and let you know.
thanks !
Stef
From: Stéphane Rollandin hepta@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
ok I did the trick with a TextMorph in NewYork12.
this is what I get in the debugger, when a 'self halt' is prepended to the described statement:
self height: 12 self emphasis: 0 self familyName: 'NewYork'
now if I put the halt after the statement, I can also check that dp is a DiskProxy whose constructorArgs array is indeed #('NewYork 12 0')
but... removing the halt, saving and loading the morph... it comes bold !
thanks for your help
cheers,
Stef
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
Stéphane Rollandin hepta@zogotounga.net wrote:
ok I did the trick with a TextMorph in NewYork12.
this is what I get in the debugger, when a 'self halt' is prepended to the described statement:
self height: 12 self emphasis: 0 self familyName: 'NewYork'
now if I put the halt after the statement, I can also check that dp is a DiskProxy whose constructorArgs array is indeed #('NewYork 12 0')
Ok, this is the first of four StrikeFonts, the smallest one. The file that you gave us on May 18th contains descriptors for four fonts and that is not a surprice: These four fonts set up the TextStyle 'NewYork' When you save the Morph with the 'self halt' that I proposed to you in my last mail, the debugger will open four times. The second time it opens, it will show you what will be filed out for the font of size 15 and that is the most interesting point.
Now a different proposal:
The method Object>>objectForDataStream: does most of the file-out for almost all classes. A few classes that need special handling redefine that method. You can add this method to the instance protocol of TextStyle:
objectForDataStream: refStrm self halt. ^ super objectForDataStream: refStrm
This method delegates the work to the superclass (Object) but before it does so, it opens the debugger. You can look into the text style and the interesting element is the value of instance variable fontArray. You should see four StrikeFonts and the second font in the array is that of size 15. (The pointSize variable of that font has the value 15) What are the values of instance variables emphasis and name?)
The debugger will open for the TextStyle method first. When you continue, it will open four times for the four instances of StrikeFont (Provided that you keep the 'self halt' in StrikeFont>>objectForDataStream:) You should always close the debugger with 'proceed' when it shows the method 'halt' You can than create the complete *.morph file.
Greetings, Boris
At 12:21 01/06/2003, you wrote:
Ok, this is the first of four StrikeFonts, the smallest one. The file that you gave us on May 18th contains descriptors for four fonts and that is not a surprice: These four fonts set up the TextStyle 'NewYork' When you save the Morph with the 'self halt' that I proposed to you in my last mail, the debugger will open four times. The second time it opens, it will show you what will be filed out for the font of size 15 and that is the most interesting point.
bingo !
the second time, self emphasis is 1. name is 'NewYork12'
the third and fourth times, self emphasis is 0 all right.
also, maybe of interest: the instance variable derivativeFonts is, for the four fonts:
1) size 12, name 'NewYork10': #(a StrikeFont(NewYork10B 12) nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)
2) size 15, name 'NewYork12': #(a StrikeFont(NewYork12B 15) nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)
3) size 18, name 'NewYork18': #(nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)
4) size 24, name 'NewYork24': #(nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)
... StrikeFont(NewYork12B 15) is actually the font I get in my morph when I load it back.
more precisely, the TextMorph I save has a textStyle:
TextStyle NewYork12
which itself has a fontArray:
#(a StrikeFont(NewYork10 12) a StrikeFont(NewYork12 15) a StrikeFont(NewYork18 21) a StrikeFont(NewYork24 26))
while the TextMorph loaded back has a textStyle:
TextStyle NewYork12B
which has a fontArray:
#(a StrikeFont(NewYork10 12) a StrikeFont(NewYork12B 15) a StrikeFont(NewYork18 21) a StrikeFont(NewYork24 26))
cheers
Stef
squeak-dev@lists.squeakfoundation.org