The Trunk: Multilingual-nice.103.mcz

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

The Trunk: Multilingual-nice.103.mcz

commits-2
Nicolas Cellier uploaded a new version of Multilingual to project The Trunk:
http://source.squeak.org/trunk/Multilingual-nice.103.mcz

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

Name: Multilingual-nice.103
Author: nice
Time: 18 March 2010, 9:16:01.208 pm
UUID: 09d39534-f9f9-584f-8de5-682d5cc4712c
Ancestors: Multilingual-nice.102

Do not let MultiCharacterScanner reserve space for one more character et end of run.
This resolves FontTest>>testParagraphFallback

=============== Diff against Multilingual-nice.102 ===============

Item was changed:
  ----- Method: MultiCharacterScanner>>scanMultiCharactersCombiningFrom:to:in:rightX:stopConditions:kern: (in category 'scanner methods') -----
  scanMultiCharactersCombiningFrom: startIndex to: stopIndex in: sourceString rightX: rightX stopConditions: stops kern: kernDelta
 
  | charCode encoding f startEncoding combining combined combiningIndex c |
  lastIndex := startIndex.
  lastIndex > stopIndex ifTrue: [lastIndex := stopIndex. ^ stops endOfRun].
  startEncoding := (sourceString at: startIndex) leadingChar.
  font ifNil: [font := (TextConstants at: #DefaultMultiStyle) fontArray at: 1].
  ((font isMemberOf: StrikeFontSet) or: [font isKindOf: TTCFontSet]) ifTrue: [
  f := [font fontArray at: startEncoding + 1]
  on: Exception do: [:ex | nil].
  f ifNil: [ f := font fontArray at: 1].
  ].
 
  spaceWidth := font widthOf: Space.
  combining := nil.
  [lastIndex <= stopIndex] whileTrue: [
  charCode := (sourceString at: lastIndex) charCode.
  c := (sourceString at: lastIndex).
  combining ifNil: [
  combining := CombinedChar new.
  combining add: c.
  combiningIndex := lastIndex.
  lastIndex := lastIndex + 1.
  ] ifNotNil: [
  (combining add: c) ifFalse: [
  self addCharToPresentation: (combined := combining combined).
  combining := CombinedChar new.
  combining add: c.
  charCode := combined charCode.
  encoding := combined leadingChar.
  encoding ~= startEncoding ifTrue: [lastIndex := lastIndex - 1.
  (encoding = 0 and: [charCode < 256 and:[(stops at: charCode + 1) notNil]]) ifTrue: [
  ^ stops at: charCode + 1
  ] ifFalse: [
  ^ stops endOfRun
  ].
  ].
  (encoding = 0 and: [charCode < 256 and:[(stops at: charCode + 1) notNil]]) ifTrue: [
  combining ifNotNil: [
  self addCharToPresentation: (combining combined).
  ].
  ^ stops at: charCode + 1
  ].
  (self isBreakableAt: lastIndex in: sourceString in: Latin1Environment) ifTrue: [
  self registerBreakableIndex.
  ].
  destX > rightX ifTrue: [
  destX ~= firstDestX ifTrue: [
  lastIndex := combiningIndex.
  self removeLastCharFromPresentation.
  ^ stops crossedX]].
  combiningIndex := lastIndex.
  lastIndex := lastIndex + 1.
  ] ifTrue: [
  lastIndex := lastIndex + 1.
  numOfComposition := numOfComposition + 1.
  ].
  ].
  ].
  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!