[squeak-dev] The Trunk: Collections-mt.974.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Jan 17 16:11:24 UTC 2022


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

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

Name: Collections-mt.974
Author: mt
Time: 17 January 2022, 5:11:20.700958 pm
UUID: 19f04d7f-b86c-3b43-8d35-f50405d5477b
Ancestors: Collections-ct.973

Prepare Text to not spoil its instances with unnecessary TextFontChange attributes because text rendering relies on a view's current text style's default font anyway. Adds #canFontBeSubstituted to have an easy way to remove such attributes to have better control about font changes in TextMorph.

=============== Diff against Collections-ct.973 ===============

Item was changed:
  ----- Method: Text>>attributesAt:forStyle: (in category 'emphasis') -----
  attributesAt: characterIndex forStyle: aTextStyle
+ 	"Answer text attributes for characters in the run beginning at characterIndex."
+ 
+ 	^ self
+ 		ifEmpty: [#("Rely on TextStyle >> #defaultFontIndex")]
+ 		ifNotEmpty: [runs atPin: characterIndex]!
- 	"Answer the code for characters in the run beginning at characterIndex."
- 	| attributes |
- 	self size = 0
- 		ifTrue: [^ Array with: (TextFontChange new fontNumber: aTextStyle defaultFontIndex)].  "null text tolerates access"
- 	attributes := runs atPin: characterIndex.
- 	^ attributes!

Item was added:
+ ----- Method: TextAttribute>>isTextFontChange (in category 'testing') -----
+ isTextFontChange
+ 	^ false!

Item was added:
+ ----- Method: TextFontChange>>canFontBeSubstituted (in category 'testing') -----
+ canFontBeSubstituted
+ 	"Generic font changes rely on text styles, which should always contain generic fonts."
+ 	
+ 	^ true!

Item was added:
+ ----- Method: TextFontChange>>isTextFontChange (in category 'testing') -----
+ isTextFontChange
+ 	^ true!

Item was added:
+ ----- Method: TextFontReference>>canFontBeSubstituted (in category 'testing') -----
+ canFontBeSubstituted
+ 	"Absolute font references can only be replaced if the referenced font has different glyphs for different characters."
+ 
+ 	^ (self font class name = #FixedFaceFont "e.g. password font"
+ 		or: [self font class name = #FormSetFont "e.g. embedded pictures/forms"]) not!



More information about the Squeak-dev mailing list