[squeak-dev] fonts, characterscanners and dead primitive 103

tim Rowledge tim at rowledge.org
Mon Sep 23 19:52:07 UTC 2013


On 23-09-2013, at 12:40 PM, tim Rowledge <tim at rowledge.org> wrote:

> I'm going to be very brave and commit my changes so far; nothing has broken on my system since making the changes. Obviously there is some chance it will be necessary to rewind but I consider it low.

Both packages (Graphics-tpr.226 & Multilingual-tpr.170) committed ok. 

REALLY IMPORTANT NOTE - the FreeType package needs two changes that I cannot make, lacking permissions to hit that file.

1) AbstractFont>widthAndKernedWidthOfLeft: leftCharacter right: rightCharacterOrNil into: aTwoElementArray
	"Set the first element of aTwoElementArray to the width of leftCharacter and 
	the second element to the width of left character when kerned with
	rightCharacterOrNil. Answer aTwoElementArray"
	"Actually, nearly all users of this actually want just the widthOf the leftCharacter, so we will default to that for speed. See other implementations for more complex cases - and note that this may be a temporary fix until scanners are improved"

	| w |
	w := self widthOf: leftCharacter.
	aTwoElementArray at: 1 put: w.
	aTwoElementArray at: 2 put: w

"	The old code, and what fonts which have pair-kerning would use - 
	w := self widthOf: leftCharacter.
	rightCharacterOrNil isNil
		ifTrue:[
			aTwoElementArray 
				at: 1 put: w; 
				at: 2 put: w]
		ifFalse:[
			k := self kerningLeft: leftCharacter right: rightCharacterOrNil.
			aTwoElementArray 
				at: 1 put: w; 
				at: 2 put: w+k].
	^aTwoElementArray
"	

2) FreeTypeFont (or whichever is the right name) >isPairKerningCapable
"a hopefully temporary test method; better factoring of scan/measure/display should remove the need for it.
Only FreeType fonts would currently add this to return true"
	^true


tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
I'm so skeptical that I'm not sure I'm really a skeptic




More information about the Squeak-dev mailing list