[Pkg] The Trunk: Graphics-ul.178.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Feb 14 02:56:02 UTC 2011


Levente Uzonyi uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-ul.178.mcz

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

Name: Graphics-ul.178
Author: ul
Time: 14 February 2011, 3:55:25.148 am
UUID: 4e376b6c-6266-9e49-9a34-a9f3c674b277
Ancestors: Graphics-ul.177

- fix: characterToGlyphMap is nil for StrikeFonts with more than 256 characters, which will raise an error in #widthOf:. I think it would be better to use something like IdentityGlyphMap with such StrikeFonts (maybe all of them?).

=============== Diff against Graphics-ul.177 ===============

Item was changed:
  ----- Method: StrikeFont>>widthOf: (in category 'accessing') -----
  widthOf: aCharacter 
  	"Answer the width of the argument as a character in the receiver."
  	| code |
  	code := aCharacter charCode.
+ 	(self characterToGlyphMap notNil and: [ 
+ 		characterToGlyphMap size > code ]) ifTrue: [
+ 			code := characterToGlyphMap at: code + 1 ].
- 	self characterToGlyphMap size > code ifTrue: [
- 		code := characterToGlyphMap at: code + 1 ].
  	((code < minAscii or: [maxAscii < code]) 
  		or: [(xTable at: code + 1) < 0])
  			ifTrue: [^ self fallbackFont widthOf: aCharacter].
  	^ (xTable at: code + 2) - (xTable at: code + 1)!



More information about the Packages mailing list