I have found this strange bug: when persisting a TextMorph (System set with default font to Accujen 10), when I fetch it back from the DB its font size is Accujen 9 and not 10 anymore
A simple code like that exposes the problem (close the session between the two statements to effectively get the text morph from the database):
(session addBranch: #test with: 'HELLO' asTextMorph ) openInWorld textStyle ==> a TextStyle Accujen10
Then fetching back after a full close of the DB:
(session branch: #test) textStyle ==> a TextStyle Accujen09
Any idea ?
Hilaire
Hilaire Fernandes a écrit :
I have found this strange bug: when persisting a TextMorph (System set with default font to Accujen 10), when I fetch it back from the DB its font size is Accujen 9 and not 10 anymore
A simple code like that exposes the problem (close the session between the two statements to effectively get the text morph from the database):
(session addBranch: #test with: 'HELLO' asTextMorph ) openInWorld textStyle ==> a TextStyle Accujen10
Then fetching back after a full close of the DB:
(session branch: #test) textStyle ==> a TextStyle Accujen09
Any idea ?
Hilaire
Some more elements:
TextStyle::fontArray an Array(a StrikeFont(Accujen09 12) a StrikeFont(Accujen10 12) a StrikeFont(Accujen12 15) a StrikeFont(Accujen14 17) a StrikeFont(Accujen18 22) a StrikeFont(Accujen24 30))
and TextStyle::fontArray an Array(a StrikeFont(Accujen09 12) a StrikeFont(Accujen09 12) a StrikeFont(Accujen12 15) a StrikeFont(Accujen14 17) a StrikeFont(Accujen18 22) a StrikeFont(Accujen24 30))
Hi Hilaire,
Magma does indeed support StrikeFonts by way of the underlying serialization framework, "Ma object serialization". Several kinds of Squeak Morphic elements require special pre/post serialization, and it is included for StrikeFonts out of the box.
The process for Magma committing/reading a StrikeFont is:
1) serialize the StrikeFont to a MaSerializedGraphBuffer 2) write the MaSerializedGraphBuffer to disk 3) read the MaSerializedGraphBuffer from disk 4) materialize a StrikeFont from the MaSerializedGraphBuffer
As you can guess, steps 2 and 3 very likely have nothing to do with the problem. Therefore, the first thing to do is to simplify the problem by getting Magma out of the picture and focusing on the serialization/materialization steps.
There is a method for doing exactly this, MaObjectSerializer class>>#testMaterialize:. It simply performs steps 1 and 4, above, which you may try with your StrikeFont:
MaObjectSerializer testMaterialize: myStrikeFont
and see if it exhibits the same undesired transformation. My guess is it will.
Next, look at the special-hook methods for StrikeFont and StrikeFontSet, each under the category, "*ma object serialization". Be sure to look at both the instance and class-side categories.
I was not able to reproduce the problem, but I believe from here you will be able to find the cause and solution to the problem in your image. Would you mind sharing what you find?
Regards, Chris
On 7/15/07, Hilaire Fernandes hilaire@ofset.org wrote:
Hilaire Fernandes a écrit :
I have found this strange bug: when persisting a TextMorph (System set with default font to Accujen 10), when I fetch it back from the DB its font size is Accujen 9 and not 10 anymore
A simple code like that exposes the problem (close the session between the two statements to effectively get the text morph from the database):
(session addBranch: #test with: 'HELLO' asTextMorph ) openInWorld textStyle ==> a TextStyle Accujen10
Then fetching back after a full close of the DB:
(session branch: #test) textStyle ==> a TextStyle Accujen09
Any idea ?
Hilaire
Some more elements:
TextStyle::fontArray an Array(a StrikeFont(Accujen09 12) a StrikeFont(Accujen10 12) a StrikeFont(Accujen12 15) a StrikeFont(Accujen14 17) a StrikeFont(Accujen18 22) a StrikeFont(Accujen24 30))
and TextStyle::fontArray an Array(a StrikeFont(Accujen09 12) a StrikeFont(Accujen09 12) a StrikeFont(Accujen12 15) a StrikeFont(Accujen14 17) a StrikeFont(Accujen18 22) a StrikeFont(Accujen24 30))
Magma mailing list Magma@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/magma
It looks like
With default text at Accujen12:
StrikeFont familyName: 'Accujen' size: 15 emphasized:0 ==> a StrikeFont(Accujen12 15)
But defaut text at Accujen10: StrikeFont familyName: 'Accujen' size: 12 emphasized:0 ==> a StrikeFont(Accujen09 12)
The problem seems to come from the font constructor which is external to Magma.
Changing the constructor #familyName:pointSize:emphasized: fix the problem there, but I don't if it is ok for the rest.
StrikeFont>>maAsStorageObject ^ DiskProxy global: #StrikeFont selector: #familyName:pointSize:emphasized: args: { self familyName. self pointSize. self emphasis }
May be StrikeFontSet should be updated the same.
Hilaire
magma@lists.squeakfoundation.org