'From Squeak3.4 of 1 March 2003 [latest update: #5170] on 23 April 2003 at 10:48:48 am'! !StrikeFont methodsFor: 'accessing' stamp: 'sumim 4/23/2003 10:42'! baseKern "Return the base kern value to be used for all characters." (emphasis noMask: 2) ifTrue: [^ 0]. ^ self height // 4 "See makeItalicGlyphs"! ! !StrikeFont methodsFor: 'emphasis' stamp: 'sumim 4/23/2003 10:41'! makeItalicGlyphs "Make an italic set of glyphs with same widths by skewing left and right. In the process, characters would overlap, so we widen them all first. " | extraWidth newGlyphs newXTable x newX w extraOnLeft | extraOnLeft _ (self height-1-self ascent+4)//4 max: 0. extraWidth _ self height // 4. newXTable _ xTable copy. (xTable isKindOf: XTableForFixedFont) ifFalse: [ newGlyphs _ Form extent: (glyphs width + (maxAscii - minAscii + 1 * extraWidth)) @ glyphs height. "Copy glyphs into newGlyphs with room on left and right for overlap." minAscii to: maxAscii + 1 do: [ :ascii | x _ xTable at: ascii + 1. w _ (xTable at: ascii + 2) - x. newX _ newXTable at: ascii + 1. newGlyphs copy: (newX + extraOnLeft @ 0 extent: w @ glyphs height) from: x @ 0 in: glyphs rule: Form over. newXTable at: ascii + 2 put: newX + w + extraWidth]] ifTrue: [ newGlyphs _ Form extent: (glyphs width + (maxAscii * extraWidth)) @ glyphs height. w _ xTable width. newXTable width: w + extraWidth. minAscii to: maxAscii do: [ :ascii | x _ xTable at: ascii + 1. newX _ newXTable at: ascii + 1. newGlyphs copy: (newX + extraOnLeft @ 0 extent: w @ glyphs height) from: x @ 0 in: glyphs rule: Form over]]. glyphs _ newGlyphs. xTable _ newXTable. "Slide the bitmaps left and right for synthetic italic effect." 4 to: self ascent-1 by: 4 do: [:y | "Slide ascenders right..." glyphs copy: (1@0 extent: glyphs width @ (self ascent - y)) from: 0@0 in: glyphs rule: Form over]. self ascent to: self height-1 by: 4 do: [:y | "Slide descenders left..." glyphs copy: (0@y extent: glyphs width @ glyphs height) from: 1@y in: glyphs rule: Form over].! ! !StrikeFontSet methodsFor: 'as yet unclassified' stamp: 'sumim 4/23/2003 09:44'! emphasis: code "Set the integer code for synthetic bold, itallic, underline, and strike-out, where bold=1, italic=2, underlined=4, and struck out=8." emphasis _ code. fontArray ifNotNil: [fontArray do: [ :font | font ifNotNil: [ font emphasis: code ]]]! ! !StrikeFontSet methodsFor: 'emphasis' stamp: 'sumim 4/23/2003 00:04'! makeBoldGlyphs fontArray do: [ :font | font ifNotNil: [ font makeBoldGlyphs ]]! ! !StrikeFontSet methodsFor: 'emphasis' stamp: 'sumim 4/23/2003 00:04'! makeItalicGlyphs fontArray do: [ :font | font ifNotNil: [ font makeItalicGlyphs ]]! ! | fonts newGlyphs | #('kaname' 'kanji15') do: [ :fontName | fonts _ StrikeFont allInstances select: [ :font | font name = fontName ]. fonts isEmpty ifTrue: [^ self ]. fonts do: [ :font | | xTable glyphs width height newX | xTable _ font xTable. glyphs _ font glyphs. width _ xTable width. height _ glyphs height. newGlyphs _ Form extent: glyphs width + font maxAscii @ height. font minAscii to: font maxAscii do: [ :ascii | | x | x _ xTable at: ascii + 1. newX _ width + 1 * ascii. newGlyphs copy: (newX @ 0 extent: width @ height) from: x @ 0 in: glyphs rule: Form over]. font setGlyphs: newGlyphs]. (fonts collect: [ :font | font xTable ]) asSet do: [ :table | table width: table width + 1 ]]. TextStyle default fontArray collect: [ :font | font reset ]!