Magma + FreeType font

Chris Muller asqueaker at gmail.com
Sun Dec 7 22:18:10 UTC 2008


Hi Hilaire, as a shortcut you can use

  MaObjectSerializer testMaterialize:  yourFontObject

which will break down the object into buffers with one serializer and
reconstitute it with a new serializer.

Explore the original and your reconstituted Font side-by-side, and
drill down all the way to see if there are any differences.

 - Chris


On Sat, Dec 6, 2008 at 5:42 AM, Hilaire Fernandes <hilaire at ofset.org> wrote:
> 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)
>                         }
>
> 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
>
> Segmentation fault
>
> 2043386704 FT2Face>setPixelWidth:height:
> 2043386052 FreeTypeFont>getLinearWidthOf:
> 2043385056 [] in FreeTypeFont>linearWidthOf:
> 2043384872 FreeTypeCache>atFont:charCode:type:ifAbsentPut:
> 2043384780 FreeTypeFont>linearWidthOf:
> 2043384688 FreeTypeFont>widthOf:
> 2043384596 LogicalFont>widthOf:
> 2043383952 CharacterScanner>setFont
> 2043383860 CompositionScanner>setFont
> 2043383760 CompositionScanner>setStopConditions
> 2043383656
> CompositionScanner>composeFrom:inRectangle:firstLine:leftSide:rightSide:
> 2043382952 TextComposer>composeEachRectangleIn:
> 2043382644 TextComposer>composeAllRectangles:
> 2043382552 TextComposer>composeOneLine
> 2043382460 TextComposer>composeAllLines
> 2043382368
> TextComposer>composeLinesFrom:to:delta:into:priorLines:atY:textStyle:text:container:wantsColumnBreaks:
> 2043383184 NewParagraph>composeLinesFrom:to:delta:into:priorLines:atY:
> 2043382276 NewParagraph>composeAll
> 2043382184 NewParagraph>compose:style:from:in:
> 2043382092 TextMorph>paragraph
> 2043380696 TextMorph>fit
> 2043373380 TextMorph>extent:
> 2043373288 Morph>bounds:
> 2043371348 Morph>layoutInBounds:
> 2043343140 TableLayout>layoutLeftToRight:in:
> 2043342184 TableLayout>layout:in:
> 2043338568 Morph>doLayoutIn:
> 2043333032 Morph>layoutInBounds:
> 2043297376 TableLayout>layoutTopToBottom:in:
> 2043297248 TableLayout>layout:in:
> 2043297120 Morph>doLayoutIn:
> 2043296936 [] in Morph>fullBounds
> 2043296844 BlockContext>on:do:
> 2043296752 Morph>fullBounds
> 2043296660 Morph>privateInvalidateMorph:
> 2043296520 Morph>privateAddMorph:atIndex:
> 2043296428 Morph>addMorph:inFrontOf:
> 2043296336 [] in Morph>addMorphInFrontOfLayer:
> 2043296244 SequenceableCollection>do:
> 2043296152 Morph>addMorphInFrontOfLayer:
> 2043296060 PasteUpMorph>addMorphFront:
> 2043295968 Morph>addMorph:
> 2043295876 Morph>openInWorld:
> 2043295784 Morph>openInWorld
> 2042502832 IFIMatchExoMorph>?
> 2042166172 UndefinedObject>?
> 2042162816 Compiler>evaluate:in:to:notifying:ifFail:logged:
> 2042162484 [] in ParagraphEditor>evaluateSelection
> 2042162300 BlockContext>on:do:
> 2042162208 ParagraphEditor>evaluateSelection
> 2042162116 ParagraphEditor>doIt
> 2042162392 [] in ParagraphEditor>doIt:
> 2042162024 Controller>terminateAndInitializeAround:
> 2042161932 ParagraphEditor>doIt:
> 2042161684 ParagraphEditor>dispatchOnCharacter:with:
> 2042161580 TextMorphEditor>dispatchOnCharacter:with:
> 2042161464 ParagraphEditor>readKeyboard
> 2042161372 TextMorphEditor>readKeyboard
> 2042161004 [] in TextMorph>keyStroke:
> 2042160912 TextMorph>handleInteraction:fromEvent:
> 2042160820 TextMorphForEditView>handleInteraction:fromEvent:
> 2042160728 TextMorph>keyStroke:
> 2042160580 TextMorphForEditView>keyStroke:
> 2042160488 TextMorph>handleKeystroke:
> 2042160120 KeyboardEvent>sentTo:
> 2042160028 Morph>handleEvent:
> 2042159936 Morph>handleFocusEvent:
> 2042160212 [] in HandMorph>sendFocusEvent:to:clear:
> 2042160304 [] in PasteUpMorph>becomeActiveDuring:
> 2042159844 BlockContext>on:do:
> 2042159752 PasteUpMorph>becomeActiveDuring:
> 2042159568 HandMorph>sendFocusEvent:to:clear:
> 2042159476 HandMorph>sendEvent:focus:clear:
> 2042159340 HandMorph>sendKeyboardEvent:
> 2042159248 HandMorph>handleEvent:
> 2042159028 HandMorph>processEvents
> 2042159120 [] in WorldState>doOneCycleNowFor:
> 2042158936 SequenceableCollection>do:
> 2042158844 WorldState>handsDo:
> 2042158752 WorldState>doOneCycleNowFor:
> 2042158660 WorldState>doOneCycleFor:
> 2042158568 PasteUpMorph>doOneCycle
> 2030389024 [] in >spawnNewProcess
> 2030389208 [] in BlockContext>newProcess
> Abandon
>
>
> _______________________________________________
> Magma mailing list
> Magma at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/magma
>
>


More information about the Magma mailing list