Why TTComposite is a subclass of TTGlyph

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Why TTComposite is a subclass of TTGlyph

Stéphane Ducasse
TTGlyph subclass: #TTCompositeGlyph
        instanceVariableNames: 'glyphs'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'TrueType-Fonts'

This class represents a composite TrueType glyph, e.g.one which  
contains many simple TTGlyphs.

Does a TTCompositeGlyph needs all the state from its superclass?


Alain I'm going over the super initialize cs now.

TTGlyph>>initialize

        bounds := 0@0 corner: 0@0.
        contours := #().
        advanceWidth := 0.
        leftSideBearing := 0.
        rightSideBearing := 0.


but in the subclass

TTCompositeGlyph>>contours
        ^contours ifNil:[contours := self computeContours]


so if we change the initialize of the subclass then the countours will  
be never computed....

Stef

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Why TTComposite is a subclass of TTGlyph

Alain Plantec-4

> but in the subclass
>
> TTCompositeGlyph>>contours
> ^contours ifNil:[contours := self computeContours]
>
>
> so if we change the initialize of the subclass then the countours will  
> be never computed....
>  
damn! >:o
ok, seen well


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Why TTComposite is a subclass of TTGlyph

Stéphane Ducasse
This is why for this kind of changes 4 eyes are better than two :)

Stef

On Jun 8, 2009, at 10:28 PM, Alain Plantec wrote:

>
>> but in the subclass
>>
>> TTCompositeGlyph>>contours
>> ^contours ifNil:[contours := self computeContours]
>>
>>
>> so if we change the initialize of the subclass then the countours  
>> will
>> be never computed....
>>
> damn! >:o
> ok, seen well
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project