'From Cuis 1.0 of 6 August 2009 [latest update: #258] on 20 August 2009 at 4:16:39 pm'!

!StrikeFont methodsFor: 'accessing' stamp: 'jmv 8/20/2009 16:16'!
baseKern
	"Return the base kern value to be used for all characters.
	What follows is some 'random' text used to visually adjust this method.
	HaHbHcHdHeHfHgHhHiHjHkHlHmHnHoHpHqHrHsHtHuHvHwHxHyHzH
	HAHBHCHDHEHFHGHHHIHJHKHLHMHNHOHPHQHRHSHTHUHVHWHXHYHXZH
	wok yuyo	wuwu	vuvu	rucu	tucu	WUWU	VUVU	huevo	HUEVO	to
											k y mate	runico ridiculo	ARABICO	AAAAA	TOMATE
	TUTU
	tatadalajafua
	abacadafagahaqawaearatayauaiaoapasadafagahajakalazaxacavabanama
	kUxUxa
	q?d?h?l?t?f?j?"
	
	| italic baseKern |
	italic _ emphasis allMask: 2.
	
	self isSynthetic ifFalse: [
		baseKern _ (italic or: [ pointSize < 9 ])
			ifTrue: [ 1 ]
			ifFalse: [ 0 ].
		(italic not and: [pointSize = 12]) ifTrue: [
			baseKern _ baseKern -1 ].
		pointSize >= 13 ifTrue: [
			baseKern _ baseKern -1 ].
		pointSize >= 20 ifTrue: [
			baseKern _ baseKern -1 ].
		^baseKern
		].
		
	italic ifFalse: [^ 0].
	^ ((self height-1-self ascent+4)//4 max: 0)  "See makeItalicGlyphs"
		+ (((self ascent-5+4)//4 max: 0))! !

!StrikeFont methodsFor: 'accessing' stamp: 'jmv 8/20/2009 15:48'!
widthOf: aCharacter 
	"Answer the width of the argument as a character in the receiver."

	| ascii |
	ascii _ characterToGlyphMap isNil
		ifTrue: [ aCharacter asciiValue ]
		ifFalse: [ characterToGlyphMap at: aCharacter asciiValue + 1 ].
	(ascii >= minAscii and:[ascii <= maxAscii]) ifFalse: [ascii _ maxAscii + 1].
	^ (xTable at: ascii + 2) - (xTable at: ascii + 1) - self baseKern
! !

!StrikeFont methodsFor: 'building' stamp: 'jmv 8/20/2009 09:11'!
buildFromForm: allGlyphs data: data name: aString

	| x |
	pointSize _ data first asNumber.
	ascent _ data second asNumber.
	descent _ data third asNumber.
	
	minAscii _ 32.
	maxAscii _ 255.
	name _ aString.
	type _ 0.  "ignored for now"
	superscript _ ascent - descent // 3.	
	subscript _ descent - ascent // 3.	
	emphasis _ 0.

	xTable _ (Array new: 258) atAllPut: 0.
	maxWidth _ 0.
	glyphs _ allGlyphs.
	x _ 0.
	minAscii to: maxAscii+1 do: [ :i |
		x _ (data at: i-minAscii+4) asNumber.
		xTable at: i+1 put: x].
	xTable at: 258 put: x.
	self reset.
	derivativeFonts _ Array new: 32! !

