'From Pharo1.0beta of 16 May 2008 [Latest update: #10424] on 1 September 2009 at 11:32:46 am'!

!Preferences class methodsFor: 'fonts' stamp: 'M 8/30/2009 13:21'!
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 response |
		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) ]].

	defaultFontsSpec do: [:triplet | self
		perform: triplet first
		with: (((map at: triplet second) fontOfPointSize: triplet third) emphasized: (emphases at: triplet second))]! !


!StandardSystemFontsTest methodsFor: 'testing' stamp: 'M 8/30/2009 13:21'!
testRestoreDefaultFonts
	self saveStandardSystemFontsDuring: [
		Preferences restoreDefaultFonts.
		self assert: #standardDefaultTextFont familyName: 'Accuny' pointSize: 9.
		self assert: #standardListFont familyName: 'Accuny' pointSize: 9.
		self assert: #standardMenuFont familyName: 'Accuny' pointSize: 9.
		self assert: #windowTitleFont familyName: 'Accuny' pointSize: 12.
		self assert: #standardBalloonHelpFont familyName: 'Accuny' pointSize: 10.
		self assert: #standardCodeFont familyName: 'Accuny' pointSize: 9.
		self assert: #standardButtonFont familyName: 'Accuny' pointSize: 9]! !

