[squeak-dev] The Trunk: MultilingualTests-pre.21.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Aug 16 12:50:51 UTC 2016


Patrick Rein uploaded a new version of MultilingualTests to project The Trunk:
http://source.squeak.org/trunk/MultilingualTests-pre.21.mcz

==================== Summary ====================

Name: MultilingualTests-pre.21
Author: pre
Time: 16 August 2016, 2:50:43.573572 pm
UUID: 3166c2ba-e4eb-2e4c-8f5a-d8da3db54479
Ancestors: MultilingualTests-tpr.20

Adds caretWidth to the MultilingualFontTests similar to the way other FontTests were updated before

=============== Diff against MultilingualTests-tpr.20 ===============

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.
  	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 := p caretWidth + (text
- 	width := text
  				inject: 0
  				into: [:tally :next | tally
+ 						+ (style defaultFont widthOf: next)]).
- 						+ (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.
  	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 := p caretWidth + (text
- 	width := text
  				inject: 0
  				into: [:tally :next | tally
+ 						+ (style defaultFont widthOf: next)]).
- 						+ (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"!



More information about the Squeak-dev mailing list