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

commits at source.squeak.org commits at source.squeak.org
Sat Feb 5 17:56:48 UTC 2022


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

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

Name: Graphics-mt.474
Author: mt
Time: 5 February 2022, 6:56:41.83018 pm
UUID: 3a42eb99-d489-124d-bced-7310a979dbe1
Ancestors: Graphics-mt.473

Fixes endless recursion issue for fonts that do not answer "true" for #hasGlyphOf: for their #minCodePoint.

=============== Diff against Graphics-mt.473 ===============

Item was changed:
  ----- Method: FixedFaceFont>>baseFont: (in category 'accessing') -----
  baseFont: aFont
  	baseFont := aFont.
+ 	self fixSubstitutionCharacter.!
- 	substitutionCharacter ifNotNil: [
- 		substitutionCharacter := substitutionCharacter max: self minSubstitutionCharacter].!

Item was changed:
  ----- Method: FixedFaceFont>>errorFont (in category 'initialize-release') -----
  errorFont
  	displaySelector := #displayErrorOn:length:at:kern:baselineY:.
+ 	substitutionCharacter := self errorCharacter.
+ 	self fixSubstitutionCharacter.!
- 	substitutionCharacter := self errorCharacter max: self minSubstitutionCharacter.!

Item was added:
+ ----- Method: FixedFaceFont>>fixSubstitutionCharacter (in category 'private') -----
+ fixSubstitutionCharacter
+ 	
+ 	substitutionCharacter ifNil: [^ self].
+ 	baseFont ifNil: [^ self].
+ 	(baseFont hasGlyphOf: substitutionCharacter) ifTrue: [^ self].
+ 
+ 	(baseFont minCodePoint to: baseFont maxCodePoint)
+ 		detect: [:codePoint | baseFont hasGlyphOf: (Character value: codePoint)]
+ 		ifFound: [:codePoint | substitutionCharacter := Character value: codePoint]
+ 		ifNone: [
+ 			baseFont := TextStyle defaultFont.
+ 			substitutionCharacter := $?].	
+ 	self
+ 		assert: [baseFont hasGlyphOf: substitutionCharacter]
+ 		description: 'Could not find a possible substitution character and font!!'.!

Item was changed:
  ----- Method: FixedFaceFont>>passwordFont (in category 'initialize-release') -----
  passwordFont
  	displaySelector := #displayPasswordOn:length:at:kern:baselineY:.
+ 	substitutionCharacter := self passwordCharacter.
+ 	self fixSubstitutionCharacter.!
- 	substitutionCharacter := self passwordCharacter max: self minSubstitutionCharacter.!



More information about the Squeak-dev mailing list