Italic apologies

Bob Arning arning at charm.net
Wed Apr 26 13:49:28 UTC 2000


The proposed change for #makeItalicGlyphs posted yesterday had a serious error. Sorry about that and here is a better version.

Cheers,
Bob

===== code follows =====
'From Squeak2.8alpha of 13 January 2000 [latest update: #2005] on 25 April 2000 at 7:51:03 pm'!

!StrikeFont methodsFor: 'emphasis' stamp: 'RAA 4/25/2000 19:48'!
makeItalicGlyphs
	"Make an italic set of glyphs with same widths by skewing left and right
		(may require more intercharacter space)"
	| dest nextX source destRect bb rect delta shift |

	shift _ glyphs height // 6.
	dest _ Form extent: glyphs extent + ((shift * (maxAscii - minAscii + 1))@0) depth: glyphs depth.
	bb _ WarpBlt toForm: dest.
	bb colorMap: nil.
	bb combinationRule: Form over.
	nextX _ 0.
	minAscii to: maxAscii do: [ :i |
		source _ self characterFormAt: (Character value: i).
		destRect _ nextX at 0 extent: (source width + shift @ source height).
		bb sourceForm: source.
		rect _ source boundingBox innerCorners.
		rect at: 1 put: (rect at: 1) - (shift at 0).
		rect at: 3 put: (rect at: 3) + (shift at 0).
		bb copyQuad: rect toRect: destRect.
		nextX _ nextX + destRect width
	].
	glyphs _ dest.
	delta _ 0.
	xTable _ xTable copy.
	maxWidth _ maxWidth + 4.
	minAscii to: maxAscii do: [ :i |
		delta _ delta + shift.
		xTable at: i+2 put: (xTable at: i+2) + delta.
	].
! !





More information about the Squeak-dev mailing list