[squeak-dev] The Trunk: System-mt.1300.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Feb 3 15:27:31 UTC 2022
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1300.mcz
==================== Summary ====================
Name: System-mt.1300
Author: mt
Time: 3 February 2022, 4:27:27.276027 pm
UUID: 6bb978c2-9714-c846-b94b-4166a25fae48
Ancestors: System-dtl.1299
Complements Graphics-mt.471
=============== Diff against System-dtl.1299 ===============
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 |
- | f d newArray t isSet |
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)
ifTrue:[
| fonts |
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.
- newFont pixelSize: pointSize * 96 // 72.
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]
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
!
Item was changed:
----- Method: UserInterfaceTheme>>installSystemFont: (in category 'private - fonts') -----
installSystemFont: aFont
+ "Establish the default text font and style. Update the #defaultFontIndex in all known text styles to reflect the system's new default point size."
- "Establish the default text font and style"
| aStyle |
self flag: #todo. "mt: Support derivatives such as bold and italic."
aStyle := aFont textStyle.
aStyle defaultFontIndex: (aStyle fontIndexOfPointSize: aFont pointSize "drop emphasis").
TextStyle setDefault: aStyle.
+ TextStyle actualTextStyles "no defaults" do: [:ea |
+ ea isTTCStyle ifTrue: [ea defaultFont asPointSize: aFont pointSize "May generate new pointSize"].
+ ea defaultFontIndex: (ea fontIndexOfPointSize: aFont pointSize)].
+
RealEstateAgent resetScaleFactor.
Flaps replaceToolsFlap.
ScriptingSystem resetStandardPartsBin.!
Item was changed:
+ (PackageInfo named: 'System') postscript: '"Add missing sTypo values for our Bitstream Vera fonts."
+ TTFontDescription allInstancesDo: [:ea | (ea familyName beginsWith: ''Bitstream Vera'')
+ ifTrue: [ea setTypographicAscender: 1556 descender: -492 lineGap: 410 ]].
+
+ "Update #leading in all text styles using the default font''s #lineGap. Also remove all cached glyphs."
+ AbstractFont allSubInstancesDo: [ :font | font pixelsPerInchChanged ].
+ TextStyle allInstancesDo: [ :style | style pixelsPerInchChanged ].
+
+ "Fix default font sizes in existing text styles according to the current UserInterfaceTheme."
+ UserInterfaceTheme current installSystemFont: TextStyle defaultFont.'!
- (PackageInfo named: 'System') postscript: 'SystemNavigation initializeAuthors.
- AbstractFont setupDefaultFallbackTextStyle.'!
More information about the Squeak-dev
mailing list
|