[squeak-dev] The Trunk: TrueType-mt.91.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Mar 16 14:12:35 UTC 2022


Marcel Taeumel uploaded a new version of TrueType to project The Trunk:
http://source.squeak.org/trunk/TrueType-mt.91.mcz

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

Name: TrueType-mt.91
Author: mt
Time: 16 March 2022, 3:12:34.388608 pm
UUID: 474d522a-122b-3c4f-a650-d4f8d00b2b69
Ancestors: TrueType-mt.90

Activate the speed-up as promised via TrueType-mt.90.

=============== Diff against TrueType-mt.90 ===============

Item was changed:
  ----- Method: TTCFont>>displayString:on:from:to:at:kern:baselineY: (in category 'displaying') -----
  displayString: aString on: aBitBlt from: startIndex to: stopIndex at: aPoint kern: kernDelta baselineY: baselineY
  
+ 	^ aString isByteString
+ 		ifTrue: [self displayByteString: aString on: aBitBlt from: startIndex to: stopIndex at: aPoint kern: kernDelta baselineY: baselineY]
+ 		ifFalse: [self displayMultiString: aString on: aBitBlt from: startIndex to: stopIndex at: aPoint kern: kernDelta baselineY: baselineY]!
- 	| form glyphInfo destX destY hereX nextX actualFont |
- 	destX := aPoint x.
- 	glyphInfo := Array new: 5.
- 	startIndex to: stopIndex do: [:charIndex |
- 		self glyphInfoOf: (aString at: charIndex) into: glyphInfo.
- 		form := glyphInfo at: 1.
- 		hereX := glyphInfo at: 2.
- 		nextX := glyphInfo at: 3.
- 		(actualFont := glyphInfo at: 5) ==  aBitBlt lastFont
- 			ifFalse: [actualFont installOn: aBitBlt].
- 		destY := baselineY - (glyphInfo at: 4). 
- 		aBitBlt sourceForm: form.
- 		aBitBlt destX: destX + form offset x.
- 		aBitBlt destY: destY + form offset y. "Compensate overdraw. See #extraScale:."
- 		aBitBlt sourceX: hereX; sourceY: 0.
- 		aBitBlt width: form width.
- 		aBitBlt height: form height.
- 		aBitBlt copyBits.
- 		destX := destX + (nextX - hereX) + kernDelta.
- 	].
- 	^ destX @ destY
- !

Item was changed:
  ----- Method: TTCFont>>formOf: (in category 'character shapes') -----
+ formOf: aCharacter
- formOf: char
  
+ 	(self hasGlyphOf: aCharacter)
+ 		ifFalse: [^ self fallbackFont formOf: aCharacter].
- 	| code form |
- 	cache ifNil: [self foregroundColor: Color black]. "make sure we have a cache"
  
+ 	^ self characterFormAt: aCharacter!
- 	code := char charCode.
- 	form := cache at: (code + 1).
- 
- 	form ifNil: [
- 		form := self computeForm: code.
- 		form ifNil:[^nil].
- 		cache at: code+1 put: form.
- 		GlyphCacheData at: (GlyphCacheIndex := GlyphCacheIndex \\ GlyphCacheSize + 1) put: form.
- 	].
- 	^form
- !

Item was changed:
  ----- Method: TTCFont>>glyphInfoOf:into: (in category 'displaying') -----
  glyphInfoOf: aCharacter into: glyphInfoArray
+ 	"return the glyph info for aCharacter; if I don't have such a character,
+ 	try my fallback font"
- 	"return the glyph info for aCharacter; if I don't have such a character, try my fallback font"
  
  	| form |
+ 	(self hasGlyphOf: aCharacter)
+ 		ifTrue: [
+ 			form := self characterFormAt: aCharacter]
+ 		ifFalse: [ | fallback |
+ 			(fallback := self fallbackFont) isTTCFont
+ 				ifFalse: [
+ 					"We MUST NOT use StrikeFont here bc. of their different
+ 					display loop and way to access glyphs."
+ 					form := self characterFormAt: Character null]
+ 				ifTrue: [
+ 					^ fallback
+ 						foregroundColor: self foregroundColor;
+ 						glyphInfoOf: aCharacter into: glyphInfoArray]].
- 	(self hasGlyphOf: aCharacter) ifFalse: [
- 		^ self fallbackFont
- 			foregroundColor: self foregroundColor;
- 			glyphInfoOf: aCharacter into: glyphInfoArray].
  		
- 	form := self formOf: aCharacter.
  	glyphInfoArray at: 1 put: form;
  		at: 2 put: 0; "hereX -- relative, unlike StrikeFont"
  		at: 3 put: form advanceWidth; "nextX -- relative, unlike StrikeFont"
  		at: 4 put: self ascent "(self ascentOf: aCharacter)";
  		at: 5 put: self.
+ 	^ glyphInfoArray.!
- 	^ glyphInfoArray.
- !

Item was changed:
  ----- Method: TTCFont>>widthOf: (in category 'measuring') -----
  widthOf: aCharacter
  	"Overwritten to use the #advanceWidth and not the #width of the form. See TTGlyphForm"
  
  	(self hasGlyphOf: aCharacter)
  		ifFalse: [^ self fallbackFont widthOf: aCharacter].
+ 	^(self characterFormAt: aCharacter) advanceWidth!
- 	^(self formOf: aCharacter) advanceWidth!



More information about the Squeak-dev mailing list