The Trunk: MultilingualTests-tpr.16.mcz

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

The Trunk: MultilingualTests-tpr.16.mcz

commits-2
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"!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: MultilingualTests-tpr.16.mcz

Nicolas Cellier
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 <[hidden email]>
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"!





Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: MultilingualTests-tpr.16.mcz

timrowledge

On 23-09-2013, at 6:05 PM, Nicolas Cellier <[hidden email]> wrote:

> When I read this code, unresolved questions come to my mind:
> Will (NewParagraph new) instantiate a NewNewParagraph?

No, just a new NewParagraph to use instead of causing multiple worries about new MultiNewParagraphs.

> Should we introduce a new (?) instance creation method (MultiNewParagraph old) just in case?

Wouldn't that (re)create an old instance conjured up from the ghost world?

> If so, should it instantiate a NewMultiOldParagraph, or an OldMultiNewOne.

Or a new MultiplyOldNewParagraph

> 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.

Don't bet on it. The nightmare will be back to get you. It's just that it will be while you're wide awake. Or *are you*!!!


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful random insult:- If you called him a wit, you'd be half right.



Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: MultilingualTests-tpr.16.mcz

Nicolas Cellier
not really


2013/9/24 tim Rowledge <[hidden email]>

On 23-09-2013, at 6:05 PM, Nicolas Cellier <[hidden email]> wrote:

> When I read this code, unresolved questions come to my mind:
> Will (NewParagraph new) instantiate a NewNewParagraph?

No, just a new NewParagraph to use instead of causing multiple worries about new MultiNewParagraphs.

> Should we introduce a new (?) instance creation method (MultiNewParagraph old) just in case?

Wouldn't that (re)create an old instance conjured up from the ghost world?

> If so, should it instantiate a NewMultiOldParagraph, or an OldMultiNewOne.

Or a new MultiplyOldNewParagraph

> 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.

Don't bet on it. The nightmare will be back to get you. It's just that it will be while you're wide awake. Or *are you*!!!


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful random insult:- If you called him a wit, you'd be half right.