[squeak-dev] The Trunk: Morphic-mt.1847.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Jan 18 08:13:42 UTC 2022


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

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

Name: Morphic-mt.1847
Author: mt
Time: 18 January 2022, 9:13:23.199362 am
UUID: 0a674705-b986-c24b-95a5-139cb07c243a
Ancestors: Morphic-mt.1846

Fixes regression from last commit. Shift+Red on window labels works again.

=============== Diff against Morphic-mt.1846 ===============

Item was changed:
  ----- Method: TextMorph>>font: (in category 'accessing') -----
  font: aFont
  	"Change the receiver's default font, which is used to draw its contents. Remove all custom font-face-related attributes from the current contents. Try to lookup the matching #textStyle so that TextFontChange can be used from here on. For a less harsh approach, just use #textStyle: instead and rely on text attributes.
  	
  	!! It is best practice to work with #textStyle: and rely on the text attributes TextFontChange and (sometimes) TextFontReference."
  
  	| newTextStyle |
  	self text removeAttributesThat: [:attr | attr isTextFontChange and: [attr canFontBeSubstituted]].
  
  	newTextStyle := aFont textStyleOrNil
  		ifNil: [TextStyle fontArray: {aFont}]
  		ifNotNil: [:style | style copy].
+ 	newTextStyle defaultFontIndex: (newTextStyle fontIndexOfPointSize: aFont pointSize).	
- 	newTextStyle defaultFontIndex: (newTextStyle fontIndexOf: aFont).	
  
+ 	aFont emphasis ~= 0 ifTrue: [
+ 		self text addAttribute: (TextEmphasis new emphasisCode: aFont emphasis; yourself)].
+ 
  	self textStyle: newTextStyle.!



More information about the Squeak-dev mailing list