[squeak-dev] The Trunk: Graphics-mt.502.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Mar 16 14:13:24 UTC 2022
Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-mt.502.mcz
==================== Summary ====================
Name: Graphics-mt.502
Author: mt
Time: 16 March 2022, 3:13:16.655608 pm
UUID: d0d282d6-7707-5c46-9dcc-546f1b43f6c3
Ancestors: Graphics-mt.501
Activate the speed-up as promised via TrueType-mt.90.
=============== Diff against Graphics-mt.501 ===============
Item was changed:
----- Method: CharacterScanner>>basicScanByteCharactersFrom:to:in:rightX: (in category 'scanning') -----
basicScanByteCharactersFrom: startIndex to: stopIndex in: sourceString rightX: rightX
+ "This is a scanning method for single-byte characters in a ByteString
+ a font that does not do character-pair kerning."
+
+ | codePointPlusOne nextDestX char |
- "this is a scanning method for
- single byte characters in a ByteString
- a font that does not do character-pair kerning"
- | ascii nextDestX char |
lastIndex := startIndex.
[lastIndex <= stopIndex]
whileTrue: [
"get the character value"
char := sourceString at: lastIndex.
+ codePointPlusOne := char asInteger + 1.
- ascii := char asciiValue + 1.
"if there is an entry in 'stops' for this value, return it"
+ (stopConditions at: codePointPlusOne)
+ ifNotNil: [^ stopConditions at: codePointPlusOne].
- (stopConditions at: ascii)
- ifNotNil: [^ stopConditions at: ascii].
"bump nextDestX by the width of the current character"
+ nextDestX := destX + (font widthOfByteCharacter: char).
- nextDestX := destX + (font widthOf: char).
"if the next x is past the right edge, return crossedX"
nextDestX > rightX
ifTrue: [^#crossedX].
"update destX and incorporate thr kernDelta"
destX := nextDestX + kern.
lastIndex := lastIndex + 1].
^self handleEndOfRunAt: stopIndex
!
More information about the Squeak-dev
mailing list
|