The Trunk: MultilingualTests-tpr.20.mcz

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

The Trunk: MultilingualTests-tpr.20.mcz

commits-2
tim Rowledge uploaded a new version of MultilingualTests to project The Trunk:
http://source.squeak.org/trunk/MultilingualTests-tpr.20.mcz

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

Name: MultilingualTests-tpr.20
Author: tpr
Time: 20 January 2016, 6:08:00.796359 pm
UUID: f3143cf4-b0b2-43d3-9549-55c4c2e56070
Ancestors: MultilingualTests-tpr.19

testParagraphFallback also needs to handle the caret width

=============== Diff against MultilingualTests-tpr.19 ===============

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