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

commits at source.squeak.org commits at source.squeak.org
Tue Mar 1 15:52:33 UTC 2022


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

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

Name: Graphics-mt.489
Author: mt
Time: 1 March 2022, 4:52:26.923172 pm
UUID: 7699a405-9499-7549-9985-d0ef424ae0df
Ancestors: Graphics-mt.488

Some quality-of-life enhancements for fonts:
- Look up the regular version of any font instance you have at hand via #asRegular (complements #isRegular)
- Use #larger or #smaller to resize a font (like Color's #darker or #lighter)
- Offer a way to access a default style and font that definitely uses flexible TrueType data, which is not the case, e.g., for our 100% default where a pre-rendered StrikeFont is used

=============== Diff against Graphics-mt.488 ===============

Item was added:
+ ----- Method: AbstractFont>>asRegular (in category 'converting') -----
+ asRegular
+ 	"Try to lookup the receiver with normal emphasis. If the receiver itself looks bold face, this might be okay. Rely on what is registered on the font family's text style. Not that this is different from #emphasized: with 0, which does nothing."
+ 	
+ 	self emphasis = 0 ifTrue: [^ self].
+ 	^ self textStyleOrNil
+ 		ifNil: [self]
+ 		ifNotNil: [:style | style fontOfPointSize: self pointSize]!

Item was added:
+ ----- Method: AbstractFont>>larger (in category 'converting') -----
+ larger
+ 	"Answer a font that is about 20% larger than the receiver but has the same font family and emphasis. Round to 0.5 points to not yield so many different font instances."
+ 	
+ 	^ self asPointSize: ((self pointSize asFloat * 1.2) roundTo: 0.5)!

Item was added:
+ ----- Method: AbstractFont>>smaller (in category 'converting') -----
+ smaller
+ 	"Answer a font that is about 20% smaller than the receiver but has the same font family and emphasis. Round to 0.5 points to not yield so many different font instances."
+ 
+ 	^ self asPointSize: ((self pointSize asFloat * 0.8) roundTo: 0.5)!

Item was added:
+ ----- Method: TextStyle class>>defaultTT (in category 'constants') -----
+ defaultTT
+ 	"Answer the default TrueType text style."
+ 
+ 	^ self default isTTCStyle
+ 		ifTrue: [self default]
+ 		ifFalse: [self named: #BitstreamVeraSans]!

Item was added:
+ ----- Method: TextStyle class>>defaultTTFont (in category 'constants') -----
+ defaultTTFont
+ 
+ 	^ self defaultTT defaultFont!



More information about the Squeak-dev mailing list