'From Squeak3.7 of ''4 September 2004'' [latest update: #5989] on 20 March 2009 at 10:30:44 am'!

!StrikeFont methodsFor: 'emphasis' stamp: 'jmv 3/20/2009 10:27'!
derivativeFont: aStrikeFont at: index

	| newDeriv |
	(aStrikeFont isNil and: [ index = 0 ]) 
		ifTrue: [derivativeFonts := nil. ^ self].
	derivativeFonts ifNil: [derivativeFonts := Array new: 32].
	derivativeFonts size < 32 ifTrue: [
		newDeriv := Array new: 32.
		newDeriv replaceFrom: 1 to: derivativeFonts size with: derivativeFonts.
		derivativeFonts := newDeriv.
	].
	derivativeFonts at: index put: aStrikeFont.! !


!StrikeFont class methodsFor: 'removing' stamp: 'jmv 3/20/2009 09:35'!
removeForPDA
"
StrikeFont removeForPDA
"
	| style keep dejaVu |
	style _ TextConstants at: #DejaVu.
	keep _ #(5 6 7 8 9) collect: [ :s |
		style fontNamed: 'DejaVu ', s printString ].
	keep do: [ :f |
		f derivativeFont: nil at: 0 ].
	dejaVu _ TextStyle fontArray: keep.
	TextConstants at: #DefaultFixedTextStyle put: dejaVu.
	self actualFamilyNames do: [ :n |
		TextConstants removeKey: n ].
	TextConstants at: #DejaVu put: dejaVu.
	
	Preferences setDefaultFonts: #(
		(setSystemFontTo: 'DejaVu' 8)
		(setListFontTo: 'DejaVu' 6)
		(setMenuFontTo: 'DejaVu' 7)
		(setWindowTitleFontTo: 'DejaVu' 9)
		(setBalloonHelpFontTo: 'DejaVu' 7)
		(setCodeFontTo: 'DejaVu' 7)
		(setButtonFontTo: 'DejaVu' 7))! !

!StrikeFont class methodsFor: 'removing' stamp: 'jmv 3/20/2009 09:29'!
removeMostFonts
"
StrikeFont removeMostFonts
"
	| style keep dejaVu |
	style _ TextConstants at: #DejaVu.
	keep _ #(8 10 12 14 16 18 20) collect: [ :s |
		style fontNamed: 'DejaVu ', s printString ].
	keep do: [ :f |
		f derivativeFont: nil at: 0 ].
	dejaVu _ TextStyle fontArray: keep.
	TextConstants at: #DefaultFixedTextStyle put: dejaVu.
	self actualFamilyNames do: [ :n |
		TextConstants removeKey: n ].
	TextConstants at: #DejaVu put: dejaVu.
	
	Preferences setDefaultFonts: #(
		(setSystemFontTo: 'DejaVu' 10)
		(setListFontTo: 'DejaVu' 10)
		(setMenuFontTo: 'DejaVu' 10)
		(setWindowTitleFontTo: 'DejaVu' 12)
		(setBalloonHelpFontTo: 'DejaVu' 8)
		(setCodeFontTo: 'DejaVu' 10)
		(setButtonFontTo: 'DejaVu' 10))! !

!StrikeFont class methodsFor: 'removing' stamp: 'jmv 3/20/2009 10:30'!
removeSomeFonts
"
StrikeFont removeSomeFonts
"
	| style keep dejaVu |
	style _ TextConstants at: #DejaVu.

	"Remove bold italic (but leave bold and italic)"
	#(5 6 7 8 9 10 11 12 14 16 18 20 24) do: [ :s |
		(style fontNamed: 'DejaVu ', s printString)
			derivativeFont: nil at: 3 ].
	"Remove all derivative fonts for these"
	#(5 6 7 8 11 12 14 16 20 24) do: [ :s |
		(style fontNamed: 'DejaVu ', s printString)
			derivativeFont: nil at: 0 ].

	keep _ #(5 6 7 8 9 10 11 12 14 16 18 20 24) collect: [ :s |
		style fontNamed: 'DejaVu ', s printString ].
	dejaVu _ TextStyle fontArray: keep.
	TextConstants at: #DefaultFixedTextStyle put: dejaVu.
	self actualFamilyNames do: [ :n |
		TextConstants removeKey: n ].
	TextConstants at: #DejaVu put: dejaVu.
	
	Preferences setDefaultFonts: #(
		(setSystemFontTo: 'DejaVu' 9)
		(setListFontTo: 'DejaVu' 9)
		(setMenuFontTo: 'DejaVu' 10)
		(setWindowTitleFontTo: 'DejaVu' 12)
		(setBalloonHelpFontTo: 'DejaVu' 8)
		(setCodeFontTo: 'DejaVu' 9)
		(setButtonFontTo: 'DejaVu' 9))! !

