[squeak-dev] The Trunk: Graphics-mt.533.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Aug 11 09:03:32 UTC 2022


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

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

Name: Graphics-mt.533
Author: mt
Time: 11 August 2022, 11:03:26.624716 am
UUID: b88c0a4b-3f7a-5d49-bc62-9bd70017a75f
Ancestors: Graphics-mt.532

Minor fix for "holes" in the xTable of (legacy) StrikeFonts. For example, the "JapaneseEnvironment new installFont" will load a StrikeFont with a lot of glyphs but holes in the xTable.

=============== Diff against Graphics-mt.532 ===============

Item was changed:
  ----- Method: StrikeFont>>hasGlyphForCode: (in category 'private') -----
  hasGlyphForCode: aCharacterCode
  	"Note that missing glyphs are encoded as -1 in the xTable but to speed up the #widthOf: check, the next offset must be adjacent and thus be duplicated. For example: #(-1 -1 0 24 -1 -1 -1 24 48 -1 ...). Since aCharacterCode is 0-based, that codes offset is at +1 while its width needs to consult +2, too. See #widthOf:." 
  
+ 	| here next |
  	(aCharacterCode between: self minAscii and: self maxAscii)
  		ifFalse: [^ false].
+ 	(here := xTable at: aCharacterCode + 1) >= 0
- 	(xTable at: aCharacterCode + 1) >= 0
  		ifFalse: [^ false].
+ 	(next := xTable at: aCharacterCode + 2) >= 0
- 	(xTable at: aCharacterCode + 2) >= 0
  		ifFalse: [^ false].
+ 	(next - here) > 0
+ 		ifFalse: [^ false].
  	^ true!



More information about the Squeak-dev mailing list