[squeak-dev] The Trunk: System-mt.1313.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Feb 25 09:37:49 UTC 2022


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

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

Name: System-mt.1313
Author: mt
Time: 25 February 2022, 10:37:45.39663 am
UUID: fc3c8d83-1afd-7d41-8347-a215a8982ad0
Ancestors: System-mt.1312

Complements TrueType-mt.73

=============== Diff against System-mt.1312 ===============

Item was changed:
  ----- Method: TextStyle>>addNewFontSize: (in category '*System-Fonts') -----
  addNewFontSize: pointSize
  	"Add a font in specified size to the array of fonts."
  	| f d newArray t isSet priorDefault |
  	fontArray first emphasis ~= 0 ifTrue: [
  		t := TextConstants at: self fontArray first familyName asSymbol.
  		t fonts first emphasis = 0 ifTrue: [
  			^ t addNewFontSize: pointSize.
  		].
  	].
  
  	pointSize <= 0 ifTrue: [^ nil].
  	fontArray do: [:s |
  		s pointSize = pointSize ifTrue: [^ s].
  	].
  
  	(isSet := fontArray first isKindOf: TTCFontSet) 
+ 	ifFalse: [f := fontArray first copyWithPointSize: pointSize]
  	ifTrue:[
  		| fonts |
+ 		self flag: #legacy. "mt: There should be no new instances of TTCFontSet (or StrikeFontSet) anymore."
  		fonts := fontArray first fontArray collect: [ :font |
  			| newFont |
  			(font isNil)
  			ifTrue: [newFont := nil]
  			ifFalse: [
  				newFont := (font ttcDescription size > 256)
  					ifTrue: [MultiTTCFont new initialize]
  					ifFalse: [TTCFont new initialize].
  				newFont ttcDescription: font ttcDescription.
  				newFont pointSize: pointSize.
  				font derivativeFonts notEmpty ifTrue: [font derivativeFonts do: [ :proto |
  					proto ifNotNil: [
  						d := proto class new initialize.
  						d ttcDescription: proto ttcDescription.
  						d pixelSize: newFont pixelSize.
  						newFont derivativeFont: d]]].
  				].
  			newFont].
+ 		f := TTCFontSet newFontArray: fonts].
+ 	
- 		f := TTCFontSet newFontArray: fonts]
- 	ifFalse: [
- 		f := fontArray first class new initialize: fontArray first.
- 		f pointSize: pointSize.
- 		fontArray first derivativeFonts do: [:proto |
- 			proto ifNotNil: [
- 				d := TTCFont new initialize: proto.
- 				d pointSize: f pointSize.
- 				f derivativeFont: d.
- 			].
- 		].
- 	].
  	newArray := (fontArray copyWith: f) asArray sort: [:a :b | a pointSize <= b pointSize].
  	priorDefault := self defaultFont pointSize.
  	self newFontArray: newArray.
  	self defaultFontIndex: (self fontIndexOfPointSize: priorDefault).
  	isSet ifTrue: [
  		TTCFontSet register: newArray at: newArray first familyName asSymbol.
  	].
  	^ self fontOfPointSize: pointSize
  !



More information about the Squeak-dev mailing list