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

commits at source.squeak.org commits at source.squeak.org
Thu Dec 30 15:25:07 UTC 2021


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

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

Name: System-mt.1273
Author: mt
Time: 30 December 2021, 4:25:04.081748 pm
UUID: 0ebc119d-96a6-7d40-93d5-92bf611c9f87
Ancestors: System-mt.1272

Complements Graphics-mt.455

All pointSizes for pre-rendered fonts are updated to match 96.0 pixels-per-inch.

=============== Diff against System-mt.1272 ===============

Item was changed:
  ----- Method: CommunityTheme class>>addDarkFonts: (in category 'instance creation') -----
  addDarkFonts: aUserInterfaceTheme
  	"Set-up fonts."
  	aUserInterfaceTheme
+ 		set: #balloonHelpFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7.5 emphasized: TextEmphasis italic emphasisCode];
+ 		set: #standardButtonFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7.5];
+ 		set: #standardCodeFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardFlapFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 7.5 emphasized: TextEmphasis bold emphasisCode];
+ 		set: #haloLabelFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardListFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardMenuFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardSystemFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 10.5];
+ 		set: #windowTitleFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 10.5 emphasized: TextEmphasis bold emphasisCode]!
- 		set: #balloonHelpFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7 emphasized: TextEmphasis italic emphasisCode];
- 		set: #standardButtonFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7];
- 		set: #standardCodeFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 9];
- 		set: #standardFlapFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 7 emphasized: TextEmphasis bold emphasisCode];
- 		set: #haloLabelFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9];
- 		set: #standardListFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 9];
- 		set: #standardMenuFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 9];
- 		set: #standardSystemFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 9];
- 		set: #windowTitleFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 9 emphasized: TextEmphasis bold emphasisCode]!

Item was changed:
  ----- Method: MonokaiTheme class>>addDarkFonts: (in category 'instance creation') -----
  addDarkFonts: theme
  
  	"Set-up fonts."
  	theme
+ 		set: #balloonHelpFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7.5];
+ 		set: #standardButtonFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7.5];
+ 		set: #standardCodeFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardFlapFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7.5 emphasized: TextEmphasis bold emphasisCode];
+ 		set: #haloLabelFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardListFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardMenuFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardSystemFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 10.5];
+ 		set: #windowTitleFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 10.5].!
- 		set: #balloonHelpFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7];
- 		set: #standardButtonFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7];
- 		set: #standardCodeFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9];
- 		set: #standardFlapFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7 emphasized: TextEmphasis bold emphasisCode];
- 		set: #haloLabelFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9];
- 		set: #standardListFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9];
- 		set: #standardMenuFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9];
- 		set: #standardSystemFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9];
- 		set: #windowTitleFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9].!

Item was removed:
- ----- Method: Preferences class>>changeFontSize: (in category 'prefs - fonts') -----
- changeFontSize: delta
- 	| theme base fonts |
- 	delta = 0 ifTrue: [self restoreDefaultFonts].
- 	(UserInterfaceTheme current name beginsWith: 'Demo')
- 		ifFalse: [
- 			"Create DEMO version of current theme."
- 			theme := UserInterfaceTheme named: 'Demo'.
- 			theme merge: UserInterfaceTheme current overwrite: true.
- 			theme apply].
- 
- 	base := (TextStyle defaultFont name beginsWith: 'Darkmap')
- 		ifTrue: ['Darkmap DejaVu Sans'] ifFalse: ['Bitmap DejaVu Sans'].
- 
- 	fonts := {
- 		{#SystemFont. base}.
- 		{#FixedFont. 'BitstreamVeraSansMono'}.
- 		{#ListFont. base}.
- 		{#FlapFont. base}.
- 		{#EToysFont. base}.
- 		{#PaintBoxButtonFont. base}.
- 		{#MenuFont. base}.
- 		{#WindowTitleFont. base, ' B'}.
- 		{#BalloonHelpFont. base}.
- 		{#CodeFont. base}.
- 		{#ButtonFont. base}.
- 	} collect: [:ary || newPtSize |
- 		newPtSize := (self perform: ('standard', ary first) asSymbol) pointSize + delta.
- 		{('set', ary first, 'To:') asSymbol. ary second. newPtSize}
- 	].
- 	self setDefaultFonts: fonts.
- !

Item was changed:
  ----- Method: Preferences class>>decreaseFontSize (in category 'prefs - fonts') -----
  decreaseFontSize
  
+ 	Display uiScaleFactor: Display uiScaleFactor - 0.25.!
- 	self changeFontSize: -3.
- !

Item was changed:
  ----- Method: Preferences class>>displaySizeChanged (in category 'updating - system') -----
  displaySizeChanged
+ 
- 	self flag: #todo.
  	self tinyDisplay
  		ifTrue: [self enable: #scrollBarsNarrow]
  		ifFalse: [self disable: #scrollBarsNarrow].
  	self tinyDisplay 
  		ifTrue:[self disable: #biggerHandles] 
+ 		ifFalse:[self enable: #biggerHandles].
+ 	UserInterfaceTheme current apply.!
- 		ifFalse:[self enable: #biggerHandles]!

Item was changed:
  ----- Method: Preferences class>>fontConfigurationMenu: (in category 'prefs - fonts') -----
  fontConfigurationMenu: aMenu
  
  	aMenu removeAllMorphs.
+ 	aMenu defaultTarget: self.
+ 	aMenu addTitle: 'Fonts' translated.
- 	aMenu addTitle: 'Standard System Fonts' translated.
  	aMenu addStayUpIcons.
  	
  	aMenu add: 'default text font...' translated action: #chooseSystemFont.
  	aMenu lastItem font: Preferences standardSystemFont.
  	aMenu balloonTextForLastItem: 'Choose the default font to be used for code and  in workspaces, transcripts, etc.' translated.
  	
  	aMenu add: 'default fixed font...' translated action: #chooseFixedFont.
  	aMenu lastItem font: Preferences standardFixedFont.
  	aMenu balloonTextForLastItem: 'Choose the default font to be used for text that needs fixed width characters for layouting etc.' translated.
  	
+ 	aMenu addLine.
+ 
+ 	aMenu add: 'code font...' translated action: #chooseCodeFont. 
+ 	aMenu lastItem font: Preferences standardCodeFont. 
+ 	aMenu balloonTextForLastItem: 'Choose the font to be used in code panes.' translated.
+ 
  	aMenu add: 'list font...' translated action: #chooseListFont.
  	aMenu lastItem font: Preferences standardListFont.
  	aMenu balloonTextForLastItem: 'Choose the font to be used in list panes' translated.
- 	
- 	aMenu add: 'flaps font...' translated action: #chooseFlapsFont.
- 	aMenu lastItem font: Preferences standardFlapFont.
- 	aMenu balloonTextForLastItem: 'Choose the font to be used on textual flap tabs' translated.
  
+ 	aMenu add: 'menu font...' translated action: #chooseMenuFont.
+ 	aMenu lastItem font: Preferences standardMenuFont.
+ 	aMenu balloonTextForLastItem: 'Choose the font to be used in menus' translated.
+ 
+ 	aMenu add: 'button font...' translated action: #chooseStandardButtonFont.
+ 	aMenu lastItem font: Preferences standardButtonFont.
+ 	aMenu balloonTextForLastItem: 'Choose the font to be used in buttons.' translated.
+ 
+ 	aMenu add: 'balloon-help font...' translated action: #chooseBalloonHelpFont.
+ 	aMenu lastItem font: Preferences standardBalloonHelpFont.
+ 	aMenu balloonTextForLastItem: 'choose the font to be used when presenting balloon help.' translated.
+ 
+ 	aMenu addLine.	
+ 
+ "	aMenu add: 'eToys font...' translated action: #chooseEToysFont.
- 	aMenu add: 'eToys font...' translated action: #chooseEToysFont.
  	aMenu lastItem font: Preferences standardEToysFont.
  	aMenu balloonTextForLastItem: 'Choose the font to be used on eToys environment' translated.
  
  	aMenu add: 'eToys title font...' translated action: #chooseEToysTitleFont.
  	aMenu lastItem font: Preferences standardEToysTitleFont.
  	aMenu balloonTextForLastItem: 'Choose the font to be used in titles on eToys environment' translated.
+ "
- 
- 	aMenu add: 'halo label font...' translated action: #chooseHaloLabelFont.
- 	aMenu lastItem font: Preferences standardHaloLabelFont.
- 	aMenu balloonTextForLastItem: 'Choose the font to be used on labels ih halo' translated.
- 
- 	aMenu add: 'menu font...' translated action: #chooseMenuFont.
- 	aMenu lastItem font: Preferences standardMenuFont.
- 	aMenu balloonTextForLastItem: 'Choose the font to be used in menus' translated.
- 	
  	aMenu add: 'window-title font...' translated action: #chooseWindowTitleFont.
  	aMenu lastItem font: Preferences windowTitleFont.
  	aMenu balloonTextForLastItem: 'Choose the font to be used in window titles.' translated.
  
+ 	aMenu add: 'halo-label font...' translated action: #chooseHaloLabelFont.
+ 	aMenu lastItem font: Preferences standardHaloLabelFont.
+ 	aMenu balloonTextForLastItem: 'Choose the font to be used on labels ih halo' translated.	
- 	aMenu add: 'balloon-help font...' translated action: #chooseBalloonHelpFont.
- 	aMenu lastItem font: Preferences standardBalloonHelpFont.
- 	aMenu balloonTextForLastItem: 'choose the font to be used when presenting balloon help.' translated.
- 	
- 	aMenu add: 'code font...' translated action: #chooseCodeFont. 
- 	aMenu lastItem font: Preferences standardCodeFont. 
- 	aMenu balloonTextForLastItem: 'Choose the font to be used in code panes.' translated.
  
+ 	aMenu add: 'flaps font...' translated action: #chooseFlapsFont.
+ 	aMenu lastItem font: Preferences standardFlapFont.
+ 	aMenu balloonTextForLastItem: 'Choose the font to be used on textual flap tabs' translated.
- 	aMenu add: 'button font...' translated action: #chooseStandardButtonFont.
- 	aMenu lastItem font: Preferences standardButtonFont.
- 	aMenu balloonTextForLastItem: 'Choose the font to be used in buttons.' translated.
  
+ 
  	aMenu addLine.
+ 	aMenu addItem: [:item |
+ 		item
+ 			contents: 'set scale factor' translated;
+ 			subMenuUpdater: TheWorldMainDockingBar instance
+ 			selector: #scaleFactorsOn:].
+ 	aMenu add: 'decrease font size (-)' translated action: #decreaseFontSize.
+ 	aMenu balloonTextForLastItem: 'Decrease the current scale factor by 25% to make fonts look smaller' translated.
+ 	aMenu add: 'increase font size (+)' translated action: #increaseFontSize.
+ 	aMenu balloonTextForLastItem: 'Increase the current scale factor by 25% to make fonts look bigger' translated.
- 	aMenu add: 'demo/hi-dpi mode' translated action: #setDemoFonts.
- 	aMenu balloonTextForLastItem: 'Set Fonts usable for giving a presentation' translated.
  
  	aMenu addLine.
  	aMenu add: 'restore default font choices' translated action: #restoreDefaultFonts.
  	aMenu balloonTextForLastItem: 'Use the standard system font defaults' translated.
  	
  	aMenu add: 'print current font choices' translated action: #printStandardSystemFonts.
  	aMenu balloonTextForLastItem: 'Print the standard system font defaults to the Transcript' translated.
  	
  	aMenu addLine.
  	aMenu add: 'refresh this menu' translated target: self selector: #fontConfigurationMenu:  argument: aMenu.
  	aMenu balloonTextForLastItem: 'Update this menu to reflect the current fonts' translated.
  	MenuIcons decorateMenu: aMenu.
  	^ aMenu!

Item was changed:
  ----- Method: Preferences class>>increaseFontSize (in category 'prefs - fonts') -----
  increaseFontSize
  
+ 	Display uiScaleFactor: Display uiScaleFactor + 0.25.!
- 	self changeFontSize: 3.
- !

Item was changed:
  ----- Method: Preferences class>>restoreDefaultFonts (in category 'prefs - fonts') -----
  restoreDefaultFonts
- 	"Since this is called from menus, we can take the opportunity to prompt for missing font styles."
  	"
  	Preferences restoreDefaultFonts
  	"
  	
+ 	TheWorldMainDockingBar instance resetAllThemes.!
- 	UserInterfaceTheme allThemes
- 		detect: [:ea | UserInterfaceTheme current name ~= ea name
- 			and: [UserInterfaceTheme current name includesSubstring: ea name]]
- 		ifFound: [:ea | 
- 			(Project uiManager
- 				confirm: ('Do you want to apply\"{1}"?' translated withCRs format: {ea name})
- 				title: 'Apply UI Theme' translated) ifTrue: [ea apply]]
- 		ifNone: [self inform: 'Sorry, could not revert font choices.\Please apply a UI theme with smaller fonts.' translated withCRs].!

Item was changed:
  ----- Method: Preferences class>>setBalloonHelpFontTo: (in category 'prefs - fonts') -----
  setBalloonHelpFontTo: aFont
  
+ 	UserInterfaceTheme setFont: #balloonHelpFont to: aFont.!
- 	UserInterfaceTheme current
- 		set: #balloonHelpFont
- 		to: aFont;
- 		apply.!

Item was changed:
  ----- Method: Preferences class>>setButtonFontTo: (in category 'prefs - fonts') -----
  setButtonFontTo: aFont
  
+ 	UserInterfaceTheme setFont: #standardButtonFont to: aFont.!
- 	UserInterfaceTheme current
- 		set: #standardButtonFont
- 		to: aFont;
- 		apply.!

Item was changed:
  ----- Method: Preferences class>>setCodeFontTo: (in category 'prefs - fonts') -----
  setCodeFontTo: aFont
  	"Establish the code font."
  
+ 	UserInterfaceTheme setFont: #standardCodeFont to: aFont.!
- 	UserInterfaceTheme current
- 		set: #standardCodeFont
- 		to: aFont;
- 		apply.!

Item was removed:
- ----- Method: Preferences class>>setDefaultFonts: (in category 'prefs - fonts') -----
- setDefaultFonts: defaultFontsSpec
- 	"Since this is called from menus, we can take the opportunity to prompt for missing font styles."
- 
- 	| fontNames map emphases |
- 	fontNames := defaultFontsSpec collect: [:array | array second].
- 	map := IdentityDictionary new.
- 	emphases := IdentityDictionary new.
- 	fontNames do: [:originalName | | decoded style |
- 		decoded := TextStyle decodeStyleName: originalName.
- 		style := map at: originalName put: (TextStyle named: decoded second).
- 		emphases at: originalName put: decoded first.
- 		style ifNil: [map at: originalName put: TextStyle default]].
- 
- 	UserInterfaceTheme current applyAfter: [
- 		defaultFontsSpec do: [:triplet | self
- 			perform: triplet first
- 			with: (((map at: triplet second) fontOfPointSize: triplet third) emphasized: (emphases at: triplet second))]].!

Item was changed:
  ----- Method: Preferences class>>setDemoFonts (in category 'prefs - fonts') -----
  setDemoFonts
+ 	"Originally, demo fonts where just bigger fonts to be used on a larger display such as a projector. By now, we treat demo fonts as being 50% larger than what the platform*s scale factor suggests.
+ 	Preferences setDemoFonts
+ 	"
- 	"Preferences setDemoFonts"
  
+ 	Display uiScaleFactor: Display platformScaleFactor * 1.5.!
- 	| theme base |
- 	self inform: 'The current UI theme will be copied\and larger fonts be installed.' translated withCRs.
- 	
- 	(UserInterfaceTheme current name beginsWith: 'Demo')
- 		ifFalse: [
- 			UserInterfaceTheme allThemes
- 				detect: [:ea | (ea name beginsWith: 'Demo')
- 					and: [ea name endsWith: UserInterfaceTheme current name]]
- 				ifFound: [:uit | uit apply]
- 				ifNone: [			
- 					"Create DEMO version of current theme."
- 					theme := UserInterfaceTheme named: 'Demo'.
- 					theme merge: UserInterfaceTheme current overwrite: true.
- 					theme apply]].
- 
- 	base := (TextStyle defaultFont name beginsWith: 'Darkmap')
- 		ifTrue: ['Darkmap DejaVu Sans'] ifFalse: ['Bitmap DejaVu Sans'].
- 
- 	self setDefaultFonts: {
- 		{#setSystemFontTo:. base. 14}.
- 		{#setFixedFontTo:. 'BitstreamVeraSansMono'. 16}.
- 		{#setListFontTo:. base. 14}.
- 		{#setFlapsFontTo:. base. 12}.
- 		{#setEToysFontTo:. base. 14}.
- 		{#setPaintBoxButtonFontTo:. base. 14}.
- 		{#setMenuFontTo:. base	. 14}.
- 		{#setWindowTitleFontTo:. base, ' B'. 	14}.
- 		{#setBalloonHelpFontTo:. base. 12}.
- 		{#setCodeFontTo:. base. 14}.
- 		{#setButtonFontTo:. base. 	12}.
- 	}
- !

Item was changed:
  ----- Method: Preferences class>>setEToysFontTo: (in category 'prefs - fonts') -----
  setEToysFontTo: aFont 
  	"change the font used in eToys environment"
  
+ 	UserInterfaceTheme setFont: #eToysFont to: aFont.!
- 	UserInterfaceTheme current
- 		set: #eToysFont
- 		to: aFont;
- 		apply.!

Item was changed:
  ----- Method: Preferences class>>setEToysTitleFontTo: (in category 'prefs - fonts') -----
  setEToysTitleFontTo: aFont 
  	"change the font used in eToys environment"
  
+ 	UserInterfaceTheme setFont: #eToysTitleFont to: aFont.!
- 	UserInterfaceTheme current
- 		set: #eToysTitleFont
- 		to: aFont;
- 		apply.!

Item was changed:
  ----- Method: Preferences class>>setFixedFontTo: (in category 'prefs - fonts') -----
  setFixedFontTo: aFont
- 	"Establish the default fixed text font and style"
  
+ 	UserInterfaceTheme setFixedFontTo: aFont.!
- 	| aStyle newDefaultStyle |
- 	aFont ifNil: [^ self].
- 	aStyle := aFont textStyle ifNil: [^ self].
- 	
- 	newDefaultStyle := aStyle copy.
- 	newDefaultStyle defaultFontIndex: (aStyle fontIndexOf: aFont).
- 
- 	UserInterfaceTheme current
- 		set: #standardFixedFont to: aFont;
- 		apply.
- 
- 	TextStyle setDefaultFixed: newDefaultStyle.!

Item was changed:
  ----- Method: Preferences class>>setFlapFontTo: (in category 'prefs - fonts') -----
  setFlapFontTo: aFont
  
+ 	UserInterfaceTheme setFont: #standardFlapFont to: aFont.
+ 	
- 	UserInterfaceTheme current
- 		set: #standardFlapFont
- 		to: aFont;
- 		apply.	
- 		
  	"FlapTab allSubInstancesDo:
  		[:aFlapTab | aFlapTab reformatTextualTab]"!

Item was changed:
  ----- Method: Preferences class>>setFlapsFontTo: (in category 'prefs - fonts') -----
  setFlapsFontTo: aFont
  
+ 	self setFlapFontTo: aFont.!
- 	UserInterfaceTheme current
- 		set: #standardFlapFont
- 		to: aFont;
- 		apply.	
- 		
- 	"FlapTab allSubInstancesDo:
- 		[:aFlapTab | aFlapTab reformatTextualTab]"!

Item was changed:
  ----- Method: Preferences class>>setHaloLabelFontTo: (in category 'prefs - fonts') -----
  setHaloLabelFontTo: aFont 
  	"change the font used in eToys environment"
  
+ 	UserInterfaceTheme setFont: #haloLabelFont to: aFont.!
- 	UserInterfaceTheme current
- 		set: #haloLabelFont
- 		to: aFont;
- 		apply.!

Item was changed:
  ----- Method: Preferences class>>setListFontTo: (in category 'prefs - fonts') -----
  setListFontTo: aFont
  	"Set the list font as indicated"
  
+ 	UserInterfaceTheme setFont: #standardListFont to: aFont.
+ 			
- 	UserInterfaceTheme current
- 		set: #standardListFont
- 		to: aFont;
- 		apply.
- 
  	"Smalltalk at: #ListParagraph ifPresent: [:lp | lp initialize].
  	Smalltalk at: #Flaps ifPresent: [:flaps | flaps replaceToolsFlap]"!

Item was changed:
  ----- Method: Preferences class>>setMenuFontTo: (in category 'prefs - fonts') -----
  setMenuFontTo: aFont
  
+ 	UserInterfaceTheme setFont: #standardMenuFont to: aFont.
- 	UserInterfaceTheme current
- 		set: #standardMenuFont
- 		to: aFont;
- 		apply.
  		
  	"Smalltalk at: #PopUpMenu ifPresent:[:aClass| aClass setMenuFontTo: aFont].
  	TheWorldMainDockingBar updateInstances."!

Item was changed:
  ----- Method: Preferences class>>setPaintBoxButtonFontTo: (in category 'prefs - fonts') -----
  setPaintBoxButtonFontTo: aFont 
+ 	"change the font used in the buttons in PaintBox. Etoys."
- 	"change the font used in the buttons in PaintBox."
  
+ 	UserInterfaceTheme setFont: #paintBoxButtonFont to: aFont.!
- 	UserInterfaceTheme current
- 		set: #paintBoxButtonFont
- 		to: aFont;
- 		apply.!

Item was changed:
  ----- Method: Preferences class>>setSystemFontTo: (in category 'prefs - fonts') -----
  setSystemFontTo: aFont
- 	"Establish the default text font and style"
  
+ 	UserInterfaceTheme setSystemFontTo: aFont.!
- 	| aStyle newDefaultStyle |
- 	aFont ifNil: [^ self].
- 	aStyle := aFont textStyle ifNil: [^ self].
- 	newDefaultStyle := aStyle copy.
- 	newDefaultStyle defaultFontIndex: (aStyle fontIndexOf: aFont).
- 
- 	UserInterfaceTheme current
- 		set: #standardSystemFont to: aFont;
- 		apply.
- 
- 	TextStyle setDefault: newDefaultStyle.
- 	Flaps replaceToolsFlap.
- 	ScriptingSystem resetStandardPartsBin.
- 	
- !

Item was changed:
  ----- Method: Preferences class>>setWindowTitleFontTo: (in category 'prefs - fonts') -----
  setWindowTitleFontTo: aFont
  	"Set the window-title font to be as indicated"
  
+ 	UserInterfaceTheme setFont: #windowTitleFont to: aFont.
+ 	
- 	UserInterfaceTheme current
- 		set: #windowTitleFont
- 		to: aFont;
- 		apply.
- 
  	"(Smalltalk hasClassNamed: #StandardSystemView)
  		ifTrue: [(Smalltalk at: #StandardSystemView) setLabelStyle].
  	(Smalltalk hasClassNamed: #Flaps)
  		ifTrue: [(Smalltalk at: #Flaps) replaceToolsFlap]"
  !

Item was added:
+ ----- Method: Project>>displayScaleChangedFrom:to: (in category 'displaying') -----
+ displayScaleChangedFrom: oldFactor to: newFactor
+ 
+ 	RealEstateAgent resetScaleFactor. "Reset cached (pixel-based) scale factor used in initialization and rendering code. See senders of #scaleFactor."!

Item was removed:
- ----- Method: RealEstateAgent class>>applyUserInterfaceTheme (in category 'preferences') -----
- applyUserInterfaceTheme
- 
- 	ScaleFactor := nil.
- 	!

Item was added:
+ ----- Method: RealEstateAgent class>>resetScaleFactor (in category 'display scale') -----
+ resetScaleFactor
+ 	
+ 	ScaleFactor := nil.!

Item was changed:
  ----- Method: RealEstateAgent class>>scaleFactor (in category 'display scale') -----
  scaleFactor
+ 	"Use the default font height to calculate some factor. Note that, in a distant future, we will be able to use a method that is not based on pixels once we only use TrueType fonts all over the image and have a rendering system other than BitBlt. Then, TextStyle class >> #pixelsPerInch will suffice, considering that 96 PPI represents a scale factor of 1.0. Until then, rendering is based on pixel geometry."
- 	"Use the default font height to calculate some factor. Better than nothing..."
  	
+ 	^ ScaleFactor ifNil: [ScaleFactor := (TextStyle defaultFont height / StrikeFont referenceHeight)]!
- 	^ ScaleFactor ifNil: [ScaleFactor := (TextStyle defaultFont height / 14 "reference value")]!

Item was removed:
- ----- Method: RealEstateAgent class>>themeProperties (in category 'preferences') -----
- themeProperties
- 
- 	^ {
- 		{ #scaleFactor. 'Scaling & Hi-DPI'. 'The factor to scale geometry such as window extent.' }.
- 	}!

Item was removed:
- ----- Method: RealEstateAgent>>applyUserInterfaceTheme (in category 'preferences') -----
- applyUserInterfaceTheme
- 
- 	"Ignore. Only class-side cache."!

Item was removed:
- ----- Method: RealEstateAgent>>canApplyUserInterfaceTheme (in category 'preferences') -----
- canApplyUserInterfaceTheme
- 	"See class side."
- 	
- 	^ false!

Item was changed:
  ----- Method: SolarizedTheme class>>addDarkFonts: (in category 'instance creation') -----
  addDarkFonts: theme
  
  	"Set-up fonts."
  	theme
+ 		set: #balloonHelpFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7.5];
+ 		set: #standardButtonFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7.5];
+ 		set: #standardCodeFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardFlapFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7.5 emphasized: TextEmphasis bold emphasisCode];
+ 		set: #haloLabelFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardListFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardMenuFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardSystemFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 10.5];
+ 		set: #windowTitleFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 10.5].!
- 		set: #balloonHelpFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7];
- 		set: #standardButtonFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7];
- 		set: #standardCodeFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9];
- 		set: #standardFlapFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7 emphasized: TextEmphasis bold emphasisCode];
- 		set: #haloLabelFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9];
- 		set: #standardListFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9];
- 		set: #standardMenuFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9];
- 		set: #standardSystemFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9];
- 		set: #windowTitleFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9].!

Item was changed:
  ----- Method: SolarizedTheme class>>addLightFonts: (in category 'instance creation') -----
  addLightFonts: theme
  
  	"Set-up fonts."
  	theme
+ 		set: #balloonHelpFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 7.5];
+ 		set: #standardButtonFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 7.5];
+ 		set: #standardCodeFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardFlapFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 7.5 emphasized: TextEmphasis bold emphasisCode];
+ 		set: #haloLabelFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardListFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardMenuFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardSystemFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 10.5];
+ 		set: #windowTitleFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 10.5 emphasized: TextEmphasis bold emphasisCode].!
- 		set: #balloonHelpFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 7];
- 		set: #standardButtonFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 7];
- 		set: #standardCodeFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 9];
- 		set: #standardFlapFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 7 emphasized: TextEmphasis bold emphasisCode];
- 		set: #haloLabelFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 9];
- 		set: #standardListFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 9];
- 		set: #standardMenuFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 9];
- 		set: #standardSystemFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 9];
- 		set: #windowTitleFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 9 emphasized: TextEmphasis bold emphasisCode].!

Item was changed:
  ----- Method: SqueakTheme class>>addFonts: (in category 'instance creation') -----
  addFonts: theme
  
  	theme
+ 		set: #standardSystemFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardFixedFont to: [TTCFont familyName: 'BitstreamVeraSansMono' pointSize: 10.5];
+ 
+ 		set: #standardCodeFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardListFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardButtonFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 7.5];
+ 		set: #standardMenuFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardFlapFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 7.5 emphasized: TextEmphasis bold emphasisCode];
+ 
+ 		set: #windowTitleFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 10.5 emphasized: TextEmphasis bold emphasisCode];
+ 		set: #balloonHelpFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 7.5];
+ 		set: #haloLabelFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 10.5];
+ 
+ 		set: #wizardStandardFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 14.5];
+ 		set: #wizardButtonFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 14.5];
+ 		set: #wizardHelpFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 10.5];
+ 		set: #wizardTitleFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 23.5].!
- 		set: #balloonHelpFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 7];
- 		set: #standardButtonFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 7];
- 		set: #standardCodeFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 9];
- 		set: #standardFlapFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 7 emphasized: TextEmphasis bold emphasisCode];
- 		set: #haloLabelFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 9];
- 		set: #standardListFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 9];
- 		set: #standardMenuFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 9];
- 		set: #standardSystemFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 9];
- 		set: #standardFixedFont to: [TTCFont familyName: 'BitstreamVeraSansMono' pointSize: 12 emphasis: 0];
- 		set: #windowTitleFont to: [StrikeFont familyName: 'Bitmap DejaVu Sans' pointSize: 9 emphasized: TextEmphasis bold emphasisCode].
- !

Item was added:
+ ----- Method: StrikeFont class>>referenceHeight (in category '*System-constants') -----
+ referenceHeight
+ 	"Since Squeak 4.1, the standard system/text font has been pre-rendered to a height of 14 pixels, which are about 10.5 point in 96 PPI. We can use this value to compute the effective in-image scale factor using the current system font's height (in pixels). If that font happens to be a TTCFont, the same #pointSize can result in a different #pixelSize once PPI changes.
+ 	
+ 	StrikeFont ... 10.5 pt = 14 px in 96 ppi = 1.0 or 100%
+ 	TTCFont ... 96 ppi = 1.0 or 100%
+ 	"
+ 
+ 	^ 14 "pixels"!

Item was added:
+ ----- Method: TTCFont class>>referencePointSize (in category '*System-constants') -----
+ referencePointSize
+ 	"See commentary in StrikeFont class >> #referenceHeight."
+ 
+ 	^ 10.5!

Item was changed:
  ----- Method: TrimTheme class>>addFonts: (in category 'instance creation') -----
  addFonts: theme
  
  	"Set-up fonts."
  	theme
+ 		set: #balloonHelpFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7.5];
+ 		set: #standardButtonFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7.5];
+ 		set: #standardCodeFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardFlapFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7.5 emphasized: TextEmphasis bold emphasisCode];
+ 		set: #haloLabelFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardListFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardMenuFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 10.5];
+ 		set: #standardSystemFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 10.5];
+ 		set: #windowTitleFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 10.5].!
- 		set: #balloonHelpFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7];
- 		set: #standardButtonFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7];
- 		set: #standardCodeFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9];
- 		set: #standardFlapFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 7 emphasized: TextEmphasis bold emphasisCode];
- 		set: #haloLabelFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9];
- 		set: #standardListFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9];
- 		set: #standardMenuFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9];
- 		set: #standardSystemFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9];
- 		set: #windowTitleFont to: [StrikeFont familyName: 'Darkmap DejaVu Sans' pointSize: 9].!

Item was added:
+ ----- Method: UserInterfaceTheme class>>addDefaultFonts: (in category 'initialize-release') -----
+ addDefaultFonts: theme
+ 	"There must be fonts installed in the default theme. Unlike all other theme properties, there are no defaults encoded throughout the system for these properties. That is, there are no #ifNil: checks when requesting a font from the current theme."
+ 	
+ 	| defaultBuilder |
+ 	defaultBuilder := TTCFont familyName: 'BitstreamVeraSans' pointSize: TTCFont referencePointSize.
+ 	#(
+ 		standardSystemFont
+ 		standardFixedFont
+ 
+ 		standardCodeFont
+ 		standardListFont
+ 		standardButtonFont
+ 		standardMenuFont
+ 		standardFlapFont
+ 			
+ 		windowTitleFont
+ 		balloonHelpFont
+ 		haloLabelFont
+ 		
+ 		wizardStandardFont
+ 		wizardButtonFont
+ 		wizardHelpFont
+ 		wizardTitleFont
+ 	)
+ 		do: [:symbolicName | theme set: symbolicName to: defaultBuilder].!

Item was changed:
  ----- Method: UserInterfaceTheme class>>cleanUp: (in category 'initialize-release') -----
  cleanUp: aggressive
  
  	aggressive ifTrue: [
+ 		All := Default := nil.
- 		All := nil.
  		SqueakTheme
  			create;
  			createDuller.
  		SolarizedTheme
  			createDark;
  			createLight.
  		MonokaiTheme createDark.
  		CommunityTheme createDark.
  		TrimTheme create].!

Item was changed:
  ----- Method: UserInterfaceTheme class>>cleanUpAndReset (in category 'initialize-release') -----
  cleanUpAndReset
  	"Rebuild all themes and re-apply the current one by name."
+ 
+ 	self resetAfter: [self cleanUp: true].!
- 	
- 	| nameToReset |
- 	nameToReset := UserInterfaceTheme current name.
- 	self cleanUp: true.
- 	(self named: nameToReset) apply.!

Item was changed:
  ----- Method: UserInterfaceTheme class>>current (in category 'accessing') -----
  current
  
+ 	^ Current ifNil: [Current := self default]!
- 	^ Current ifNil: [Current := Default]!

Item was changed:
  ----- Method: UserInterfaceTheme class>>default (in category 'accessing') -----
  default
+ 	^ Default ifNil: [
+ 		Default := self new.
+ 		Default name: 'Autogenerated Default'.
+ 		self addDefaultFonts: Default.
+ 		Default]!
- 	^ Default ifNil: [Default := self new
- 		name: 'Autogenerated Default';
- 		yourself]!

Item was removed:
- ----- Method: UserInterfaceTheme class>>default: (in category 'accessing') -----
- default: aUserInterfaceTheme
- 
- 	Default := aUserInterfaceTheme.!

Item was changed:
  ----- Method: UserInterfaceTheme class>>reset (in category 'initialize-release') -----
  reset
+ 	self current apply.!
- 	self default apply.!

Item was added:
+ ----- Method: UserInterfaceTheme class>>resetAfter: (in category 'initialize-release') -----
+ resetAfter: aBlock
+ 	"Evaluate aBlock and re-apply the current one by name."
+ 	
+ 	| nameToReset scaleFactorToReset |
+ 	nameToReset := self current name.
+ 	scaleFactorToReset := Display uiScaleFactor.
+ 	aBlock value.
+ 	(self named: nameToReset) applyScaled: scaleFactorToReset.!

Item was added:
+ ----- Method: UserInterfaceTheme class>>setFixedFontTo: (in category 'tools - fonts') -----
+ setFixedFontTo: aFont
+ 	"Establish the default fixed text font and style"
+ 
+ 	self setFont: #standardFixedFont to: aFont.!

Item was added:
+ ----- Method: UserInterfaceTheme class>>setFont:to: (in category 'tools - fonts') -----
+ setFont: symbolicName to: aFont
+ 	"Set symbolicName to aFont in all known UI themes. If aFont is a TrueType font, transform all themes into TTC-based ones and re-apply the current theme by name."
+ 
+ 	aFont isTTCFont ifTrue: [
+ 		self flag: #discuss. "mt: Should we issue a warning here?"
+ 		(self allThemes anySatisfy: [:uit | uit isTTCBased not])
+ 			ifTrue: [self resetAfter: [
+ 				self allThemes copy do: [:uit | uit isGenuine ifFalse: [uit unregister]].
+ 				self allThemes do: [:uit | uit makeTTCBased]] ]].
+ 
+ 	self allThemes do: [:uit |
+ 		uit setFont: symbolicName to: aFont].!

Item was added:
+ ----- Method: UserInterfaceTheme class>>setSystemFontTo: (in category 'tools - fonts') -----
+ setSystemFontTo: aFont
+ 	"Establish the default text font and style"
+ 
+ 	aFont isTTCFont not ifTrue: [
+ 		Display uiScaleFactor = 1.0
+ 			ifFalse: [^ self error: 'Can only set pre-rendered font for 100% scale factor'].
+ 		aFont height = StrikeFont referenceHeight
+ 			ifFalse: [^ self error: ('Incompatible pre-rendered font for 100% scale factor. Height must be {1} px' format: {StrikeFont referenceHeight})]].
+ 
+ "Documentation only. Users can increase the default font size to any value. Yet, RealEstateAgent class >> #scaleFactor will change and the system effectively render stuff larger. So, it would be a good idea to keep #pixelSize/#height of system font, list font, and menu font similar.
+ 
+ 	(aFont isTTCFont and: [aFont pointSize ~= TTCFont referencePointSize])
+ 		ifTrue: [self notify: ('The standard system/text font should be {1} pt. If you want to increase the overall font size, please change the screen scale factor instead. You may proceed without harm.' format: {TTCFont referencePointSize})].
+ "
+ 	self setFont: #standardSystemFont to: aFont.!

Item was changed:
  ----- Method: UserInterfaceTheme>>apply (in category 'actions') -----
  apply
  	"Apply this theme to all affected objects. Let classes decide on how to iterate and call their instances."
  
  	ignoreApply == true ifTrue: [^ self].
- 
  	UserInterfaceTheme current: self.
+ 	self fixFontsAndScaleAround: [self basicApply	].
  
+ 	"Project current restoreDisplay. -- not needed. Rather fix occasional draw-only issues in the respective morphs via #applyUserInterfaceTheme and #changed."!
- 	self fixFontsAndScaleAround: [
- 
- 		self class clientClassesToReapply in: [:cc |
- 			cc do: [:eachClass | eachClass applyUserInterfaceTheme].
- 			Cursor wait showWhile: [
- 				SystemNavigation default allObjectsDo: [:o |
- 					((cc includes: o class)
- 						and: [o canApplyUserInterfaceTheme])
- 							ifTrue: [o applyUserInterfaceTheme]]]].
- 	]. "fix fonts"
- 			
- 	Project current restoreDisplay.!

Item was changed:
  ----- Method: UserInterfaceTheme>>applyAfter: (in category 'actions') -----
+ applyAfter: aBlock
- applyAfter: block
  
- 	ignoreApply := true.
  	lastScaleFactor := RealEstateAgent scaleFactor.
+ 	self class current: self. "Font callbacks from Preferences to here."
+ 	self ignoreApplyDuring: aBlock.
+ 	self apply.!
- 	^ block ensure: [ignoreApply := false. self apply]!

Item was added:
+ ----- Method: UserInterfaceTheme>>applyScaled (in category 'private - display scale') -----
+ applyScaled
+ 	"Apply the receiver but keep the current #uiScaleFactor."
+ 	
+ 	self applyScaled: Display uiScaleFactor.!

Item was added:
+ ----- Method: UserInterfaceTheme>>applyScaled: (in category 'private - display scale') -----
+ applyScaled: aFloat
+ 	"Apply the receiver with the given scale factor aFloat."
+ 	
+ 	self setScaleFactor: aFloat.!

Item was added:
+ ----- Method: UserInterfaceTheme>>basicApply (in category 'private') -----
+ basicApply
+ 	"Private. See #apply."
+ 
+ 	self class clientClassesToReapply in: [:cc |
+ 		cc do: [:eachClass | eachClass applyUserInterfaceTheme].
+ 		Cursor wait showWhile: [
+ 			SystemNavigation default allObjectsDo: [:o |
+ 				((cc includes: o class)
+ 					and: [o canApplyUserInterfaceTheme])
+ 						ifTrue: [o applyUserInterfaceTheme]]]].!

Item was added:
+ ----- Method: UserInterfaceTheme>>canFakeScaleFactor: (in category 'private - display scale') -----
+ canFakeScaleFactor: aFloat
+ 	"Answer whether we can fake the given scale factor with pre-rendered fonts."
+ 
+ 	self isTTCBased ifFalse: [^ true "Need to #makeTTCBased anyway."].
+ 	(self lookupScaleFactor: 1.0) ifNil: [^ false "Without a fake 100%, we go all-in with TrueType fonts."].
+ 
+ 	aFloat = 1.0 ifTrue: [^ true].
+ 	aFloat = 1.25 ifTrue: [^ true].
+ 	aFloat = 1.5 ifTrue: [^ true].
+ 	
+ 	^ false!

Item was added:
+ ----- Method: UserInterfaceTheme>>checkTheme100 (in category 'private - display scale') -----
+ checkTheme100
+ 
+ 	| theme100 |
+ 	self flag: #isTTCBased.
+ 	theme100 := self lookupScaleFactor: 1.0.
+ 	self
+ 		assert: [theme100 notNil]
+ 		description: 'Reference theme not found!! Please reset all themes.'.
+ 	^ theme100!

Item was added:
+ ----- Method: UserInterfaceTheme>>copyWithScaleFactor: (in category 'private - display scale') -----
+ copyWithScaleFactor: aFloat
+ 	"Duplicate the receiver and reconfigure the copy to have its #scaleFactor match factorInPercent. This method is used for preserving the reference theme, which has a 100% scale factor."
+ 
+ 	| copy |
+ 	self
+ 		assert: [self isTTCBased not]
+ 		description: 'There is no need to duplicate themes that are already based on TrueType fonts!!'.
+ 	
+ 	copy := UserInterfaceTheme named: 'Demo'.
+ 	copy merge: self overwrite: true.
+ 	
+ 	copy name: self name.
+ 	copy set: #standardSystemFont to: nil. "We are not theme100 for the moment."
+ 	self assert: [copy localScaleFactor isNil].
+ 
+ 	copy setScaleFactorPreApply: aFloat.
+ 	
+ 	^ copy!

Item was added:
+ ----- Method: UserInterfaceTheme>>doScale100 (in category 'private - display scale') -----
+ doScale100
+ 	"Private. Use #applyScaled:. The reference theme, which has a 100% scale factor, must already be there. Look it up and apply it."
+ 	
+ 	self checkTheme100 apply.
+ 	TextStyle pixelsPerInch: 96.0. "Restore Squeak's default PPI for 100%."!

Item was added:
+ ----- Method: UserInterfaceTheme>>doScale125 (in category 'private - display scale') -----
+ doScale125
+ 	"Private. Use #applyScaled:. This is actually about 135% because of which font sizes we have available."
+ 	
+ 	self flag: #hack. "mt: A different scale factor should not result in different point sizes being selected BUT the same point size resulting in a different pixel height."
+ 	
+ 	self setFonts: #(
+ 		standardSystemFont 14.5
+ 		standardFixedFont 14.5
+ 
+ 		standardCodeFont 14.5
+ 		standardListFont 14.5
+ 		standardButtonFont 10.5
+ 		standardMenuFont 14.5
+ 		standardFlapFont 10.5
+ 			
+ 		windowTitleFont 14.5
+ 		balloonHelpFont 10.5
+ 		haloLabelFont 14.5
+ 		
+ 		wizardStandardFont 20.0
+ 		wizardButtonFont 20.0
+ 		wizardHelpFont 14.5
+ 		wizardTitleFont 32.5) forceTTC: false.
+ 
+ 	self apply.
+ 	TextStyle pixelsPerInch: 96.0. "Restore Squeak's default PPI for 100%."!

Item was added:
+ ----- Method: UserInterfaceTheme>>doScale150 (in category 'private - display scale') -----
+ doScale150
+ 	"Private. Use #applyScaled:. Traditional 'Demo Mode'. Optimized for existing pre-rendered fonts. Does not fall back on TTC font. See #doScale:. This is actually about 157% because of which font sizes we have available."
+ 	
+ 	self flag: #hack. "mt: A different scale factor should not result in different point sizes being selected BUT the same point size resulting in a different pixel height."
+ 	
+ 	self setFonts: #(
+ 		standardSystemFont 16.5
+ 		standardFixedFont 16.5
+ 
+ 		standardCodeFont 16.5
+ 		standardListFont 16.5
+ 		standardButtonFont 14.5
+ 		standardMenuFont 16.5
+ 		standardFlapFont 14.5
+ 			
+ 		windowTitleFont 16.5
+ 		balloonHelpFont 14.5
+ 		haloLabelFont 16.5
+ 		
+ 		wizardStandardFont 22.5
+ 		wizardButtonFont 22.5
+ 		wizardHelpFont 16.5
+ 		wizardTitleFont 36.5) forceTTC: false.
+ 
+ 	self apply.
+ 	TextStyle pixelsPerInch: 96.0. "Restore Squeak's default PPI for 100%."!

Item was changed:
+ ----- Method: UserInterfaceTheme>>fixFontsAndScaleAround: (in category 'private - fonts') -----
+ fixFontsAndScaleAround: applyThemeBlock
+ 	"Given that the receiver is the current UI theme, set the system's default fonts, which define RealEstateAgent's #scaleFactor. If the factor changes, resize open windows to make them fit the scaled contents. Note that themes can have arbitrary point sizes for their system font, even though it is not recommended. See TTCFont class >> #referencePointSize."
- ----- Method: UserInterfaceTheme>>fixFontsAndScaleAround: (in category 'private') -----
- fixFontsAndScaleAround: block
- 	"Due to the current situation with fonts and the real-estate manager, this is a small workaround to support theme switching with largely different font sizes."
  
  	lastScaleFactor ifNil: [lastScaleFactor := RealEstateAgent scaleFactor].
  
  	"Due to the current font situation, update TextConstants."
+ 	(self get: #standardSystemFont) ifNotNil: [:font | self installSystemFont: font].
+ 	(self get: #standardFixedFont) ifNotNil: [:font | self installFixedFont: font].	
- 	[	ignoreApply := true.
- 		(self get: #standardSystemFont) ifNotNil: [:font | Preferences setSystemFontTo: font].
- 		(self get: #standardFixedFont) ifNotNil: [:font | Preferences setFixedFontTo: font].
- 		RealEstateAgent applyUserInterfaceTheme. "Reset cached scale factor now. Sigh."
- 	] ensure: [ignoreApply := false].
  
+ 	"Propagate the receiver's properties across the system."
+ 	applyThemeBlock value.
- 	"Apply theme etc."
- 	block value.
  
  	"Due to the current real-estate manager situation, resize all windows. Works only for Morphic projects."
+ 	self scaleMorphicToolsBy: RealEstateAgent scaleFactor / lastScaleFactor.
+ 		
- 	(RealEstateAgent scaleFactor - lastScaleFactor) abs > 0.1 ifTrue: [
- 		Project current isMorphic ifTrue: [
- 			| scale |
- 			scale := RealEstateAgent scaleFactor / lastScaleFactor.
- 			Project current world submorphs
- 				select: [:ea | ea isSystemWindow]
- 				thenDo: [:ea |
- 					ea extent: (ea extent * scale).
- 					ea layoutChanged.
- 					ea setFramesForLabelArea]]].
- 
  	lastScaleFactor := nil.!

Item was added:
+ ----- Method: UserInterfaceTheme>>ignoreApplyDuring: (in category 'actions') -----
+ ignoreApplyDuring: aBlock
+ 
+ 	ignoreApply := true.
+ 	^ aBlock ensure: [ignoreApply := false]!

Item was added:
+ ----- Method: UserInterfaceTheme>>installFixedFont: (in category 'private - fonts') -----
+ installFixedFont: aFont
+ 	"Establish the default fixed text font and style"
+ 
+ 	| aStyle |
+ 	self flag: #todo. "mt: Support derivatives such as bold and italic."
+ 	aStyle := aFont textStyle.
+ 	aStyle defaultFontIndex: (aStyle fontIndexOf: aFont).
+ 	TextStyle setDefaultFixed: aStyle.!

Item was added:
+ ----- Method: UserInterfaceTheme>>installSystemFont: (in category 'private - fonts') -----
+ installSystemFont: aFont
+ 	"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 fontIndexOf: aFont).
+ 
+ 	TextStyle setDefault: aStyle.
+ 	RealEstateAgent resetScaleFactor.
+ 	
+ 	Flaps replaceToolsFlap.
+ 	ScriptingSystem resetStandardPartsBin.!

Item was added:
+ ----- Method: UserInterfaceTheme>>isCurrent (in category 'testing') -----
+ isCurrent
+ 	"Note that changes to the receiver's properties without calling #apply can result in visual differences even though the answer might be 'true'."
+ 	
+ 	^ self class current == self!

Item was added:
+ ----- Method: UserInterfaceTheme>>isGenuine (in category 'private - display scale') -----
+ isGenuine
+ 
+ 	self isTTCBased ifTrue: [
+ 		"The receiver is only genuine if there is no other theme with the same same, probably one with pre-rendered fonts."
+ 		^ (self class allThemes anySatisfy: [:theme |
+ 			theme ~~ self and: [theme name = self name]]) not].
+ 
+ 	^ self localScaleFactor = 1.0!

Item was added:
+ ----- Method: UserInterfaceTheme>>isTTCBased (in category 'private - display scale') -----
+ isTTCBased
+ 	"Answer whether the receiver uses only TrueType fonts, which can flexibly adapt to changing scale factors."
+ 
+ 	^ (self get: #standardSystemFont) ifNil: [false] ifNotNil: [:font | font isTTCFont]
+ 	
+ 	"properties keysDo: [:key |
+ 		(key isSymbol and: [key endsWith: #Font])
+ 			ifTrue: [(self get: key) isTTCFont ifFalse: [^ false]]].
+ 	^ true"!

Item was added:
+ ----- Method: UserInterfaceTheme>>localScaleFactor (in category 'private - display scale') -----
+ localScaleFactor
+ 	"Answers the scale factor that the receiver supports, which is arbitrary for themes that only use TTCFonts."
+ 
+ 	self
+ 		assert: [self isTTCBased not]
+ 		description: 'The local scale factor is undefined for TrueType-based themes!!'.
+ 
+ 	^ (self get: #standardSystemFont)
+ 		ifNil: ["Not yet initialized."]
+ 		ifNotNil: [:font | (font height / StrikeFont referenceHeight) roundTo: 0.25]!

Item was added:
+ ----- Method: UserInterfaceTheme>>lookupScaleFactor: (in category 'private - display scale') -----
+ lookupScaleFactor: aFloat
+ 	"Answer a theme that fakes the given scale factor with pre-rendered fonts."
+ 
+ 	^ self class allThemes
+ 		detect: [:ea | ea name = self name and: [ea isTTCBased not and: [ea localScaleFactor = aFloat]]]
+ 		ifNone: ["Not found."]!

Item was added:
+ ----- Method: UserInterfaceTheme>>lookupSimilar (in category 'private - display scale') -----
+ lookupSimilar
+ 	"Answer a theme that is similar to the receiver but not the reference theme for pre-rendered fonts."
+ 
+ 	^ self class allThemes
+ 		detect: [:ea | ea name = self name and: [ea isTTCBased or: [ea localScaleFactor ~= 1.0]]]
+ 		ifNone: ["Not found."]!

Item was added:
+ ----- Method: UserInterfaceTheme>>makeTTCBased (in category 'private - display scale') -----
+ makeTTCBased
+ 	"100%"
+ 	
+ 	self isTTCBased ifTrue: [^ self].
+ 	
+ 	self setFonts: #(
+ 		standardSystemFont 10.5
+ 		standardFixedFont 10.5
+ 	
+ 		standardCodeFont 10.5
+ 		standardListFont 10.5
+ 		standardButtonFont 7.5
+ 		standardMenuFont 10.5
+ 		standardFlapFont 7.5
+ 			
+ 		windowTitleFont 10.5
+ 		balloonHelpFont 7.5
+ 		haloLabelFont 10.5
+ 		
+ 		wizardStandardFont 14.5 
+ 		wizardButtonFont 14.5
+ 		wizardHelpFont 10.5
+ 		wizardTitleFont 23.5) forceTTC: true.
+ 		
+ 	self assert: [self isTTCBased].!

Item was changed:
  ----- Method: UserInterfaceTheme>>printOn: (in category 'printing') -----
  printOn: aStream
+ 
  	super printOn: aStream.
+ 
+ 	aStream space; print: name.
+ 	self isTTCBased ifFalse: [
+ 		aStream space; nextPutAll: ('({1}%)' format: {self localScaleFactor * 100})].!
- 	aStream space; print: name!

Item was changed:
  ----- Method: UserInterfaceTheme>>register (in category 'initialization') -----
  register
+ 
  	self class allThemes add: self.!

Item was added:
+ ----- Method: UserInterfaceTheme>>scaleMorphicToolsBy: (in category 'private - fonts') -----
+ scaleMorphicToolsBy: factor
+ 
+ 	Project current isMorphic ifFalse: [^ self].
+ 	(factor closeTo: 1) ifTrue: [^ self].
+ 	
+ 	Project current world submorphs
+ 		select: [:morph | morph isSystemWindow]
+ 		thenDo: [:window |
+ 			window extent: window extent * factor.
+ 			window layoutChanged.
+ 			window setFramesForLabelArea].!

Item was added:
+ ----- Method: UserInterfaceTheme>>setFixedFontTo: (in category 'private - fonts') -----
+ setFixedFontTo: aFont
+ 	"Establish the default fixed text font and style"
+ 
+ 	self setFont: #standardFixedFont to: aFont.!

Item was added:
+ ----- Method: UserInterfaceTheme>>setFont:to: (in category 'private - fonts') -----
+ setFont: symbolicName to: aFont
+ 	"Establish the default text font and style"
+ 
+ 	self set: symbolicName to: aFont.
+ 	self isCurrent ifTrue: [self apply].!

Item was added:
+ ----- Method: UserInterfaceTheme>>setFonts:forceTTC: (in category 'private - display scale') -----
+ setFonts: specs forceTTC: forceTTC
+ 	"Change fonts. Do not apply the receiver. Replace StrikeFont with TTCFont if forceTTC or target pointSize not available."
+ 		
+ 	| theme100 |
+ 	theme100 := self checkTheme100.
+ 	
+ 	specs groupsDo: [:symbolicFontName :newPointSize | | font100 fontScaled |
+ 		font100 := theme100 get: symbolicFontName.
+ 		fontScaled := font100 isTTCFont
+ 			ifTrue: [TTCFont familyName: font100 familyName pointSize: newPointSize emphasis: font100 emphasis]
+ 			ifFalse: [StrikeFont familyName: font100 familyName pointSize: newPointSize emphasized: font100 emphasis].
+ 		(fontScaled pointSize ~= newPointSize or: [forceTTC and: [fontScaled isTTCFont not]])
+ 			ifTrue: [fontScaled := TTCFont familyName: self ttcFallbackName pointSize: newPointSize emphasis: font100 emphasis].
+ 		self assert: [fontScaled pointSize = newPointSize].
+ 		self set: symbolicFontName to: fontScaled].!

Item was added:
+ ----- Method: UserInterfaceTheme>>setScaleFactor: (in category 'private - display scale') -----
+ setScaleFactor: aFloat
+ 	"Private. Use #applyScaled:. In the receiver, change the fonts to have a scale of aFloat. Change all fonts to be TrueType fonts if no pre-rendered fonts exist. Never change the 100% reference theme but make a copy. Apply the receiver to the system."
+ 
+ 	(self isTTCBased not and: [aFloat = self localScaleFactor])
+ 		ifTrue: [self isCurrent ifFalse: [self apply]. ^ self].
+ 
+ 	(self isTTCBased not and: [self localScaleFactor = 1.0]) "!!!! Never change the reference theme !!!!"
+ 		ifTrue: [^ self lookupSimilar ifNil: [self copyWithScaleFactor: aFloat] ifNotNil: [:other | other setScaleFactorPreApply: aFloat]].
+ 	
+ 	aFloat = 1.0 ifTrue: [^ self doScale100].
+ 	aFloat = 1.25 ifTrue: [^ self doScale125].
+ 	aFloat = 1.5 ifTrue: [^ self doScale150].
+ 
+ 	"And now transition from the pre-rendered world into the TrueType world. Or re-use an existing TrueType-based theme with new values. See #lookupSimilar above."
+ 	TextStyle pixelsPerInch: 96.0 * RealEstateAgent scaleFactor "current, based on pixels".
+ 	self makeTTCBased.
+ 	self applyAfter: [TextStyle pixelsPerInch: 96.0 * aFloat "new, not rounded"].!

Item was added:
+ ----- Method: UserInterfaceTheme>>setScaleFactorPreApply: (in category 'private - display scale') -----
+ setScaleFactorPreApply: aFloat
+ 
+ 	| last |
+ 	last := Current.
+ 	[Current := self.  "Manage side-effects in #setDefaultFonts: ..."
+ 	self setScaleFactor: aFloat]
+ 		on: Error do: [:ex | Current := last. ex pass].!

Item was added:
+ ----- Method: UserInterfaceTheme>>ttcFallbackName (in category 'private - display scale') -----
+ ttcFallbackName
+ 	"Answer the name of the TTCFont that should be used as a fallback for pre-rendered StrikeFonts that do not have the requested #pointSize available."
+ 	
+ 	^ 'BitstreamVeraSans'!

Item was changed:
+ (PackageInfo named: 'System') postscript: 'UserInterfaceTheme allThemes do: [:each | 
+ 	"Convert ''Demo + Squeak'' to ''Squeak''. Not needed anymore because of #scaleFactor in each theme."
+ 	each name: (each name findTokens: ''+'') last withBlanksTrimmed].
+ 
+ "Font definitions changed in all UI themes due to PPI conversion above. Wizard fonts have been added."	
+ UserInterfaceTheme cleanUpAndReset.'!
- (PackageInfo named: 'System') postscript: 'Smalltalk removeClassNamed: #Abort.'!



More information about the Squeak-dev mailing list