[squeak-dev] The Trunk: Multilingual-tpr.172.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Sep 25 00:20:23 UTC 2013


tim Rowledge uploaded a new version of Multilingual to project The Trunk:
http://source.squeak.org/trunk/Multilingual-tpr.172.mcz

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

Name: Multilingual-tpr.172
Author: tpr
Time: 24 September 2013, 5:19:40.67 pm
UUID: 56a2c148-8831-4802-9d2d-64b68d334420
Ancestors: Multilingual-nice.171

Add some accessors to CombinedChar so that we can get rid of a nasty #isMemberOf:

=============== Diff against Multilingual-nice.171 ===============

Item was added:
+ ----- Method: CombinedChar>>asCharacter (in category 'accessing') -----
+ asCharacter
+ "return my base char"
+ 	^self base !

Item was added:
+ ----- Method: CombinedChar>>asInteger (in category 'accessing') -----
+ asInteger
+ "return my base chars asInteger"
+ 	^self base asInteger!

Item was added:
+ ----- Method: CombinedChar>>asciiValue (in category 'accessing') -----
+ asciiValue
+ "return my base chars ascii"
+ 	^self base asciiValue!

Item was added:
+ ----- Method: CombinedChar>>charCode (in category 'accessing') -----
+ charCode
+ "return my base chars charCode"
+ 	^self base charCode!

Item was added:
+ ----- Method: CombinedChar>>leadingChar (in category 'accessing') -----
+ leadingChar
+ "return my base chars leadingChar"
+ 	^self base leadingChar!

Item was changed:
  ----- Method: MultiCharacterScanner>>addCharToPresentation: (in category 'multilingual scanning') -----
  addCharToPresentation: char
  "appears to be unused"
+ 	lastWidth := font widthOf: char.
- 	lastWidth := self widthOf: char inFont: font.
  	destX := destX + lastWidth.!

Item was removed:
- ----- Method: MultiCharacterScanner>>widthOf:inFont: (in category 'multilingual scanning') -----
- widthOf: char inFont: aFont
- 
- 	(char isMemberOf: CombinedChar) ifTrue: [
- 		^ aFont widthOf: char base.
- 	] ifFalse: [
- 		^ aFont widthOf: char.
- 	].
- 
- 
- !

Item was changed:
  ----- Method: MultiDisplayScanner>>scanMultiCharactersCombiningFrom:to:in:rightX:stopConditions:kern: (in category 'multilingual scanning') -----
  scanMultiCharactersCombiningFrom: startIndex to: stopIndex in: sourceString rightX: rightX stopConditions: stops kern: kernDelta
  
  	| encoding f nextDestX startEncoding char charValue |
  	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 := f widthOf: Space.
  	].
  
  	[lastIndex <= stopIndex] whileTrue: [
  		encoding := (sourceString at: lastIndex) leadingChar.
  		encoding ~= startEncoding ifTrue: [lastIndex := lastIndex - 1. ^ stops endOfRun].
  		char := (sourceString at: lastIndex).
  		charValue := char charCode.
  		(encoding = 0 and: [charValue < 256 and:[(stops at: charValue + 1) notNil]]) 
  			ifTrue: [^stops at: charValue + 1].
+ 		nextDestX := destX + (font widthOf: char).
- 		nextDestX := destX + (self widthOf: char inFont: font).
  		nextDestX > rightX ifTrue: [^ stops crossedX].
  		destX := nextDestX + kernDelta.
  		lastIndex := lastIndex + 1.
  	].
  	lastIndex := stopIndex.
  	^ stops endOfRun!



More information about the Squeak-dev mailing list