[squeak-dev] Re: Making 4.1 test green - exercize #1
Nicolas Cellier
nicolas.cellier.aka.nice at gmail.com
Wed Mar 17 21:09:46 UTC 2010
2010/3/17 Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>:
> This evening: why (FontTest new testParagraphFallback) does fail ?
>
> Well, a collateral effect of Unicode leadingChar = 0...
>
> Since Unicode change, (EncodedCharSet scanSelectorAt: startEncoding) =
> #scanMultiCharactersCombiningFrom:to:in:rightX:stopConditions:kern:
> And this method behaves differently than previous
> #scanMultiCharactersFrom:to:in:rightX:stopConditions:kern:
>
> In effect, let's take a look at
> MultiCharacterScanner>>#scanMultiCharactersCombiningFrom:to:in:rightX:stopConditions:kern:
> scanMultiCharactersCombiningFrom: startIndex to: stopIndex in:
> sourceString rightX: rightX stopConditions: stops kern: kernDelta
> ...snip... lot of code
> lastIndex := stopIndex.
> combining ifNotNil: [
> combined := combining combined.
> self addCharToPresentation: combined.
> "assuming that there is always enough space for at least one character".
> destX := destX + (self widthOf: combined inFont: font).
> ].
> ^ stops endOfRun
>
> You see it ? It reserves the space for last character twice !
> self addCharToPresentation: combined. Once !
> destX := destX + (self widthOf: combined inFont: font). Twice !
>
> Well, I've got no idea why and I don't know if I can safely remove it...
> Any light ?
>
I just can tell that the test pass if I remove the destX := ...
> Nicolas
>
>
> P.S.
> There's probably more dust, because Henrik Johanssen told me that the
> change of encoding is no more detected as a stop condition in
> StrikeFont>>displayString:on:from:to:at:kern:baseLineY.
> Consequently, the fallback font is used for any ASCII character
> following a wide-character. Tricky!
>
More information about the Squeak-dev
mailing list
|