[Pkg] The Trunk: Graphics-tpr.256.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Oct 8 21:59:57 UTC 2013

tim Rowledge uploaded a new version of Graphics to project The Trunk:

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

Name: Graphics-tpr.256
Author: tpr
Time: 8 October 2013, 2:59:05.63 pm
UUID: 020da562-06be-4bfd-8f07-db6c3a1bb3d8
Ancestors: Graphics-tpr.255

Swap the CharacterScanner>scanCharactersFrom:to:in:rightX:stopConditions:kern: code to use the new scanning refactor; 
send the scan messages to the string, which passes it to the language encoder (if appropriate) which passes on to the font. Which in all current in-image cases, passes back the scanner with all the byte vs wide string, ascii vs unicode encoded language, and plain vs pair-kerning, all sorted out.

It is likely that FreeType font class(es) will want to implement their own version of the AbstractFont-character scanning protocol, possibly doing their own thing for scanning. At least they can now do that.

=============== Diff against Graphics-tpr.255 ===============

Item was changed:
  ----- Method: CharacterScanner>>scanCharactersFrom:to:in:rightX:stopConditions:kern: (in category 'scanning') -----
  scanCharactersFrom: startIndex to: stopIndex in: sourceString rightX: rightX stopConditions: stops kern: kernDelta 
+ 	^sourceString scanCharactersFrom: startIndex to: stopIndex with: self rightX: rightX font: font!
- 	| startEncoding selector |
- 	sourceString isByteString
- 		ifTrue: [font isPairKerningCapable
- 				ifTrue: [^ self
- 						basicScanKernableCharactersFrom: startIndex
- 						to: (stopIndex min: sourceString size)
- 						in: sourceString
- 						rightX: rightX
- 						stopConditions: stops
- 						kern: kernDelta]
- 				ifFalse: [^ self
- 						basicScanCharactersFrom: startIndex
- 						to: (stopIndex min: sourceString size)
- 						in: sourceString
- 						rightX: rightX
- 						stopConditions: stops
- 						kern: kernDelta]].
- 	sourceString isWideString
- 		ifTrue: [startIndex > stopIndex
- 				ifTrue: [lastIndex := stopIndex.
- 					^ stops endOfRun].
- 			startEncoding := (sourceString at: startIndex) leadingChar.
- 			selector := EncodedCharSet scanSelectorAt: startEncoding.
- 			^ self
- 				perform: selector
- 				withArguments: (Array
- 						with: startIndex
- 						with: stopIndex
- 						with: sourceString
- 						with: rightX
- 						with: stops
- 						with: kernDelta)].
- 	^ stops endOfRun!

More information about the Packages mailing list