Hi Hilaire,

> Date: Sat, 6 Dec 2008 12:42:16 +0100
> From: hilaire@ofset.org
> To: amtween@hotmail.com; pharo-project@lists.gforge.inria.fr
> Subject: Magma + FreeType font
>
> I am now using Pharo with FreeType fonts + Magmar41.1.
>
> The font I am using use the LogicalFont class (this is how I declare in
> my code the TT font I am using).
>
> I have extended LogicalFont to get it persisted:
>
> First with a new way to instantiate it:
>
> LogicalFont class>>familyName: familyName pointSize: pointSize emphasis:
> code
>
> ^ (self familyName: pointSize pointSize: pointSize) emphasis: code; yourself
>
> Then three methods for persistence, I copied the existing TType class
> persistence methods:
>
> maAsStorageObject
> "I am about to be written on an object file. Write a
> reference to a known FontSet in the other system instead."
> "a path to me"
> ^ DiskProxy
> global: #LogicalFont
> selector: #familyName:pointSize:emphasis:
> args: {
> (self familyName).
> (self pointSize).
> (self emphasis)
> }
>

Have a look at LogicalFont>>#objectForDataStream:
It is doing something similar to your method, and is creating a DiskProxy for DataStreams...
        DiskProxy global: #LogicalFont selector: #familyName:fallbackFamilyNames:pointSize:stretchValue:weightValue:slantValue:
   args: {self familyName. self fallbackFamilyNames. self pointSize. self stretchValue. self weightValue. self slantValue}.
 
Your code looks ok to me and should work fine; but you might try creating a DiskProxy in the manner above, and see if that cures your problem.
 
If that doesn't fix it, then do you have an image (+ database) that you can share so I can investigate further?
 
Thanks,
Andy  
 
 
> maUsesStandardStorage
>
> ^ false
>
> maWantsPreSerialization
> ^ true
>
>
> Basically these methods are used when I am persisting in the Magma
> Database a morph with some text.
>
> Now when I am fetching such Morph from the Magma data base in another
> image (with the same code extension) I got a Segmentation fault (the
> trace is included there).
>
> The crash is clearly happening in FreeType code, in the primitive
> called from FT2Face>setPixelWidth:height:
>
> Probably I got something wrong in my persistence code, I will be more
> than happy with any kind of tips.
>
> Thanks,
>
> Hilaire



Win John Lewis vouchers with BigSnapSearch.com Search now