The Trunk: Graphics-tpr.256.mcz

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

The Trunk: Graphics-tpr.256.mcz

commits-2
tim Rowledge uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-tpr.256.mcz

==================== 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!