[squeak-dev] The Trunk: Morphic-mt.1866.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Feb 3 15:58:24 UTC 2022
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1866.mcz
==================== Summary ====================
Name: Morphic-mt.1866
Author: mt
Time: 3 February 2022, 4:58:18.363576 pm
UUID: 5d2d9711-dbfa-5d44-a2e5-f29b0a081d60
Ancestors: Morphic-mt.1865
Fixes a regression in TextMorph, which must support #font: without having any contents/text configured.
Thanks to Christoph (ct) for the pointer.
=============== Diff against Morphic-mt.1865 ===============
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. 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."
+ self text ifNotNil: [
+ self text removeAttributesThat: [:attr | attr isTextFontChange and: [attr canFontBeSubstituted]].
- self text removeAttributesThat: [:attr | attr isTextFontChange and: [attr canFontBeSubstituted]].
+ aFont emphasis ~= 0 ifTrue: [
+ self text addAttribute: (TextEmphasis new emphasisCode: aFont emphasis; yourself)]].
- aFont emphasis ~= 0 ifTrue: [
- self text addAttribute: (TextEmphasis new emphasisCode: aFont emphasis; yourself)].
self textStyle: aFont asNewTextStyle.!
More information about the Squeak-dev
mailing list
|