[squeak-dev] The Trunk: MultilingualTests-mt.43.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Apr 5 15:04:31 UTC 2022
Marcel Taeumel uploaded a new version of MultilingualTests to project The Trunk:
http://source.squeak.org/trunk/MultilingualTests-mt.43.mcz
==================== Summary ====================
Name: MultilingualTests-mt.43
Author: mt
Time: 5 April 2022, 5:04:30.780349 pm
UUID: b6f83d06-9399-4276-9fa4-1126c3aa6a45
Ancestors: MultilingualTests-mt.42
Fixes font tests.
=============== Diff against MultilingualTests-mt.42 ===============
Item was changed:
----- Method: FontTest>>testMultistringFallbackFont (in category 'tests') -----
testMultistringFallbackFont
"self debug: #testMultistringFallbackFont"
| text p style height width |
+ TextStyle defaultFont isFontSet ifFalse: [^ self].
+ TextStyle defaultFont fontArray
+ at: JapaneseEnvironment leadingChar
+ ifAbsent: [^ self].
- [(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 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 lineGrid.
width := p caretWidth + (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 'tests') -----
testMultistringFont
"self debug: #testMultistringFont"
| text p style height width |
+ TextStyle defaultFont isFontSet ifFalse: [^ self].
+ TextStyle defaultFont fontArray
+ at: JapaneseEnvironment leadingChar
+ ifAbsent: [^ self].
- [(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 lineGrid.
width := p caretWidth + (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 'tests') -----
testParagraph
"self debug: #testParagraph"
| text p style height width |
text := 'test' asText.
p := NewParagraph new.
style := TextStyle default.
p
compose: text
style: style
from: 1
in: (0 @ 0 corner: 1000000 @ 1000000).
"See CompositionScanner>>setActualFont: &
CompositionScanner>>composeFrom:inRectangle:firstLine:leftSide:rightSide:"
height := style defaultFont lineGrid.
width := (text
inject: 0
into: [:tally :next | tally
+ + (style defaultFont widthOf: next)]).
- + (style defaultFont widthOf: next)]) + p caretWidth. "because it is added by the paragraph formatting"
p adjustRightX.
self assert: p extent = (width @ height)!
Item was changed:
----- Method: FontTest>>testParagraphFallback (in category 'tests') -----
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: 1000000 @ 1000000).
"See CompositionScanner>>setActualFont: &
CompositionScanner>>composeFrom:inRectangle:firstLine:leftSide:rightSide:"
height := style defaultFont lineGrid.
width := (expect
inject: 0
into: [:tally :next | tally
+ + (style defaultFont widthOf: next)]).
- + (style defaultFont widthOf: next)]) + p caretWidth.
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>>testResetAfterEmphasized (in category 'tests') -----
testResetAfterEmphasized
"self debug: #testResetAfterEmphasized"
+ | normal code derivative |
- | normal derivative |
normal := TextStyle defaultFont.
+ code := TextEmphasis bold emphasisCode bitOr: TextEmphasis italic emphasisCode.
+ derivative := normal emphasized: code.
+ self assert: (normal derivativeFonts at: code) == derivative.
+ normal isTTCFont ifFalse: [
+ normal reset.
+ self assert: (normal derivativeFonts select:[:any| any isSynthetic]) isEmpty].
- derivative := normal emphasized: 3.
- self assert: (normal derivativeFonts at: 3) == derivative.
- normal reset.
- self assert: (normal derivativeFonts select:[:any| any isSynthetic]) isEmpty
!
More information about the Squeak-dev
mailing list
|