[squeak-dev] The Trunk: MultilingualTests-tpr.16.mcz

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Tue Sep 24 01:05:27 UTC 2013


When I read this code, unresolved questions come to my mind:
Will (NewParagraph new) instantiate a NewNewParagraph?
Should we introduce a new (?) instance creation method (MultiNewParagraph
old) just in case?
If so, should it instantiate a NewMultiOldParagraph, or an OldMultiNewOne.
I'm sure that after a good sleep, this will evaporate, if only I don't
dream of a single of these old new multi things.


2013/9/24 <commits at source.squeak.org>

> tim Rowledge uploaded a new version of MultilingualTests to project The
> Trunk:
> http://source.squeak.org/trunk/MultilingualTests-tpr.16.mcz
>
> ==================== Summary ====================
>
> Name: MultilingualTests-tpr.16
> Author: tpr
> Time: 23 September 2013, 5:54:06.027 pm
> UUID: 9063751c-7262-4b5f-964b-e41f579bd078
> Ancestors: MultilingualTests-ul.15
>
> Remove references to MultiNewParagraph and replace with plain old
> NewParagraph
>
> =============== Diff against MultilingualTests-ul.15 ===============
>
> Item was changed:
>   ----- Method: FontTest>>testMultistringFallbackFont (in category
> 'testing') -----
>   testMultistringFallbackFont
>         "self debug: #testMultistringFallbackFont"
>         | text p style height width |
>         [(TextStyle default fontArray at: JapaneseEnvironment leadingChar)
>                 ifNil: [^ self]]
>                 ifError: [:err :rcvr | ^ self].
>         text := ((#(20983874 20983876 20983878 )
>                                 collect: [:e | e asCharacter])
>                                 as: String) asText.
> +       p := NewParagraph new.
> -       p := MultiNewParagraph new.
>         style := TextStyle new leading: 0; newFontArray: {Preferences
> standardFlapFont}.
>         p
>                 compose: text
>                 style: style
>                 from: 1
>                 in: (0 @ 0 corner: 100 @ 100).
>         "See CompositionScanner>>setActualFont: &
>
> CompositionScanner>>composeFrom:inRectangle:firstLine:leftSide:rightSide:"
>         height := style defaultFont height + style leading.
>         width := text
>                                 inject: 0
>                                 into: [:tally :next | tally
>                                                 + (style defaultFont
> widthOf: next)].
>         p adjustRightX.
>         self assert: p extent = (width @ height).
>         "Display getCanvas
>                 paragraph: p
>                 bounds: (10 @ 10 extent: 100 @ 100)
>                 color: Color black"!
>
> Item was changed:
>   ----- Method: FontTest>>testMultistringFont (in category 'testing') -----
>   testMultistringFont
>         "self debug: #testMultistringFont"
>         | text p style height width |
>         [(TextStyle default fontArray at: JapaneseEnvironment leadingChar)
>                 ifNil: [^ self]]
>                 ifError: [:err :rcvr | ^ self].
>         text := ((#(20983874 20983876 20983878 )
>                                 collect: [:e | e asCharacter])
>                                 as: String) asText.
> +       p := NewParagraph new.
> -       p := MultiNewParagraph new.
>         style := TextStyle default.
>         p
>                 compose: text
>                 style: style
>                 from: 1
>                 in: (0 @ 0 corner: 100 @ 100).
>         "See CompositionScanner>>setActualFont: &
>
> CompositionScanner>>composeFrom:inRectangle:firstLine:leftSide:rightSide:"
>         height := style defaultFont height + style leading.
>         width := text
>                                 inject: 0
>                                 into: [:tally :next | tally
>                                                 + (style defaultFont
> widthOf: next)].
>         p adjustRightX.
>         self assert: p extent = (width @ height).
>         "Display getCanvas
>                 paragraph: p
>                 bounds: (10 @ 10 extent: 100 @ 100)
>                 color: Color black"!
>
> Item was changed:
>   ----- Method: FontTest>>testParagraph (in category 'testing') -----
>   testParagraph
>         "self debug: #testParagraph"
>         | text p style height width |
>         text := 'test' asText.
> +       p := NewParagraph new.
> -       p := MultiNewParagraph new.
>         style := TextStyle default.
>         p
>                 compose: text
>                 style: style
>                 from: 1
>                 in: (0 @ 0 corner: 100 @ 100).
>         "See CompositionScanner>>setActualFont: &
>
> CompositionScanner>>composeFrom:inRectangle:firstLine:leftSide:rightSide:"
>         height := style defaultFont height + style leading.
>         width := text
>                                 inject: 0
>                                 into: [:tally :next | tally
>                                                 + (style defaultFont
> widthOf: next)].
>         p adjustRightX.
>         self assert: p extent = (width @ height)!
>
> Item was changed:
>   ----- Method: FontTest>>testParagraphFallback (in category 'testing')
> -----
>   testParagraphFallback
>         "self debug: #testParagraphFallback"
>         | text p style height width e expect |
>         e := (Character value: 257) asString.
>         text := ('test' , e , e , e , e , 'test') asText.
>         expect := 'test????test'.
> +       p := NewParagraph new.
> -       p := MultiNewParagraph new.
>         style := TextStyle default.
>         p
>                 compose: text
>                 style: style
>                 from: 1
>                 in: (0 @ 0 corner: 100 @ 100).
>         "See CompositionScanner>>setActualFont: &
>
> CompositionScanner>>composeFrom:inRectangle:firstLine:leftSide:rightSide:"
>         height := style defaultFont height + style leading.
>         width := expect
>                                 inject: 0
>                                 into: [:tally :next | tally
>                                                 + (style defaultFont
> widthOf: next)].
>         p adjustRightX.
>         self assert: p extent = (width @ height).
>         "Display getCanvas
>                 paragraph: p
>                 bounds: (10 @ 10 extent: 100 @ 100)
>                 color: Color black"!
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20130924/b8da0510/attachment.htm


More information about the Squeak-dev mailing list