Nicolas Cellier uploaded a new version of Multilingual to project The Trunk:
http://source.squeak.org/trunk/Multilingual-nice.81.mcz ==================== Summary ==================== Name: Multilingual-nice.81 Author: nice Time: 10 January 2010, 3:26:53.142 pm UUID: 72b8c1aa-fe9e-4e84-a9c9-dab63fd2ef1d Ancestors: Multilingual-ar.80 Correct a bug in StrikeFont (ascii assigned with a Character rather than its code). change pattern dest:=dest+(x@0) into dest:=dest x+x@dest y =============== Diff against Multilingual-ar.80 =============== Item was changed: + ----- Method: TTCFontSet>>pointSize (in category 'accessing') ----- - ----- Method: TTCFontSet>>pointSize (in category 'as yet unclassified') ----- pointSize ^ fontArray first pixelSize * 72 // 96. ! Item was changed: + ----- Method: TTCFontSet>>isTTCFont (in category 'testing') ----- - ----- Method: TTCFontSet>>isTTCFont (in category 'as yet unclassified') ----- isTTCFont ^true! Item was changed: + ----- Method: TTCFontSet>>familySizeFace (in category 'accessing') ----- - ----- Method: TTCFontSet>>familySizeFace (in category 'as yet unclassified') ----- familySizeFace ^ Array with: fontArray first name with: self height with: 0. ! Item was changed: ----- Method: StrikeFontSet>>displayMultiString:on:from:to:at:kern:baselineY: (in category 'displaying') ----- displayMultiString: aString on: aBitBlt from: startIndex to: stopIndex at: aPoint kern: kernDelta baselineY: baselineY | destPoint leftX rightX glyphInfo g destY | destPoint := aPoint. glyphInfo := Array new: 5. startIndex to: stopIndex do: [:charIndex | self glyphInfoOf: (aString at: charIndex) into: glyphInfo. g := glyphInfo at:1. leftX := glyphInfo at:2. rightX := glyphInfo at:3. ((glyphInfo at:5) ~= aBitBlt lastFont) ifTrue: [ (glyphInfo at:5) installOn: aBitBlt. ]. aBitBlt sourceForm: g. destY := baselineY - (glyphInfo at:4). aBitBlt destX: (destPoint x) destY: destY width: (rightX - leftX) height: (self height). aBitBlt sourceOrigin: leftX @ 0. aBitBlt copyBits. + destPoint := destPoint x + (rightX - leftX + kernDelta) @ destPoint y. - destPoint := destPoint + (rightX - leftX + kernDelta @ 0). ]. ^ destPoint.! Item was changed: + ----- Method: TTCFontDescription>>deepCopy (in category 'copying') ----- - ----- Method: TTCFontDescription>>deepCopy (in category 'as yet unclassified') ----- deepCopy ^ self. ! Item was changed: + ----- Method: TTCFontSet>>familyName (in category 'accessing') ----- - ----- Method: TTCFontSet>>familyName (in category 'as yet unclassified') ----- familyName ^ 'Multi', (fontArray at: 1) familyName. ! Item was changed: + ----- Method: TTCFontSet>>descentKern (in category 'accessing') ----- - ----- Method: TTCFontSet>>descentKern (in category 'as yet unclassified') ----- descentKern ^ 0. ! Item was changed: ----- Method: StrikeFontSet>>characters:in:displayAt:clippedBy:rule:fillColor:kernDelta:on: (in category 'displaying') ----- characters: anInterval in: sourceString displayAt: aPoint clippedBy: clippingRectangle rule: ruleInteger fillColor: aForm kernDelta: kernDelta on: aBitBlt "Simple, slow, primitive method for displaying a line of characters. No wrap-around is provided." + ^anInterval inject: aPoint into: + [:destPoint :i | + | f xTable leftX noFont sourceRect encoding ascii rightX | - | destPoint | - destPoint := aPoint. - anInterval do: - [:i | | f xTable leftX noFont sourceRect encoding ascii rightX | encoding := (sourceString at: i) leadingChar + 1. noFont := false. + f := [fontArray at: encoding] + on: Exception do: [:ex | nil]. - [f := fontArray at: encoding] - on: Exception do: [:ex | noFont := true. f := fontArray at: 1]. f ifNil: [noFont := true. f := fontArray at: 1]. + ascii := (noFont ifTrue: [$?] ifFalse: [sourceString at: i]) charCode. - ascii := noFont ifTrue: [$?] ifFalse: [(sourceString at: i) charCode]. (ascii < f minAscii or: [ascii > f maxAscii]) ifTrue: [ascii := f maxAscii]. xTable := f xTable. leftX := xTable at: ascii + 1. rightX := xTable at: ascii + 2. + sourceRect := leftX @ 0 extent: (rightX - leftX) @ self height. - sourceRect := leftX@0 extent: (rightX-leftX) @ self height. aBitBlt copyFrom: sourceRect in: f glyphs to: destPoint. + destPoint x + (rightX - leftX + kernDelta) @ destPoint y. - destPoint := destPoint + ((rightX-leftX+kernDelta)@0). - "destPoint printString displayAt: 0@(i*20)." ]. - ^ destPoint. ! Item was changed: + ----- Method: TTCFontSet>>depth (in category 'accessing') ----- - ----- Method: TTCFontSet>>depth (in category 'as yet unclassified') ----- depth ^ (fontArray at: 1) depth. ! Item was changed: + ----- Method: TTCFontSet>>emphasis (in category 'accessing') ----- - ----- Method: TTCFontSet>>emphasis (in category 'as yet unclassified') ----- emphasis ^ fontArray first emphasis! Item was changed: + ----- Method: SparseXTable>>tableFor: (in category 'accessing') ----- - ----- Method: SparseXTable>>tableFor: (in category 'as yet unclassified') ----- tableFor: code + | div | - | div t | div := code // 65536. + ^xTables at: div ifAbsent: [ - t := xTables at: div ifAbsent: [ | table | table := Array new: 65536 withAll: 0. xTables at: div put: table. table]. - ^ t. ! Item was changed: + ----- Method: TTCFontDescription>>objectForDataStream: (in category 'objects from disk') ----- - ----- Method: TTCFontDescription>>objectForDataStream: (in category 'as yet unclassified') ----- objectForDataStream: refStrm | dp | "I am about to be written on an object file. Write a reference to a known Font in the other system instead. " "A path to me" (TextConstants at: #forceFontWriting ifAbsent: [false]) ifTrue: [^ self]. "special case for saving the default fonts on the disk. See collectionFromFileNamed:" dp := DiskProxy global: #TTCFontDescription selector: #descriptionNamed:at: args: {self name. ((TTCFontDescription descriptionNamed: self name) indexOf: self)}. refStrm replace: self with: dp. ^ dp. ! Item was changed: + ----- Method: TTCFontSet>>pointSizes (in category 'accessing') ----- - ----- Method: TTCFontSet>>pointSizes (in category 'as yet unclassified') ----- pointSizes ^ self class pointSizes. ! Item was changed: + ----- Method: TTCFontSet>>textStyle (in category 'accessing') ----- - ----- Method: TTCFontSet>>textStyle (in category 'as yet unclassified') ----- textStyle ^ TextStyle actualTextStyles detect: [:aStyle | (aStyle fontArray collect: [:s | s name]) includes: self name] ifNone: []. ! Item was changed: + ----- Method: TTCFontSet>>widthOf: (in category 'measuring') ----- - ----- Method: TTCFontSet>>widthOf: (in category 'as yet unclassified') ----- widthOf: aCharacter | encoding | encoding := aCharacter leadingChar. ^ (fontArray at: encoding + 1) widthOf: aCharacter. ! Item was changed: + ----- Method: TTCFontSet>>glyphInfoOf:into: (in category 'private') ----- - ----- Method: TTCFontSet>>glyphInfoOf:into: (in category 'as yet unclassified') ----- glyphInfoOf: aCharacter into: glyphInfoArray | index f code | index := aCharacter leadingChar + 1. fontArray size < index ifTrue: [^ self questionGlyphInfoInto: glyphInfoArray]. (f := fontArray at: index) ifNil: [^ self questionGlyphInfoInto: glyphInfoArray]. code := aCharacter charCode. ((code between: f minAscii and: f maxAscii) not) ifTrue: [ ^ self questionGlyphInfoInto: glyphInfoArray. ]. f glyphInfoOf: aCharacter into: glyphInfoArray. glyphInfoArray at: 5 put: self. ^ glyphInfoArray. ! Item was changed: + ----- Method: TTCFontDescription>>at: (in category 'accessing') ----- - ----- Method: TTCFontDescription>>at: (in category 'as yet unclassified') ----- at: aCharOrInteger | char | char := aCharOrInteger asCharacter. ^ glyphs at: (char charCode) + 1. ! Item was changed: + ----- Method: TTCFontSet>>isFontSet (in category 'testing') ----- - ----- Method: TTCFontSet>>isFontSet (in category 'as yet unclassified') ----- isFontSet ^ true. ! Item was changed: + ----- Method: TTCFontSet>>height (in category 'accessing') ----- - ----- Method: TTCFontSet>>height (in category 'as yet unclassified') ----- height ^fontArray first pixelSize. ! Item was changed: + ----- Method: TTCFontSet>>lineGrid (in category 'accessing') ----- - ----- Method: TTCFontSet>>lineGrid (in category 'as yet unclassified') ----- lineGrid ^ fontArray first lineGrid. ! Item was changed: + ----- Method: TTCFontSet>>displayString:on:from:to:at:kern:baselineY: (in category 'displaying') ----- - ----- Method: TTCFontSet>>displayString:on:from:to:at:kern:baselineY: (in category 'as yet unclassified') ----- displayString: aString on: aBitBlt from: startIndex to: stopIndex at: aPoint kern: kernDelta baselineY: baselineY | destPoint font form encoding glyphInfo char charCode destY | destPoint := aPoint. glyphInfo := Array new: 5. startIndex to: stopIndex do: [:charIndex | char := aString at: charIndex. encoding := char leadingChar + 1. charCode := char charCode. font := fontArray at: encoding. ((charCode between: font minAscii and: font maxAscii) not) ifTrue: [ charCode := font maxAscii]. self glyphInfoOf: char into: glyphInfo. form := glyphInfo first. (glyphInfo fifth ~= aBitBlt lastFont) ifTrue: [ glyphInfo fifth installOn: aBitBlt. ]. destY := baselineY - glyphInfo fourth. + aBitBlt + sourceForm: form; + destX: destPoint x; + destY: destY; + sourceOrigin: 0 @ 0; + width: form width; + height: form height; + copyBits. + destPoint := destPoint x + (form width + kernDelta) @ destPoint y. - aBitBlt sourceForm: form. - aBitBlt destX: destPoint x. - aBitBlt destY: destY. - aBitBlt sourceOrigin: 0 @ 0. - aBitBlt width: form width. - aBitBlt height: form height. - aBitBlt copyBits. - destPoint := destPoint + (form width + kernDelta @ 0). ]. ^ destPoint. ! Item was changed: + ----- Method: TTCFontSet>>questionGlyphInfoInto: (in category 'private') ----- - ----- Method: TTCFontSet>>questionGlyphInfoInto: (in category 'as yet unclassified') ----- questionGlyphInfoInto: glyphInfoArray | f form | f := fontArray at: 1. form := f formOf: $?. glyphInfoArray at: 1 put: form; at: 2 put: 0; at: 3 put: form width; at: 4 put: self. ^ glyphInfoArray. ! Item was changed: + ----- Method: TTCFontDescription>>name (in category 'accessing') ----- - ----- Method: TTCFontDescription>>name (in category 'as yet unclassified') ----- name ^ self familyName copyWithout: Character space. ! Item was changed: + ----- Method: TTCFontSet>>ascent (in category 'accessing') ----- - ----- Method: TTCFontSet>>ascent (in category 'as yet unclassified') ----- ascent ^ (fontArray at: 1) ascent. ! Item was changed: + ----- Method: TTCFontDescription>>size (in category 'accessing') ----- - ----- Method: TTCFontDescription>>size (in category 'as yet unclassified') ----- size ^ glyphs size. ! Item was changed: + ----- Method: TTCFontSet>>descent (in category 'accessing') ----- - ----- Method: TTCFontSet>>descent (in category 'as yet unclassified') ----- descent ^ (fontArray at: 1) descent. ! Item was changed: + ----- Method: TTCFontSet>>baseKern (in category 'accessing') ----- - ----- Method: TTCFontSet>>baseKern (in category 'as yet unclassified') ----- baseKern ^ 0. ! Item was changed: + ----- Method: TTCFontSet>>fontArray (in category 'accessing') ----- - ----- Method: TTCFontSet>>fontArray (in category 'as yet unclassified') ----- fontArray ^ fontArray ! Item was changed: + ----- Method: TTCFontSet>>emphasized: (in category 'accessing') ----- - ----- Method: TTCFontSet>>emphasized: (in category 'as yet unclassified') ----- emphasized: code ! Item was changed: + ----- Method: TTCFontSet>>descentOf: (in category 'accessing') ----- - ----- Method: TTCFontSet>>descentOf: (in category 'as yet unclassified') ----- descentOf: aChar ^ fontArray first descentOf: aChar ! Item was changed: + ----- Method: TTCFontSet>>ascentOf: (in category 'accessing') ----- - ----- Method: TTCFontSet>>ascentOf: (in category 'as yet unclassified') ----- ascentOf: aCharacter ^ fontArray first ascentOf: aCharacter. ! Item was changed: ----- Method: StrikeFontSet>>displayString:on:from:to:at:kern:from:baselineY: (in category 'displaying') ----- displayString: aString on: aBitBlt from: startIndex to: stopIndex at: aPoint kern: kernDelta from: fromFont baselineY: baselineY | destPoint leftX rightX glyphInfo g tag char destY | destPoint := aPoint. rIndex := startIndex. tag := (aString at: rIndex) leadingChar. glyphInfo := Array new: 5. [rIndex <= stopIndex] whileTrue: [ char := aString at: rIndex. ((fromFont hasGlyphOf: char) or: [char leadingChar ~= tag]) ifTrue: [^destPoint]. self glyphInfoOf: char into: glyphInfo. g := glyphInfo first. leftX := glyphInfo second. rightX := glyphInfo third. (glyphInfo fifth ~= aBitBlt lastFont) ifTrue: [ glyphInfo fifth installOn: aBitBlt. ]. - aBitBlt sourceForm: g. destY := baselineY - glyphInfo fourth. + aBitBlt + sourceForm: g; + destX: destPoint x; + destY: destY; + sourceOrigin: leftX @ 0; + width: rightX - leftX; + height: self height; + copyBits. + destPoint := destPoint x + (rightX - leftX + kernDelta) @ destPoint y. - aBitBlt destX: destPoint x. - aBitBlt destY: destY. - aBitBlt sourceOrigin: leftX @ 0. - aBitBlt width: rightX - leftX. - aBitBlt height: self height. - aBitBlt copyBits. - destPoint := destPoint + (rightX - leftX + kernDelta @ 0). rIndex := rIndex + 1. ]. ^destPoint. ! Item was changed: + ----- Method: TTCFontSet>>displayString:on:from:to:at:kern: (in category 'displaying') ----- - ----- Method: TTCFontSet>>displayString:on:from:to:at:kern: (in category 'as yet unclassified') ----- displayString: aString on: aBitBlt from: startIndex to: stopIndex at: aPoint kern: kernDelta ^ self displayString: aString on: aBitBlt from: startIndex to: stopIndex at: aPoint kern: kernDelta baselineY: aPoint y + self ascent. ! Item was changed: ----- Method: StrikeFontSet>>displayStringR2L:on:from:to:at:kern: (in category 'displaying') ----- displayStringR2L: aString on: aBitBlt from: startIndex to: stopIndex at: aPoint kern: kernDelta | destPoint font | destPoint := aPoint. startIndex to: stopIndex do: [:charIndex | | encoding ascii xTable leftX rightX | encoding := (aString at: charIndex) leadingChar + 1. ascii := (aString at: charIndex) charCode. font := fontArray at: encoding. ((ascii between: font minAscii and: font maxAscii) not) ifTrue: [ ascii := font maxAscii]. xTable := font xTable. leftX := xTable at: ascii + 1. rightX := xTable at: ascii + 2. + aBitBlt + sourceForm: font glyphs; + destX: destPoint x - (rightX - leftX); + destY: destPoint y; + sourceOrigin: leftX @ 0; + width: rightX - leftX; + height: self height; + copyBits. + destPoint := destPoint x - (rightX - leftX + kernDelta) @ destPoint y. - aBitBlt sourceForm: font glyphs. - aBitBlt destX: destPoint x - (rightX - leftX). - aBitBlt destY: destPoint y. - aBitBlt sourceOrigin: leftX @ 0. - aBitBlt width: rightX - leftX. - aBitBlt height: self height. - aBitBlt copyBits. - destPoint := destPoint - (rightX - leftX + kernDelta @ 0). ]. ! Item was changed: + ----- Method: TTCFontDescription>>veryDeepCopyWith: (in category 'copying') ----- - ----- Method: TTCFontDescription>>veryDeepCopyWith: (in category 'as yet unclassified') ----- veryDeepCopyWith: deepCopier "Return self. I am shared. Do not record me." ! Item was changed: + ----- Method: TTCFontSet>>displayStringR2L:on:from:to:at:kern: (in category 'displaying') ----- - ----- Method: TTCFontSet>>displayStringR2L:on:from:to:at:kern: (in category 'as yet unclassified') ----- displayStringR2L: aString on: aBitBlt from: startIndex to: stopIndex at: aPoint kern: kernDelta | destPoint font form encoding char charCode glyphInfo | destPoint := aPoint. glyphInfo := Array new: 5. startIndex to: stopIndex do: [:charIndex | char := aString at: charIndex. encoding := char leadingChar + 1. charCode := char charCode. font := fontArray at: encoding. ((charCode between: font minAscii and: font maxAscii) not) ifTrue: [ charCode := font maxAscii]. self glyphInfoOf: char into: glyphInfo. form := glyphInfo first. (glyphInfo size > 4 and: [glyphInfo fifth notNil and: [glyphInfo fifth ~= aBitBlt lastFont]]) ifTrue: [ glyphInfo fifth installOn: aBitBlt. ]. + aBitBlt + sourceForm: form; + destX: destPoint x - form width; + destY: destPoint y; + sourceOrigin: 0 @ 0; + width: form width; + height: form height; + copyBits. + destPoint := destPoint x - (form width + kernDelta) @ destPoint y. - aBitBlt sourceForm: form. - aBitBlt destX: destPoint x - form width. - aBitBlt destY: destPoint y. - aBitBlt sourceOrigin: 0 @ 0. - aBitBlt width: form width. - aBitBlt height: form height. - aBitBlt copyBits. - destPoint := destPoint - (form width + kernDelta @ 0). ]. ! Item was changed: + ----- Method: TTCFont>>setupDefaultFallbackFont (in category 'emphasis') ----- - ----- Method: TTCFont>>setupDefaultFallbackFont (in category 'as yet unclassified') ----- setupDefaultFallbackFont | fonts f | fonts := TextStyle default fontArray. f := fonts first. 1 to: fonts size do: [:i | self height > (fonts at: i) height ifTrue: [f := fonts at: i]. ]. (f == self) ifFalse:[ self fallbackFont: f ]. self reset. ! Item was changed: + ----- Method: TTCFontSet>>maxAsciiFor: (in category 'accessing') ----- - ----- Method: TTCFontSet>>maxAsciiFor: (in category 'as yet unclassified') ----- maxAsciiFor: encoding | f | f := (fontArray at: encoding+1). f ifNotNil: [^ f maxAscii]. ^ 0. ! |
Free forum by Nabble | Edit this page |