<div dir="ltr"><div>Exactly!<br></div>Multilingual features have been merged back into regular classes, so we don't need a fork anymore.<br><div><div><div class="gmail_extra"><br><div class="gmail_quote">2017-10-05 21:03 GMT+02:00 H. Hirzel <span dir="ltr"><<a href="mailto:hannes.hirzel@gmail.com" target="_blank">hannes.hirzel@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Note regarding the thread 'MorphicProject subclass: #EtoysProject'<br>
<br>
Answer 'NewParagraph' when asked for a replacement class for 'MultiNewParagraph'<br>
<div class="HOEnZb"><div class="h5"><br>
On Sat, 15 Apr 2017 13:45:33 0000, <a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a><br>
<<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>> wrote:<br>
> Nicolas Cellier uploaded a new version of EToys to project The Trunk:<br>
> <a href="http://source.squeak.org/trunk/EToys-nice.292.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/<wbr>trunk/EToys-nice.292.mcz</a><br>
><br>
> ==================== Summary ====================<br>
><br>
> Name: EToys-nice.292<br>
> Author: nice<br>
> Time: 15 April 2017, 3:44:39.800437 pm<br>
> UUID: 39acfe15-791f-41c6-8aad-<wbr>d679664643e7<br>
> Ancestors: EToys-eem.291<br>
><br>
> Remove the Multi*Scanner, MultiNewParagraph, MultiComposer because they have<br>
> no additional value.<br>
><br>
> =============== Diff against EToys-eem.291 ===============<br>
><br>
> Item was changed:<br>
> SystemOrganization addCategory: #'Etoys-Buttons'!<br>
> SystemOrganization addCategory: #'Etoys-CustomEvents'!<br>
> SystemOrganization addCategory: #'Etoys-Experimental'!<br>
> SystemOrganization addCategory: #'Etoys-Outliner'!<br>
> SystemOrganization addCategory: #'Etoys-Protocols'!<br>
> SystemOrganization addCategory: #'Etoys-Protocols-Type Vocabularies'!<br>
> SystemOrganization addCategory: #'Etoys-Scripting'!<br>
> SystemOrganization addCategory: #'Etoys-Scripting Support'!<br>
> SystemOrganization addCategory: #'Etoys-Scripting Tiles'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-<wbr>BroomMorphs-Base'!<br>
> SystemOrganization addCategory:<br>
> #'Etoys-Squeakland-<wbr>BroomMorphs-Connectors'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-EToys-<wbr>Kedama'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-<wbr>Buttons'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-<wbr>Calendar'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-<wbr>Debugger'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-Help'<wbr>!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-<wbr>Input'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-<wbr>Scripting'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-<wbr>Scripting<br>
> Support'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-<wbr>Scripting Tiles'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-<wbr>SpeechBubbles'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-Tile Scriptors'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Graphics-<wbr>External'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Graphics-<wbr>Text'!<br>
> SystemOrganization addCategory:<br>
> #'Etoys-Squeakland-Graphics-<wbr>Tools-Intersection'!<br>
> SystemOrganization addCategory:<br>
> #'Etoys-Squeakland-Graphics-<wbr>Tools-Simplification'!<br>
> SystemOrganization addCategory:<br>
> #'Etoys-Squeakland-Graphics-<wbr>Tools-Triangulation'!<br>
> SystemOrganization addCategory:<br>
> #'Etoys-Squeakland-<wbr>MorphicExtras-<wbr>AdditionalMorphs'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-<wbr>MorphicExtras-Charts'!<br>
> SystemOrganization addCategory:<br>
> #'Etoys-Squeakland-<wbr>MorphicExtras-Postscript Filters'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-<wbr>MorphicExtras-WebCam'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-<wbr>MorphicExtras-Widgets'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-<wbr>Basic'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-<wbr>Books'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-<wbr>Components'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-<wbr>Demo'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-<wbr>Experimental'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-<wbr>Games'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-<wbr>Games-Chess'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-<wbr>GeeMail'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-<wbr>Kernel'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-<wbr>Mentoring'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-<wbr>Navigators'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-<wbr>PartsBin'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-<wbr>PDA'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-<wbr>Support'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-<wbr>Widgets'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-<wbr>Windows'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-<wbr>Worlds'!<br>
> SystemOrganization addCategory:<br>
> #'Etoys-Squeakland-<wbr>Multilingual-Languages'!<br>
> - SystemOrganization addCategory: #'Etoys-Squeakland-<wbr>Multilingual-Scanning'!<br>
> SystemOrganization addCategory:<br>
> #'Etoys-Squeakland-<wbr>Multilingual-TextConversion'!<br>
> SystemOrganization addCategory:<br>
> #'Etoys-Squeakland-Network-<wbr>HTML-Formatter'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Network-<wbr>HTML-Forms'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Network-<wbr>HTML-Parser'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Network-<wbr>HTML-Parser<br>
> Entities'!<br>
> SystemOrganization addCategory:<br>
> #'Etoys-Squeakland-Network-<wbr>HTML-Tokenizer'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Network-<wbr>MIME'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Network-<wbr>TelNet<br>
> WordNet'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Network-UI'<wbr>!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Network-<wbr>Url'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Protocols-<wbr>Type<br>
> Vocabularies'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Sound-<wbr>Interface'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Sound-Ogg'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Sound-<wbr>Scores'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-ST80-<wbr>Morphic'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-SUnit'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Sugar'!<br>
> SystemOrganization addCategory:<br>
> #'Etoys-Squeakland-System-<wbr>Clipboard-Extended'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-System-<wbr>Compiler'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-System-<wbr>Exceptions<br>
> Kernel'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-System-<wbr>Support'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Tools-<wbr>Changes'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Tools-<wbr>Explorer'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Tools-File Contents<br>
> Browser'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Tools-<wbr>Process Browser'!<br>
> SystemOrganization addCategory:<br>
> #'Etoys-Squeakland-Tweak-<wbr>Kedama-ObjectVectors'!<br>
> SystemOrganization addCategory:<br>
> #'Etoys-Squeakland-Tweak-<wbr>Kedama-ParseTreeTransformer'!<br>
> SystemOrganization addCategory:<br>
> #'Etoys-Squeakland-Tweak-<wbr>Kedama-ParseTree-<wbr>AttributeDefinition'!<br>
> SystemOrganization addCategory: #'Etoys-Stacks'!<br>
> SystemOrganization addCategory: #'Etoys-StarSqueak'!<br>
> SystemOrganization addCategory: #'Etoys-Support'!<br>
> SystemOrganization addCategory: #'Etoys-Tests'!<br>
> SystemOrganization addCategory: #'Etoys-Tile Scriptors'!<br>
> SystemOrganization addCategory: #'Etoys-Widgets'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-Support'!<br>
> SystemOrganization addCategory: #'Etoys-Squeakland-SISS-<wbr>Serialization'!<br>
> SystemOrganization addCategory: #'Etoys-OLPC-Display'!<br>
> SystemOrganization addCategory: #'Etoys-ReleaseBuilder'!<br>
> SystemOrganization addCategory: #'Etoys-UserInterfaceTheme'!<br>
><br>
> Item was removed:<br>
> - ----- Method:<br>
> GrafPort>><wbr>displayScannerForMulti:<wbr>foreground:background:<wbr>ignoreColorChanges:<br>
> (in category '*Etoys-Squeakland-accessing') -----<br>
> - displayScannerForMulti: para foreground: foreColor background: backColor<br>
> ignoreColorChanges: shadowMode<br>
> -<br>
> - ((para isMemberOf: MultiNewParagraph) or: [para text string<br>
> isByteString]) ifTrue: [<br>
> - ^ (MultiDisplayScanner new text: para presentationText textStyle: para<br>
> textStyle<br>
> - foreground: foreColor background: backColor fillBlt: self<br>
> - ignoreColorChanges: shadowMode)<br>
> - setPort: self clone<br>
> - ].<br>
> - ^ (DisplayScanner new text: para text textStyle: para textStyle<br>
> - foreground: foreColor background: backColor fillBlt: self<br>
> - ignoreColorChanges: shadowMode)<br>
> - setPort: self clone<br>
> - !<br>
><br>
> Item was removed:<br>
> - MultiCharacterScanner subclass: #MultiCanvasCharacterScanner<br>
> - instanceVariableNames: 'canvas fillBlt foregroundColor runX lineY'<br>
> - classVariableNames: ''<br>
> - poolDictionaries: ''<br>
> - category: 'Etoys-Squeakland-<wbr>Multilingual-Scanning'!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCanvasCharacterScanner>><wbr>canvas: (in category<br>
> 'accessing') -----<br>
> - canvas: aCanvas<br>
> - "set the canvas to draw on"<br>
> - canvas ifNotNil: [ self inform: 'initializing twice!!' ].<br>
> - canvas := aCanvas!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCanvasCharacterScanner>><wbr>cr (in category 'stop<br>
> conditions') -----<br>
> - cr<br>
> - "When a carriage return is encountered, simply increment the pointer<br>
> - into the paragraph."<br>
> -<br>
> - lastIndex := lastIndex + 1.<br>
> - ^false!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCanvasCharacterScanner>><wbr>crossedX (in category 'stop<br>
> conditions') -----<br>
> - crossedX<br>
> - "This condition will sometimes be reached 'legally' during display, when,<br>
> - for instance the space that caused the line to wrap actually extends over<br>
> - the right boundary. This character is allowed to display, even though it<br>
> - is technically outside or straddling the clipping ectangle since it is in<br>
> - the normal case not visible and is in any case appropriately clipped by<br>
> - the scanner."<br>
> -<br>
> - "self fillLeading."<br>
> - ^ true !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCanvasCharacterScanner>><wbr>displayLine:offset:leftInRun:<br>
> (in category 'scanning') -----<br>
> - displayLine: textLine offset: offset leftInRun: leftInRun<br>
> - | nowLeftInRun done startLoc startIndex stopCondition |<br>
> - "largely copied from DisplayScanner's routine"<br>
> -<br>
> - line := textLine.<br>
> - foregroundColor ifNil: [ foregroundColor := Color black ].<br>
> - leftMargin := (line leftMarginForAlignment: alignment) + offset x.<br>
> -<br>
> - rightMargin := line rightMargin + offset x.<br>
> - lineY := line top + offset y.<br>
> - lastIndex := textLine first.<br>
> - leftInRun <= 0<br>
> - ifTrue: [self setStopConditions. "also sets the font"<br>
> - nowLeftInRun := text runLengthFor: lastIndex]<br>
> - ifFalse: [nowLeftInRun := leftInRun].<br>
> - runX := destX := leftMargin.<br>
> -<br>
> - runStopIndex := lastIndex + (nowLeftInRun - 1) min: line last.<br>
> - spaceCount := 0.<br>
> - done := false.<br>
> -<br>
> - [done] whileFalse: [<br>
> - "remember where this portion of the line starts"<br>
> - startLoc := destX@destY.<br>
> - startIndex := lastIndex.<br>
> -<br>
> - "find the end of this portion of the line"<br>
> - stopCondition := self scanCharactersFrom: lastIndex to: runStopIndex<br>
> - in: text string rightX: rightMargin stopConditions: stopConditions<br>
> - kern: kern "displaying: false".<br>
> -<br>
> - "display that portion of the line"<br>
> - canvas drawString: text string<br>
> - from: startIndex to: lastIndex<br>
> - at: startLoc<br>
> - font: font<br>
> - color: foregroundColor.<br>
> -<br>
> - "handle the stop condition"<br>
> - done := self perform: stopCondition<br>
> - ].<br>
> -<br>
> - ^runStopIndex - lastIndex!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCanvasCharacterScanner>><wbr>doesDisplaying (in category<br>
> 'private') -----<br>
> - doesDisplaying<br>
> - ^false "it doesn't do displaying using copyBits"!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCanvasCharacterScanner>><wbr>endOfRun (in category 'stop<br>
> conditions') -----<br>
> - endOfRun<br>
> - "The end of a run in the display case either means that there is actually<br>
> - a change in the style (run code) to be associated with the string or the<br>
> - end of this line has been reached."<br>
> - | runLength |<br>
> -<br>
> - lastIndex = line last ifTrue: [^true].<br>
> - runX := destX.<br>
> - runLength := text runLengthFor: (lastIndex := lastIndex + 1).<br>
> - runStopIndex := lastIndex + (runLength - 1) min: line last.<br>
> - self setStopConditions.<br>
> - ^ false!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCanvasCharacterScanner>><wbr>paddedSpace (in category 'stop<br>
> conditions') -----<br>
> - paddedSpace<br>
> - "Each space is a stop condition when the alignment is right justified.<br>
> - Padding must be added to the base width of the space according to<br>
> - which space in the line this space is and according to the amount of<br>
> - space that remained at the end of the line when it was composed."<br>
> -<br>
> - destX := destX + spaceWidth + (line justifiedPadFor: spaceCount).<br>
> -<br>
> - lastIndex := lastIndex + 1.<br>
> - ^ false!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCanvasCharacterScanner>><wbr>setFont (in category 'private')<br>
> -----<br>
> - setFont<br>
> - foregroundColor ifNil: [foregroundColor := Color black].<br>
> - super setFont.<br>
> - baselineY := lineY + line baseline.<br>
> - destY := baselineY - font ascent.!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCanvasCharacterScanner>><wbr>setStopConditions (in category<br>
> 'stop conditions') -----<br>
> - setStopConditions<br>
> - "Set the font and the stop conditions for the current run."<br>
> -<br>
> - self setFont.<br>
> - self setConditionArray: (textStyle alignment = Justified ifTrue:<br>
> [#paddedSpace]).<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCanvasCharacterScanner>><wbr>tab (in category 'stop<br>
> conditions') -----<br>
> - tab<br>
> -<br>
> - destX := (alignment == Justified and: [self leadingTab not])<br>
> - ifTrue: "imbedded tabs in justified text are weird"<br>
> - [destX + (textStyle tabWidth - (line justifiedTabDeltaFor: spaceCount))<br>
> max: destX]<br>
> - ifFalse:<br>
> - [textStyle nextTabXFrom: destX<br>
> - leftMargin: leftMargin<br>
> - rightMargin: rightMargin].<br>
> -<br>
> - lastIndex := lastIndex + 1.<br>
> - ^ false!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCanvasCharacterScanner>><wbr>textColor: (in category<br>
> 'private') -----<br>
> - textColor: color<br>
> - foregroundColor := color!<br>
><br>
> Item was removed:<br>
> - MultiCharacterScanner subclass: #MultiCharacterBlockScanner<br>
> - instanceVariableNames: 'characterPoint characterIndex lastCharacter<br>
> lastCharacterExtent lastSpaceOrTabExtent nextLeftMargin specialWidth'<br>
> - classVariableNames: ''<br>
> - poolDictionaries: ''<br>
> - category: 'Etoys-Squeakland-<wbr>Multilingual-Scanning'!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterBlockScanner>><wbr>buildCharacterBlockIn: (in<br>
> category 'private') -----<br>
> - buildCharacterBlockIn: para<br>
> - | lineIndex runLength lineStop done stopCondition |<br>
> - "handle nullText"<br>
> - (para numberOfLines = 0 or: [text size = 0])<br>
> - ifTrue: [^ CharacterBlock new stringIndex: 1 "like being off end of<br>
> string"<br>
> - text: para text<br>
> - topLeft: (para leftMarginForDisplayForLine: 1 alignment: (alignment<br>
> ifNil:[textStyle alignment]))<br>
> - @ para compositionRectangle top<br>
> - extent: 0 @ textStyle lineGrid].<br>
> - "find the line"<br>
> - lineIndex := para lineIndexOfTop: characterPoint y.<br>
> - destY := para topAtLineIndex: lineIndex.<br>
> - line := para lines at: lineIndex.<br>
> - rightMargin := para rightMarginForDisplay.<br>
> -<br>
> - (lineIndex = para numberOfLines and:<br>
> - [(destY + line lineHeight) < characterPoint y])<br>
> - ifTrue: ["if beyond lastLine, force search to last character"<br>
> - self characterPointSetX: rightMargin]<br>
> - ifFalse: [characterPoint y < (para compositionRectangle) top<br>
> - ifTrue: ["force search to first line"<br>
> - characterPoint := (para compositionRectangle) topLeft].<br>
> - characterPoint x > rightMargin<br>
> - ifTrue: [self characterPointSetX: rightMargin]].<br>
> - destX := (leftMargin := para leftMarginForDisplayForLine: lineIndex<br>
> alignment: (alignment ifNil:[textStyle alignment])).<br>
> - nextLeftMargin := para leftMarginForDisplayForLine: lineIndex+1<br>
> alignment: (alignment ifNil:[textStyle alignment]).<br>
> - lastIndex := line first.<br>
> -<br>
> - self setStopConditions. "also sets font"<br>
> - runLength := (text runLengthFor: line first).<br>
> - characterIndex == nil<br>
> - ifTrue: [lineStop := line last "characterBlockAtPoint"]<br>
> - ifFalse: [lineStop := characterIndex "characterBlockForIndex"].<br>
> - (runStopIndex := lastIndex + (runLength - 1)) > lineStop<br>
> - ifTrue: [runStopIndex := lineStop].<br>
> - lastCharacterExtent := 0 @ line lineHeight.<br>
> - spaceCount := 0. done := false.<br>
> - self handleIndentation.<br>
> -<br>
> - [done]<br>
> - whileFalse:<br>
> - [stopCondition := self scanCharactersFrom: lastIndex to: runStopIndex<br>
> - in: text string rightX: characterPoint x<br>
> - stopConditions: stopConditions kern: kern.<br>
> -<br>
> - "see setStopConditions for stopping conditions for character block<br>
> operations."<br>
> - self lastCharacterExtentSetX: (font widthOf: (text at: lastIndex)).<br>
> - (self perform: stopCondition) ifTrue:<br>
> - [characterIndex == nil<br>
> - ifTrue: ["characterBlockAtPoint"<br>
> - ^ CharacterBlock new stringIndex: lastIndex text: text<br>
> - topLeft: characterPoint + (font descentKern @ 0)<br>
> - extent: lastCharacterExtent]<br>
> - ifFalse: ["characterBlockForIndex"<br>
> - ^ CharacterBlock new stringIndex: lastIndex text: text<br>
> - topLeft: characterPoint + ((font descentKern) - kern @ 0)<br>
> - extent: lastCharacterExtent]]]!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterBlockScanner>><wbr>characterBlockAtPoint:in: (in<br>
> category 'scanning') -----<br>
> - characterBlockAtPoint: aPoint in: aParagraph<br>
> - "Answer a CharacterBlock for character in aParagraph at point aPoint. It<br>
> - is assumed that aPoint has been transformed into coordinates appropriate<br>
> - to the text's destination form rectangle and the composition rectangle."<br>
> -<br>
> - self initializeFromParagraph: aParagraph clippedBy: aParagraph<br>
> clippingRectangle.<br>
> - characterPoint := aPoint.<br>
> - ^self buildCharacterBlockIn: aParagraph!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterBlockScanner>><wbr>characterBlockAtPoint:index:<wbr>in:<br>
> (in category 'scanning') -----<br>
> - characterBlockAtPoint: aPoint index: index in: textLine<br>
> - "This method is the Morphic characterBlock finder. It combines<br>
> - MVC's characterBlockAtPoint:, -ForIndex:, and buildCharcterBlock:in:"<br>
> - | runLength lineStop done stopCondition |<br>
> - line := textLine.<br>
> - rightMargin := line rightMargin.<br>
> - lastIndex := line first.<br>
> - self setStopConditions. "also sets font"<br>
> - characterIndex := index. " == nil means scanning for point"<br>
> - characterPoint := aPoint.<br>
> - (characterPoint isNil or: [characterPoint y > line bottom])<br>
> - ifTrue: [characterPoint := line bottomRight].<br>
> - (text isEmpty or: [(characterPoint y < line top or: [characterPoint x <<br>
> line left])<br>
> - or: [characterIndex notNil and: [characterIndex < line first]]])<br>
> - ifTrue: [^ (CharacterBlock new stringIndex: line first text: text<br>
> - topLeft: line leftMargin@line top extent: 0 @ textStyle lineGrid)<br>
> - textLine: line].<br>
> - destX := leftMargin := line leftMarginForAlignment: alignment.<br>
> - destY := line top.<br>
> - runLength := text runLengthFor: line first.<br>
> - characterIndex<br>
> - ifNotNil: [lineStop := characterIndex "scanning for index"]<br>
> - ifNil: [lineStop := line last "scanning for point"].<br>
> - runStopIndex := lastIndex + (runLength - 1) min: lineStop.<br>
> - lastCharacterExtent := 0 @ line lineHeight.<br>
> - spaceCount := 0.<br>
> -<br>
> - done := false.<br>
> - [done] whileFalse:<br>
> - [stopCondition := self scanCharactersFrom: lastIndex to: runStopIndex<br>
> - in: text string rightX: characterPoint x<br>
> - stopConditions: stopConditions kern: kern.<br>
> - "see setStopConditions for stopping conditions for character block<br>
> operations."<br>
> - self lastCharacterExtentSetX: (specialWidth<br>
> - ifNil: [font widthOf: (text at: lastIndex)]<br>
> - ifNotNil: [specialWidth]).<br>
> - (self perform: stopCondition) ifTrue:<br>
> - [characterIndex<br>
> - ifNil: [<br>
> - "Result for characterBlockAtPoint: "<br>
> - (stopCondition ~~ #cr and: [ lastIndex == line last<br>
> - and: [ aPoint x > ((characterPoint x) + (lastCharacterExtent x / 2))<br>
> ]])<br>
> - ifTrue: [ "Correct for right half of last character in line"<br>
> - ^ (CharacterBlock new stringIndex: lastIndex + 1<br>
> - text: text<br>
> - topLeft: characterPoint + (lastCharacterExtent x @ 0) + (font<br>
> descentKern @ 0)<br>
> - extent: 0 @ lastCharacterExtent y)<br>
> - textLine: line ].<br>
> - ^ (CharacterBlock new stringIndex: lastIndex<br>
> - text: text topLeft: characterPoint + (font descentKern @ 0)<br>
> - extent: lastCharacterExtent - (font baseKern @ 0))<br>
> - textLine: line]<br>
> - ifNotNil: ["Result for characterBlockForIndex: "<br>
> - ^ (CharacterBlock new stringIndex: characterIndex<br>
> - text: text topLeft: characterPoint + ((font descentKern) - kern @<br>
> 0)<br>
> - extent: lastCharacterExtent)<br>
> - textLine: line]]]!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterBlockScanner>><wbr>characterBlockForIndex:in: (in<br>
> category 'scanning') -----<br>
> - characterBlockForIndex: targetIndex in: aParagraph<br>
> - "Answer a CharacterBlock for character in aParagraph at targetIndex. The<br>
> - coordinates in the CharacterBlock will be appropriate to the intersection<br>
> - of the destination form rectangle and the composition rectangle."<br>
> -<br>
> - self<br>
> - initializeFromParagraph: aParagraph<br>
> - clippedBy: aParagraph clippingRectangle.<br>
> - characterIndex := targetIndex.<br>
> - characterPoint :=<br>
> - aParagraph rightMarginForDisplay @<br>
> - (aParagraph topAtLineIndex:<br>
> - (aParagraph lineIndexOfCharacterIndex: characterIndex)).<br>
> - ^self buildCharacterBlockIn: aParagraph!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterBlockScanner>><wbr>characterPointSetX: (in category<br>
> 'private') -----<br>
> - characterPointSetX: xVal<br>
> - characterPoint := xVal @ characterPoint y!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterBlockScanner>>cr (in category 'stop<br>
> conditions') -----<br>
> - cr<br>
> - "Answer a CharacterBlock that specifies the current location of the mouse<br>
> - relative to a carriage return stop condition that has just been<br>
> - encountered. The ParagraphEditor convention is to denote selections by<br>
> - CharacterBlocks, sometimes including the carriage return (cursor is at<br>
> - the end) and sometimes not (cursor is in the middle of the text)."<br>
> -<br>
> - ((characterIndex ~= nil<br>
> - and: [characterIndex > text size])<br>
> - or: [(line last = text size)<br>
> - and: [(destY + line lineHeight) < characterPoint y]])<br>
> - ifTrue: ["When off end of string, give data for next character"<br>
> - destY := destY + line lineHeight.<br>
> - baselineY := line lineHeight.<br>
> - lastCharacter := nil.<br>
> - characterPoint := (nextLeftMargin ifNil: [leftMargin]) @ destY.<br>
> - lastIndex := lastIndex + 1.<br>
> - self lastCharacterExtentSetX: 0.<br>
> - ^ true].<br>
> - lastCharacter := CR.<br>
> - characterPoint := destX @ destY.<br>
> - self lastCharacterExtentSetX: rightMargin - destX.<br>
> - ^true!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterBlockScanner>><wbr>crossedX (in category 'stop<br>
> conditions') -----<br>
> - crossedX<br>
> - "Text display has wrapping. The scanner just found a character past the x<br>
> - location of the cursor. We know that the cursor is pointing at a<br>
> character<br>
> - or before one."<br>
> -<br>
> - | leadingTab currentX |<br>
> - characterIndex == nil ifFalse: [<br>
> - "If the last character of the last line is a space,<br>
> - and it crosses the right margin, then locating<br>
> - the character block after it is impossible without this hack."<br>
> - characterIndex > text size ifTrue: [<br>
> - lastIndex := characterIndex.<br>
> - characterPoint := (nextLeftMargin ifNil: [leftMargin]) @ (destY + line<br>
> lineHeight).<br>
> - ^true]].<br>
> - characterPoint x <= (destX + (lastCharacterExtent x // 2))<br>
> - ifTrue: [lastCharacter := (text at: lastIndex).<br>
> - characterPoint := destX @ destY.<br>
> - ^true].<br>
> - lastIndex >= line last<br>
> - ifTrue: [lastCharacter := (text at: line last).<br>
> - characterPoint := destX @ destY.<br>
> - ^true].<br>
> -<br>
> - "Pointing past middle of a character, return the next character."<br>
> - lastIndex := lastIndex + 1.<br>
> - lastCharacter := text at: lastIndex.<br>
> - currentX := destX + lastCharacterExtent x + kern.<br>
> - self lastCharacterExtentSetX: (font widthOf: lastCharacter).<br>
> - characterPoint := currentX @ destY.<br>
> - lastCharacter = Space ifFalse: [^ true].<br>
> -<br>
> - "Yukky if next character is space or tab."<br>
> - alignment = Justified ifTrue:<br>
> - [self lastCharacterExtentSetX:<br>
> - (lastCharacterExtent x + (line justifiedPadFor: (spaceCount + 1))).<br>
> - ^ true].<br>
> -<br>
> - true ifTrue: [^ true].<br>
> - "NOTE: I find no value to the following code, and so have defeated it -<br>
> DI"<br>
> -<br>
> - "See tabForDisplay for illumination on the following awfulness."<br>
> - leadingTab := true.<br>
> - line first to: lastIndex - 1 do:<br>
> - [:index | (text at: index) ~= Tab ifTrue: [leadingTab := false]].<br>
> - (alignment ~= Justified or: [leadingTab])<br>
> - ifTrue: [self lastCharacterExtentSetX: (textStyle nextTabXFrom: currentX<br>
> - leftMargin: leftMargin rightMargin: rightMargin) -<br>
> - currentX]<br>
> - ifFalse: [self lastCharacterExtentSetX: (((currentX + (textStyle<br>
> tabWidth -<br>
> - (line justifiedTabDeltaFor: spaceCount))) -<br>
> - currentX) max: 0)].<br>
> - ^ true!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterBlockScanner>><wbr>endOfRun (in category 'stop<br>
> conditions') -----<br>
> - endOfRun<br>
> - "Before arriving at the cursor location, the selection has encountered an<br>
> - end of run. Answer false if the selection continues, true otherwise. Set<br>
> - up indexes for building the appropriate CharacterBlock."<br>
> -<br>
> - | runLength lineStop |<br>
> - (((characterIndex ~~ nil and:<br>
> - [runStopIndex < characterIndex and: [runStopIndex < text size]])<br>
> - or: [characterIndex == nil and: [lastIndex < line last]]) or: [<br>
> - ((lastIndex < line last)<br>
> - and: [((text at: lastIndex) leadingChar ~= (text at: lastIndex+1)<br>
> leadingChar)<br>
> - and: [lastIndex ~= characterIndex]])])<br>
> - ifTrue: ["We're really at the end of a real run."<br>
> - runLength := (text runLengthFor: (lastIndex := lastIndex + 1)).<br>
> - characterIndex ~~ nil<br>
> - ifTrue: [lineStop := characterIndex "scanning for index"]<br>
> - ifFalse: [lineStop := line last "scanning for point"].<br>
> - (runStopIndex := lastIndex + (runLength - 1)) > lineStop<br>
> - ifTrue: [runStopIndex := lineStop].<br>
> - self setStopConditions.<br>
> - ^false].<br>
> -<br>
> - lastCharacter := text at: lastIndex.<br>
> - characterPoint := destX @ destY.<br>
> - ((lastCharacter = Space and: [alignment = Justified])<br>
> - or: [lastCharacter = Tab and: [lastSpaceOrTabExtent notNil]])<br>
> - ifTrue: [lastCharacterExtent := lastSpaceOrTabExtent].<br>
> - characterIndex ~~ nil<br>
> - ifTrue: ["If scanning for an index and we've stopped on that index,<br>
> - then we back destX off by the width of the character stopped on<br>
> - (it will be pointing at the right side of the character) and return"<br>
> - runStopIndex = characterIndex<br>
> - ifTrue: [self characterPointSetX: destX - lastCharacterExtent x.<br>
> - ^true].<br>
> - "Otherwise the requested index was greater than the length of the<br>
> - string. Return string size + 1 as index, indicate further that off<br>
> the<br>
> - string by setting character to nil and the extent to 0."<br>
> - lastIndex := lastIndex + 1.<br>
> - lastCharacter := nil.<br>
> - self lastCharacterExtentSetX: 0.<br>
> - ^true].<br>
> -<br>
> - "Scanning for a point and either off the end of the line or off the end<br>
> of the string."<br>
> - runStopIndex = text size<br>
> - ifTrue: ["off end of string"<br>
> - lastIndex := lastIndex + 1.<br>
> - lastCharacter := nil.<br>
> - self lastCharacterExtentSetX: 0.<br>
> - ^true].<br>
> - "just off end of line without crossing x"<br>
> - lastIndex := lastIndex + 1.<br>
> - ^true!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterBlockScanner>><wbr>indentationLevel: (in category<br>
> 'scanning') -----<br>
> - indentationLevel: anInteger<br>
> - super indentationLevel: anInteger.<br>
> - nextLeftMargin := leftMargin.<br>
> - indentationLevel timesRepeat: [<br>
> - nextLeftMargin := textStyle nextTabXFrom: nextLeftMargin<br>
> - leftMargin: leftMargin<br>
> - rightMargin: rightMargin]!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterBlockScanner>><wbr>lastCharacterExtentSetX: (in<br>
> category 'private') -----<br>
> - lastCharacterExtentSetX: xVal<br>
> - lastCharacterExtent := xVal @ lastCharacterExtent y!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterBlockScanner>><wbr>lastSpaceOrTabExtentSetX: (in<br>
> category 'private') -----<br>
> - lastSpaceOrTabExtentSetX: xVal<br>
> - lastSpaceOrTabExtent := xVal @ lastSpaceOrTabExtent y!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterBlockScanner>><wbr>paddedSpace (in category 'stop<br>
> conditions') -----<br>
> - paddedSpace<br>
> - "When the line is justified, the spaces will not be the same as the<br>
> font's<br>
> - space character. A padding of extra space must be considered in trying<br>
> - to find which character the cursor is pointing at. Answer whether the<br>
> - scanning has crossed the cursor."<br>
> -<br>
> - | pad |<br>
> - pad := 0.<br>
> - spaceCount := spaceCount + 1.<br>
> - pad := line justifiedPadFor: spaceCount.<br>
> - lastSpaceOrTabExtent := lastCharacterExtent copy.<br>
> - self lastSpaceOrTabExtentSetX: spaceWidth + pad.<br>
> - (destX + lastSpaceOrTabExtent x) >= characterPoint x<br>
> - ifTrue: [lastCharacterExtent := lastSpaceOrTabExtent copy.<br>
> - ^self crossedX].<br>
> - lastIndex := lastIndex + 1.<br>
> - destX := destX + lastSpaceOrTabExtent x.<br>
> - ^ false<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterBlockScanner>><wbr>placeEmbeddedObject: (in<br>
> category 'scanning') -----<br>
> - placeEmbeddedObject: anchoredMorph<br>
> - "Workaround: The following should really use #textAnchorType"<br>
> - anchoredMorph relativeTextAnchorPosition ifNotNil:[^true].<br>
> - (super placeEmbeddedObject: anchoredMorph) ifFalse: [^ false].<br>
> - specialWidth := anchoredMorph width.<br>
> - ^ true!<br>
><br>
> Item was removed:<br>
> - ----- Method:<br>
> MultiCharacterBlockScanner>><wbr>scanMultiCharactersCombiningFr<wbr>om:to:in:rightX:<wbr>stopConditions:kern:<br>
> (in category 'scanning') -----<br>
> - scanMultiCharactersCombiningFr<wbr>om: startIndex to: stopIndex in:<br>
> sourceString rightX: rightX stopConditions: stops kern: kernDelta<br>
> -<br>
> - | encoding f nextDestX maxAscii startEncoding char charValue |<br>
> - lastIndex := startIndex.<br>
> - lastIndex > stopIndex ifTrue: [lastIndex := stopIndex. ^ stops at:<br>
> EndOfRun].<br>
> - startEncoding := (sourceString at: startIndex) leadingChar.<br>
> - font ifNil: [font := (TextConstants at: #DefaultMultiStyle) fontArray at:<br>
> 1].<br>
> - ((font isMemberOf: StrikeFontSet) or: [font isKindOf: TTCFontSet])<br>
> ifTrue: [<br>
> - [f := font fontArray at: startEncoding + 1]<br>
> - on: Exception do: [:ex | f := font fontArray at: 1].<br>
> - f ifNil: [ f := font fontArray at: 1].<br>
> - maxAscii := f maxAscii.<br>
> - spaceWidth := f widthOf: Space.<br>
> - ] ifFalse: [<br>
> - maxAscii := font maxAscii.<br>
> - ].<br>
> -<br>
> - [lastIndex <= stopIndex] whileTrue: [<br>
> - encoding := (sourceString at: lastIndex) leadingChar.<br>
> - encoding ~= startEncoding ifTrue: [lastIndex := lastIndex - 1. ^ stops<br>
> at: EndOfRun].<br>
> - char := (sourceString at: lastIndex).<br>
> - charValue := char charCode.<br>
> - charValue > maxAscii ifTrue: [charValue := maxAscii].<br>
> - (encoding = 0 and: [(stopConditions at: charValue + 1) ~~ nil]) ifTrue:<br>
> [<br>
> - ^ stops at: charValue + 1<br>
> - ].<br>
> - nextDestX := destX + (self widthOf: char inFont: font).<br>
> - nextDestX > rightX ifTrue: [^ stops at: CrossedX].<br>
> - destX := nextDestX + kernDelta.<br>
> - lastIndex := lastIndex + 1.<br>
> - ].<br>
> - lastIndex := stopIndex.<br>
> - ^ stops at: EndOfRun!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterBlockScanner>><wbr>setFont (in category 'stop<br>
> conditions') -----<br>
> - setFont<br>
> - specialWidth := nil.<br>
> - super setFont!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterBlockScanner>><wbr>setStopConditions (in category<br>
> 'stop conditions') -----<br>
> - setStopConditions<br>
> - "Set the font and the stop conditions for the current run."<br>
> -<br>
> - self setFont.<br>
> - self setConditionArray: (alignment = Justified ifTrue: [#paddedSpace]).<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterBlockScanner>><wbr>tab (in category 'stop<br>
> conditions') -----<br>
> - tab<br>
> - | currentX |<br>
> - currentX := (alignment == Justified and: [self leadingTab not])<br>
> - ifTrue: "imbedded tabs in justified text are weird"<br>
> - [destX + (textStyle tabWidth - (line justifiedTabDeltaFor: spaceCount))<br>
> max: destX]<br>
> - ifFalse:<br>
> - [textStyle<br>
> - nextTabXFrom: destX<br>
> - leftMargin: leftMargin<br>
> - rightMargin: rightMargin].<br>
> - lastSpaceOrTabExtent := lastCharacterExtent copy.<br>
> - self lastSpaceOrTabExtentSetX: (currentX - destX max: 0).<br>
> - currentX >= characterPoint x<br>
> - ifTrue:<br>
> - [lastCharacterExtent := lastSpaceOrTabExtent copy.<br>
> - ^ self crossedX].<br>
> - destX := currentX.<br>
> - lastIndex := lastIndex + 1.<br>
> - ^false!<br>
><br>
> Item was removed:<br>
> - Object subclass: #MultiCharacterScanner<br>
> - instanceVariableNames: 'destX lastIndex xTable destY stopConditions text<br>
> textStyle alignment leftMargin rightMargin font line runStopIndex spaceCount<br>
> spaceWidth emphasisCode kern indentationLevel wantsColumnBreaks presentation<br>
> presentationLine numOfComposition baselineY firstDestX'<br>
> - classVariableNames: 'DefaultStopConditions NilCondition<br>
> PaddedSpaceCondition SpaceCondition'<br>
> - poolDictionaries: 'TextConstants'<br>
> - category: 'Etoys-Squeakland-<wbr>Multilingual-Scanning'!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner class>>initialize (in category 'class<br>
> initialization') -----<br>
> - initialize<br>
> - "<br>
> - MultiCharacterScanner initialize<br>
> - "<br>
> - | a |<br>
> - a := Array new: 258.<br>
> - a at: 1 + 1 put: #embeddedObject.<br>
> - a at: Tab asciiValue + 1 put: #tab.<br>
> - a at: CR asciiValue + 1 put: #cr.<br>
> - a at: EndOfRun put: #endOfRun.<br>
> - a at: CrossedX put: #crossedX.<br>
> - NilCondition := a copy.<br>
> - DefaultStopConditions := a copy.<br>
> -<br>
> - PaddedSpaceCondition := a copy.<br>
> - PaddedSpaceCondition at: Space asciiValue + 1 put: #paddedSpace.<br>
> -<br>
> - SpaceCondition := a copy.<br>
> - SpaceCondition at: Space asciiValue + 1 put: #space.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>addCharToPresentation: (in category<br>
> 'multilingual scanning') -----<br>
> - addCharToPresentation: char<br>
> -<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>addEmphasis: (in category 'private')<br>
> -----<br>
> - addEmphasis: code<br>
> - "Set the bold-ital-under-strike emphasis."<br>
> - emphasisCode := emphasisCode bitOr: code!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>addKern: (in category 'private')<br>
> -----<br>
> - addKern: kernDelta<br>
> - "Set the current kern amount."<br>
> - kern := kern + kernDelta!<br>
><br>
> Item was removed:<br>
> - ----- Method:<br>
> MultiCharacterScanner>><wbr>basicScanCharactersFrom:to:in:<wbr>rightX:stopConditions:kern:<br>
> (in category 'scanning') -----<br>
> - basicScanCharactersFrom: startIndex to: stopIndex in: sourceString rightX:<br>
> rightX stopConditions: stops kern: kernDelta<br>
> - "Primitive. This is the inner loop of text display--but see<br>
> - scanCharactersFrom: to:rightX: which would get the string,<br>
> - stopConditions and displaying from the instance. March through source<br>
> - String from startIndex to stopIndex. If any character is flagged with a<br>
> - non-nil entry in stops, then return the corresponding value. Determine<br>
> - width of each character from xTable, indexed by map.<br>
> - If dextX would exceed rightX, then return stops at: 258.<br>
> - Advance destX by the width of the character. If stopIndex has been<br>
> - reached, then return stops at: 257. Optional.<br>
> - See Object documentation whatIsAPrimitive."<br>
> - | ascii nextDestX char |<br>
> - <primitive: 103><br>
> - lastIndex := startIndex.<br>
> - [lastIndex <= stopIndex]<br>
> - whileTrue:<br>
> - [char := (sourceString at: lastIndex).<br>
> - ascii := char asciiValue + 1.<br>
> - (stops at: ascii) == nil ifFalse: [^stops at: ascii].<br>
> - "Note: The following is querying the font about the width<br>
> - since the primitive may have failed due to a non-trivial<br>
> - mapping of characters to glyphs or a non-existing xTable."<br>
> - nextDestX := destX + (font widthOf: char).<br>
> - nextDestX > rightX ifTrue: [^stops at: CrossedX].<br>
> - destX := nextDestX + kernDelta.<br>
> - lastIndex := lastIndex + 1].<br>
> - lastIndex := stopIndex.<br>
> - ^stops at: EndOfRun!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>columnBreak (in category 'scanning')<br>
> -----<br>
> - columnBreak<br>
> -<br>
> - ^true!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>combinableChar:for: (in category<br>
> 'scanner methods') -----<br>
> - combinableChar: char for: prevEntity<br>
> -<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>embeddedObject (in category<br>
> 'scanning') -----<br>
> - embeddedObject<br>
> - | savedIndex |<br>
> - savedIndex := lastIndex.<br>
> - text attributesAt: lastIndex do:[:attr|<br>
> - attr anchoredMorph ifNotNil:[<br>
> - "Following may look strange but logic gets reversed.<br>
> - If the morph fits on this line we're not done (return false for true)<br>
> - and if the morph won't fit we're done (return true for false)"<br>
> - (self placeEmbeddedObject: attr anchoredMorph) ifFalse:[^true]]].<br>
> - lastIndex := savedIndex + 1. "for multiple(!!) embedded morphs"<br>
> - ^false!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>handleIndentation (in category<br>
> 'scanning') -----<br>
> - handleIndentation<br>
> - self indentationLevel timesRepeat: [<br>
> - self plainTab]!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>indentationLevel (in category<br>
> 'scanning') -----<br>
> - indentationLevel<br>
> - "return the number of tabs that are currently being placed at the<br>
> beginning of each line"<br>
> - ^indentationLevel ifNil:[0]!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>indentationLevel: (in category<br>
> 'scanning') -----<br>
> - indentationLevel: anInteger<br>
> - "set the number of tabs to put at the beginning of each line"<br>
> - indentationLevel := anInteger!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>initialize (in category 'initialize')<br>
> -----<br>
> - initialize<br>
> - destX := destY := leftMargin := 0.!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>initializeFromParagraph:<wbr>clippedBy:<br>
> (in category 'private') -----<br>
> - initializeFromParagraph: aParagraph clippedBy: clippingRectangle<br>
> -<br>
> - text := aParagraph text.<br>
> - textStyle := aParagraph textStyle.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>initializeStringMeasurer (in category<br>
> 'initialize') -----<br>
> - initializeStringMeasurer<br>
> - stopConditions := Array new: 258.<br>
> - stopConditions at: CrossedX put: #crossedX.<br>
> - stopConditions at: EndOfRun put: #endOfRun.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>isBreakableAt:in:in: (in category<br>
> 'scanner methods') -----<br>
> - isBreakableAt: index in: sourceString in: encodingClass<br>
> -<br>
> - ^ encodingClass isBreakableAt: index in: sourceString.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>leadingTab (in category 'scanning')<br>
> -----<br>
> - leadingTab<br>
> - "return true if only tabs lie to the left"<br>
> - line first to: lastIndex do:<br>
> - [:i | (text at: i) == Tab ifFalse: [^ false]].<br>
> - ^ true!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>measureString:inFont:from:to: (in<br>
> category 'scanning') -----<br>
> - measureString: aString inFont: aFont from: startIndex to: stopIndex<br>
> - "WARNING: In order to use this method the receiver has to be set up using<br>
> #initializeStringMeasurer"<br>
> - destX := destY := lastIndex := 0.<br>
> - baselineY := aFont ascent.<br>
> - xTable := aFont xTable.<br>
> - font := aFont. " added Dec 03, 2004 "<br>
> - " map := aFont characterToGlyphMap."<br>
> - self scanCharactersFrom: startIndex to: stopIndex in: aString rightX:<br>
> 999999 stopConditions: stopConditions kern: 0.<br>
> - ^destX!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>placeEmbeddedObject: (in category<br>
> 'scanning') -----<br>
> - placeEmbeddedObject: anchoredMorph<br>
> - "Place the anchoredMorph or return false if it cannot be placed.<br>
> - In any event, advance destX by its width."<br>
> - | w |<br>
> - "Workaround: The following should really use #textAnchorType"<br>
> - anchoredMorph relativeTextAnchorPosition ifNotNil:[^true].<br>
> - destX := destX + (w := anchoredMorph width).<br>
> - (destX > rightMargin and: [(leftMargin + w) <= rightMargin])<br>
> - ifTrue: ["Won't fit, but would on next line"<br>
> - ^ false].<br>
> - lastIndex := lastIndex + 1.<br>
> - self setFont. "Force recalculation of emphasis for next run"<br>
> - ^ true!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>plainTab (in category 'scanning')<br>
> -----<br>
> - plainTab<br>
> - "This is the basic method of adjusting destX for a tab."<br>
> - destX := (alignment == Justified and: [self leadingTab not])<br>
> - ifTrue: "embedded tabs in justified text are weird"<br>
> - [destX + (textStyle tabWidth - (line justifiedTabDeltaFor: spaceCount))<br>
> max: destX]<br>
> - ifFalse:<br>
> - [textStyle nextTabXFrom: destX<br>
> - leftMargin: leftMargin<br>
> - rightMargin: rightMargin]!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>registerBreakableIndex (in category<br>
> 'multilingual scanning') -----<br>
> - registerBreakableIndex<br>
> -<br>
> - "Record left x and character index of the line-wrappable point.<br>
> - The default implementation here does nothing."<br>
> -<br>
> - ^ false.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>removeLastCharFromPresentation (in<br>
> category 'multilingual scanning') -----<br>
> - removeLastCharFromPresentation<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method:<br>
> MultiCharacterScanner>><wbr>scanCharactersFrom:to:in:<wbr>rightX:stopConditions:kern:<br>
> (in category 'scanning') -----<br>
> - scanCharactersFrom: startIndex to: stopIndex in: sourceString rightX:<br>
> rightX stopConditions: stops kern: kernDelta<br>
> -<br>
> - | startEncoding selector |<br>
> - (sourceString isByteString) ifTrue: [^ self basicScanCharactersFrom:<br>
> startIndex to: stopIndex in: sourceString rightX: rightX stopConditions:<br>
> stops kern: kernDelta.].<br>
> -<br>
> - (sourceString isWideString) ifTrue: [<br>
> - startIndex > stopIndex ifTrue: [lastIndex := stopIndex. ^ stops at:<br>
> EndOfRun].<br>
> - startEncoding := (sourceString at: startIndex) leadingChar.<br>
> - selector := EncodedCharSet scanSelectorAt: startEncoding.<br>
> - ^ self perform: selector withArguments: (Array with: startIndex with:<br>
> stopIndex with: sourceString with: rightX with: stopConditions with:<br>
> kernDelta).<br>
> - ].<br>
> -<br>
> - ^ stops at: EndOfRun<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method:<br>
> MultiCharacterScanner>><wbr>scanJapaneseCharactersFrom:to:<wbr>in:rightX:stopConditions:kern:<br>
> (in category 'scanner methods') -----<br>
> - scanJapaneseCharactersFrom: startIndex to: stopIndex in: sourceString<br>
> rightX: rightX stopConditions: stops kern: kernDelta<br>
> -<br>
> - | ascii encoding f nextDestX maxAscii startEncoding |<br>
> - lastIndex := startIndex.<br>
> - lastIndex > stopIndex ifTrue: [lastIndex := stopIndex. ^ stops at:<br>
> EndOfRun].<br>
> - startEncoding := (sourceString at: startIndex) leadingChar.<br>
> - font ifNil: [font := (TextConstants at: #DefaultMultiStyle) fontArray at:<br>
> 1].<br>
> - ((font isMemberOf: StrikeFontSet) or: [font isKindOf: TTCFontSet])<br>
> ifTrue: [<br>
> - [f := font fontArray at: startEncoding + 1]<br>
> - on: Exception do: [:ex | f := font fontArray at: 1].<br>
> - f ifNil: [ f := font fontArray at: 1].<br>
> - maxAscii := f maxAscii.<br>
> - "xTable := f xTable.<br>
> - maxAscii := xTable size - 2."<br>
> - spaceWidth := f widthOf: Space.<br>
> - ] ifFalse: [<br>
> - (font isMemberOf: HostFont) ifTrue: [<br>
> - f := font.<br>
> - maxAscii := f maxAscii.<br>
> - spaceWidth := f widthOf: Space.<br>
> - ] ifFalse: [<br>
> - maxAscii := font maxAscii.<br>
> - ].<br>
> - ].<br>
> - [lastIndex <= stopIndex] whileTrue: [<br>
> - "self halt."<br>
> - encoding := (sourceString at: lastIndex) leadingChar.<br>
> - encoding ~= startEncoding ifTrue: [lastIndex := lastIndex - 1. ^ stops<br>
> at: EndOfRun].<br>
> - ascii := (sourceString at: lastIndex) charCode.<br>
> - ascii > maxAscii ifTrue: [ascii := maxAscii].<br>
> - (encoding = 0 and: [(stopConditions at: ascii + 1) ~~ nil]) ifTrue: [^<br>
> stops at: ascii + 1].<br>
> - (self isBreakableAt: lastIndex in: sourceString in: (EncodedCharSet<br>
> charsetAt: encoding)) ifTrue: [<br>
> - self registerBreakableIndex.<br>
> - ].<br>
> - nextDestX := destX + (font widthOf: (sourceString at: lastIndex)).<br>
> - nextDestX > rightX ifTrue: [firstDestX ~= destX ifTrue: [^ stops at:<br>
> CrossedX]].<br>
> - destX := nextDestX + kernDelta.<br>
> - lastIndex := lastIndex + 1.<br>
> - ].<br>
> - lastIndex := stopIndex.<br>
> - ^ stops at: EndOfRun!<br>
><br>
> Item was removed:<br>
> - ----- Method:<br>
> MultiCharacterScanner>><wbr>scanMultiCharactersCombiningFr<wbr>om:to:in:rightX:<wbr>stopConditions:kern:<br>
> (in category 'scanner methods') -----<br>
> - scanMultiCharactersCombiningFr<wbr>om: startIndex to: stopIndex in:<br>
> sourceString rightX: rightX stopConditions: stops kern: kernDelta<br>
> -<br>
> - | charCode encoding f maxAscii startEncoding combining combined<br>
> combiningIndex c |<br>
> - lastIndex := startIndex.<br>
> - lastIndex > stopIndex ifTrue: [lastIndex := stopIndex. ^ stops at:<br>
> EndOfRun].<br>
> - startEncoding := (sourceString at: startIndex) leadingChar.<br>
> - font ifNil: [font := (TextConstants at: #DefaultMultiStyle) fontArray at:<br>
> 1].<br>
> - ((font isMemberOf: StrikeFontSet) or: [font isKindOf: TTCFontSet])<br>
> ifTrue: [<br>
> - [f := font fontArray at: startEncoding + 1]<br>
> - on: Exception do: [:ex | f := font fontArray at: 1].<br>
> - f ifNil: [ f := font fontArray at: 1].<br>
> - maxAscii := f maxAscii.<br>
> - spaceWidth := font widthOf: Space.<br>
> - ] ifFalse: [<br>
> - maxAscii := font maxAscii.<br>
> - spaceWidth := font widthOf: Space.<br>
> - ].<br>
> -<br>
> - combining := nil.<br>
> - [lastIndex <= stopIndex] whileTrue: [<br>
> - charCode := (sourceString at: lastIndex) charCode.<br>
> - c := (sourceString at: lastIndex).<br>
> - combining ifNil: [<br>
> - combining := CombinedChar new.<br>
> - combining add: c.<br>
> - combiningIndex := lastIndex.<br>
> - lastIndex := lastIndex + 1.<br>
> - ] ifNotNil: [<br>
> - (combining add: c) ifFalse: [<br>
> - self addCharToPresentation: (combined := combining combined).<br>
> - combining := CombinedChar new.<br>
> - combining add: c.<br>
> - charCode := combined charCode.<br>
> - encoding := combined leadingChar.<br>
> - encoding ~= startEncoding ifTrue: [lastIndex := lastIndex - 1.<br>
> - (encoding = 0 and: [(stopConditions at: charCode + 1) ~~ nil])<br>
> ifTrue: [<br>
> - ^ stops at: charCode + 1<br>
> - ] ifFalse: [<br>
> - ^ stops at: EndOfRun<br>
> - ].<br>
> - ].<br>
> - charCode > maxAscii ifTrue: [charCode := maxAscii].<br>
> - ""<br>
> - (encoding = 0 and: [(stopConditions at: charCode + 1) ~~ nil]) ifTrue:<br>
> [<br>
> - combining ifNotNil: [<br>
> - self addCharToPresentation: (combining combined).<br>
> - ].<br>
> - ^ stops at: charCode + 1<br>
> - ].<br>
> - (self isBreakableAt: lastIndex in: sourceString in: Latin1Environment)<br>
> ifTrue: [<br>
> - self registerBreakableIndex.<br>
> - ].<br>
> - destX > rightX ifTrue: [<br>
> - destX ~= firstDestX ifTrue: [<br>
> - lastIndex := combiningIndex.<br>
> - self removeLastCharFromPresentation<wbr>.<br>
> - ^ stops at: CrossedX]].<br>
> - combiningIndex := lastIndex.<br>
> - lastIndex := lastIndex + 1.<br>
> - ] ifTrue: [<br>
> - lastIndex := lastIndex + 1.<br>
> - numOfComposition := numOfComposition + 1.<br>
> - ].<br>
> - ].<br>
> - ].<br>
> - lastIndex := stopIndex.<br>
> - combining ifNotNil: [<br>
> - combined := combining combined.<br>
> - self addCharToPresentation: combined.<br>
> - "assuming that there is always enough space for at least one character".<br>
> - destX := destX + (self widthOf: combined inFont: font).<br>
> - ].<br>
> - ^ stops at: EndOfRun!<br>
><br>
> Item was removed:<br>
> - ----- Method:<br>
> MultiCharacterScanner>><wbr>scanMultiCharactersFrom:to:in:<wbr>rightX:stopConditions:kern:<br>
> (in category 'scanning') -----<br>
> - scanMultiCharactersFrom: startIndex to: stopIndex in: sourceString rightX:<br>
> rightX stopConditions: stops kern: kernDelta<br>
> -<br>
> - | ascii encoding f nextDestX maxAscii startEncoding |<br>
> - lastIndex := startIndex.<br>
> - lastIndex > stopIndex ifTrue: [lastIndex := stopIndex. ^ stops at:<br>
> EndOfRun].<br>
> - startEncoding := (sourceString at: startIndex) leadingChar.<br>
> - font ifNil: [font := (TextConstants at: #DefaultMultiStyle) fontArray at:<br>
> 1].<br>
> - ((font isMemberOf: StrikeFontSet) or: [font isKindOf: TTCFontSet])<br>
> ifTrue: [<br>
> - [f := font fontArray at: startEncoding + 1]<br>
> - on: Exception do: [:ex | f := font fontArray at: 1].<br>
> - f ifNil: [ f := font fontArray at: 1].<br>
> - maxAscii := f maxAscii.<br>
> - spaceWidth := f widthOf: Space.<br>
> - ] ifFalse: [<br>
> - maxAscii := font maxAscii.<br>
> - ].<br>
> -<br>
> - [lastIndex <= stopIndex] whileTrue: [<br>
> - encoding := (sourceString at: lastIndex) leadingChar.<br>
> - encoding ~= startEncoding ifTrue: [lastIndex := lastIndex - 1. ^ stops<br>
> at: EndOfRun].<br>
> - ascii := (sourceString at: lastIndex) charCode.<br>
> - ascii > maxAscii ifTrue: [ascii := maxAscii].<br>
> - (encoding = 0 and: [ascii < stopConditions size and: [(stopConditions<br>
> at: ascii + 1) ~~ nil]]) ifTrue: [^ stops at: ascii + 1].<br>
> - (self isBreakableAt: lastIndex in: sourceString in: Latin1Environment)<br>
> ifTrue: [<br>
> - self registerBreakableIndex.<br>
> - ].<br>
> - nextDestX := destX + (font widthOf: (sourceString at: lastIndex)).<br>
> - nextDestX > rightX ifTrue: [destX ~= firstDestX ifTrue: [^ stops at:<br>
> CrossedX]].<br>
> - destX := nextDestX + kernDelta.<br>
> - lastIndex := lastIndex + 1.<br>
> - ].<br>
> - lastIndex := stopIndex.<br>
> - ^ stops at: EndOfRun!<br>
><br>
> Item was removed:<br>
> - ----- Method:<br>
> MultiCharacterScanner>><wbr>scanMultiCharactersR2LFrom:to:<wbr>in:rightX:stopConditions:kern:<br>
> (in category 'scanner methods') -----<br>
> - scanMultiCharactersR2LFrom: startIndex to: stopIndex in: sourceString<br>
> rightX: rightX stopConditions: stops kern: kernDelta<br>
> -<br>
> - "Note that 'rightX' really means 'endX' in R2L context. Ie. rightX is<br>
> usually smaller than destX."<br>
> - | ascii encoding f nextDestX maxAscii startEncoding |<br>
> - lastIndex := startIndex.<br>
> - lastIndex > stopIndex ifTrue: [lastIndex := stopIndex. ^ stops at:<br>
> EndOfRun].<br>
> - startEncoding := (sourceString at: startIndex) leadingChar.<br>
> - font ifNil: [font := (TextConstants at: #DefaultMultiStyle) fontArray at:<br>
> 1].<br>
> - ((font isMemberOf: StrikeFontSet) or: [font isKindOf: TTCFontSet])<br>
> ifTrue: [<br>
> - [f := font fontArray at: startEncoding + 1]<br>
> - on: Exception do: [:ex | f := font fontArray at: 1].<br>
> - f ifNil: [ f := font fontArray at: 1].<br>
> - maxAscii := f maxAscii.<br>
> - spaceWidth := f widthOf: Space.<br>
> - ] ifFalse: [<br>
> - maxAscii := font maxAscii.<br>
> - ].<br>
> -<br>
> - [lastIndex <= stopIndex] whileTrue: [<br>
> - encoding := (sourceString at: lastIndex) leadingChar.<br>
> - encoding ~= startEncoding ifTrue: [lastIndex := lastIndex - 1. ^ stops<br>
> at: EndOfRun].<br>
> - ascii := (sourceString at: lastIndex) charCode.<br>
> - ascii > maxAscii ifTrue: [ascii := maxAscii].<br>
> - (encoding = 0 and: [(stopConditions at: ascii + 1) ~~ nil]) ifTrue: [^<br>
> stops at: ascii + 1].<br>
> - (self isBreakableAt: lastIndex in: sourceString in: Latin1Environment)<br>
> ifTrue: [<br>
> - self registerBreakableIndex.<br>
> - ].<br>
> - nextDestX := destX - (font widthOf: (sourceString at: lastIndex)).<br>
> - nextDestX < rightX ifTrue: [^ stops at: CrossedX].<br>
> - destX := nextDestX - kernDelta.<br>
> - lastIndex := lastIndex + 1.<br>
> - ].<br>
> - lastIndex := stopIndex.<br>
> - ^ stops at: EndOfRun!<br>
><br>
> Item was removed:<br>
> - ----- Method:<br>
> MultiCharacterScanner>><wbr>scanSimChineseCharactersFrom:<wbr>to:in:rightX:stopConditions:<wbr>kern:<br>
> (in category 'scanner methods') -----<br>
> - scanSimChineseCharactersFrom: startIndex to: stopIndex in: sourceString<br>
> rightX: rightX stopConditions: stops kern: kernDelta<br>
> -<br>
> - | ascii encoding f nextDestX maxAscii startEncoding |<br>
> - lastIndex := startIndex.<br>
> - lastIndex > stopIndex ifTrue: [lastIndex := stopIndex. ^ stops at:<br>
> EndOfRun].<br>
> - startEncoding := (sourceString at: startIndex) leadingChar.<br>
> - font ifNil: [font := (TextConstants at: #DefaultMultiStyle) fontArray at:<br>
> 1].<br>
> - ((font isMemberOf: StrikeFontSet) or: [font isKindOf: TTCFontSet])<br>
> ifTrue: [<br>
> - [f := font fontArray at: startEncoding + 1]<br>
> - on: Exception do: [:ex | f := font fontArray at: 1].<br>
> - f ifNil: [ f := font fontArray at: 1].<br>
> - maxAscii := f maxAscii.<br>
> - "xTable := f xTable.<br>
> - maxAscii := xTable size - 2."<br>
> - spaceWidth := f widthOf: Space.<br>
> - ] ifFalse: [<br>
> - (font isMemberOf: HostFont) ifTrue: [<br>
> - f := font.<br>
> - maxAscii := f maxAscii.<br>
> - spaceWidth := f widthOf: Space.<br>
> - ] ifFalse: [<br>
> - maxAscii := font maxAscii.<br>
> - ].<br>
> - ].<br>
> - [lastIndex <= stopIndex] whileTrue: [<br>
> - "self halt."<br>
> - encoding := (sourceString at: lastIndex) leadingChar.<br>
> - encoding ~= startEncoding ifTrue: [lastIndex := lastIndex - 1. ^ stops<br>
> at: EndOfRun].<br>
> - ascii := (sourceString at: lastIndex) charCode.<br>
> - ascii > maxAscii ifTrue: [ascii := maxAscii].<br>
> - (encoding = 0 and: [(stopConditions at: ascii + 1) ~~ nil]) ifTrue: [^<br>
> stops at: ascii + 1].<br>
> - (self isBreakableAt: lastIndex in: sourceString in: (EncodedCharSet<br>
> charsetAt: encoding)) ifTrue: [<br>
> - self registerBreakableIndex.<br>
> - ].<br>
> - nextDestX := destX + (font widthOf: (sourceString at: lastIndex)).<br>
> - nextDestX > rightX ifTrue: [firstDestX ~= destX ifTrue: [^ stops at:<br>
> CrossedX]].<br>
> - destX := nextDestX + kernDelta.<br>
> - lastIndex := lastIndex + 1.<br>
> - ].<br>
> - lastIndex := stopIndex.<br>
> - ^ stops at: EndOfRun!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>setActualFont: (in category<br>
> 'private') -----<br>
> - setActualFont: aFont<br>
> - "Set the basal font to an isolated font reference."<br>
> -<br>
> - font := aFont!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>setAlignment: (in category 'private')<br>
> -----<br>
> - setAlignment: style<br>
> - alignment := style.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>setConditionArray: (in category<br>
> 'private') -----<br>
> - setConditionArray: aSymbol<br>
> -<br>
> - aSymbol == #paddedSpace ifTrue: [^stopConditions := PaddedSpaceCondition<br>
> "copy"].<br>
> - "aSymbol == #space ifTrue: [^stopConditions := SpaceCondition copy]."<br>
> - aSymbol == nil ifTrue: [^stopConditions := NilCondition "copy"].<br>
> - self error: 'undefined stopcondition for space character'.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>>setFont (in category 'private') -----<br>
> - setFont<br>
> - | priorFont |<br>
> - "Set the font and other emphasis."<br>
> - priorFont := font.<br>
> - text == nil ifFalse:[<br>
> - emphasisCode := 0.<br>
> - kern := 0.<br>
> - indentationLevel := 0.<br>
> - alignment := textStyle alignment.<br>
> - font := nil.<br>
> - (text attributesAt: lastIndex forStyle: textStyle)<br>
> - do: [:att | att emphasizeScanner: self]].<br>
> - font == nil ifTrue:<br>
> - [self setFont: textStyle defaultFontIndex].<br>
> - font := font emphasized: emphasisCode.<br>
> - priorFont ifNotNil: [destX := destX + priorFont descentKern].<br>
> - destX := destX - font descentKern.<br>
> - "NOTE: next statement should be removed when clipping works"<br>
> - leftMargin ifNotNil: [destX := destX max: leftMargin].<br>
> - kern := kern - font baseKern.<br>
> -<br>
> - "Install various parameters from the font."<br>
> - spaceWidth := font widthOf: Space.<br>
> - xTable := font xTable.<br>
> - " map := font characterToGlyphMap."<br>
> - stopConditions := DefaultStopConditions.!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>setFont: (in category 'private')<br>
> -----<br>
> - setFont: fontNumber<br>
> - "Set the font by number from the textStyle."<br>
> -<br>
> - self setActualFont: (textStyle fontAt: fontNumber)!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>>text:<wbr>textStyle: (in category<br>
> 'private') -----<br>
> - text: t textStyle: ts<br>
> - text := t.<br>
> - textStyle := ts!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>textColor: (in category 'private')<br>
> -----<br>
> - textColor: ignored<br>
> - "Overridden in DisplayScanner"!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>wantsColumnBreaks: (in category<br>
> 'initialize') -----<br>
> - wantsColumnBreaks: aBoolean<br>
> -<br>
> - wantsColumnBreaks := aBoolean!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCharacterScanner>><wbr>widthOf:inFont: (in category<br>
> 'multilingual scanning') -----<br>
> - widthOf: char inFont: aFont<br>
> -<br>
> - (char isMemberOf: CombinedChar) ifTrue: [<br>
> - ^ aFont widthOf: char base.<br>
> - ] ifFalse: [<br>
> - ^ aFont widthOf: char.<br>
> - ].<br>
> -<br>
> -<br>
> - !<br>
><br>
> Item was removed:<br>
> - MultiCharacterScanner subclass: #MultiCompositionScanner<br>
> - instanceVariableNames: 'spaceX lineHeight baseline breakableIndex<br>
> lineHeightAtBreak baselineAtBreak breakAtSpace lastWidth'<br>
> - classVariableNames: ''<br>
> - poolDictionaries: ''<br>
> - category: 'Etoys-Squeakland-<wbr>Multilingual-Scanning'!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCompositionScanner>><wbr>addCharToPresentation: (in category<br>
> 'multilingual scanning') -----<br>
> - addCharToPresentation: char<br>
> -<br>
> - presentation nextPut: char.<br>
> - lastWidth := self widthOf: char inFont: font.<br>
> - destX := destX + lastWidth.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCompositionScanner>><wbr>columnBreak (in category 'stop<br>
> conditions') -----<br>
> - columnBreak<br>
> -<br>
> - "Answer true. Set up values for the text line interval currently being<br>
> - composed."<br>
> -<br>
> - line stop: lastIndex.<br>
> - presentationLine stop: lastIndex - numOfComposition.<br>
> - spaceX := destX.<br>
> - line paddingWidth: rightMargin - spaceX.<br>
> - presentationLine paddingWidth: rightMargin - spaceX.<br>
> - ^true!<br>
><br>
> Item was removed:<br>
> - ----- Method:<br>
> MultiCompositionScanner>><wbr>composeFrom:inRectangle:<wbr>firstLine:leftSide:rightSide:<br>
> (in category 'scanning') -----<br>
> - composeFrom: startIndex inRectangle: lineRectangle<br>
> - firstLine: firstLine leftSide: leftSide rightSide: rightSide<br>
> - "Answer an instance of TextLineInterval that represents the next line in<br>
> the paragraph."<br>
> - | runLength done stopCondition |<br>
> - "Set up margins"<br>
> - leftMargin := lineRectangle left.<br>
> - leftSide ifTrue: [leftMargin := leftMargin +<br>
> - (firstLine ifTrue: [textStyle firstIndent]<br>
> - ifFalse: [textStyle restIndent])].<br>
> - destX := spaceX := leftMargin.<br>
> - firstDestX := destX.<br>
> - rightMargin := lineRectangle right.<br>
> - rightSide ifTrue: [rightMargin := rightMargin - textStyle rightIndent].<br>
> - lastIndex := startIndex. "scanning sets last index"<br>
> - destY := lineRectangle top.<br>
> - lineHeight := baseline := 0. "Will be increased by setFont"<br>
> - self setStopConditions. "also sets font"<br>
> - runLength := text runLengthFor: startIndex.<br>
> - runStopIndex := (lastIndex := startIndex) + (runLength - 1).<br>
> - line := (TextLine start: lastIndex stop: 0 internalSpaces: 0<br>
> paddingWidth: 0)<br>
> - rectangle: lineRectangle.<br>
> - presentationLine := (TextLine start: lastIndex stop: 0 internalSpaces: 0<br>
> paddingWidth: 0)<br>
> - rectangle: lineRectangle.<br>
> - numOfComposition := 0.<br>
> - spaceCount := 0.<br>
> - self handleIndentation.<br>
> - leftMargin := destX.<br>
> - line leftMargin: leftMargin.<br>
> - presentationLine leftMargin: leftMargin.<br>
> -<br>
> - presentation := TextStream on: (Text fromString: (WideString new: text<br>
> size)).<br>
> -<br>
> - done := false.<br>
> - [done]<br>
> - whileFalse:<br>
> - [stopCondition := self scanCharactersFrom: lastIndex to: runStopIndex<br>
> - in: text string rightX: rightMargin stopConditions: stopConditions<br>
> - kern: kern.<br>
> - "See setStopConditions for stopping conditions for composing."<br>
> - (self perform: stopCondition)<br>
> - ifTrue: [presentationLine lineHeight: lineHeight + textStyle leading<br>
> - baseline: baseline + textStyle leading.<br>
> - ^ line lineHeight: lineHeight + textStyle leading<br>
> - baseline: baseline + textStyle leading]]!<br>
><br>
> Item was removed:<br>
> - ----- Method:<br>
> MultiCompositionScanner>><wbr>composeLine:<wbr>fromCharacterIndex:<wbr>inParagraph: (in<br>
> category 'scanning') -----<br>
> - composeLine: lineIndex fromCharacterIndex: startIndex inParagraph:<br>
> aParagraph<br>
> - "Answer an instance of TextLineInterval that represents the next line in<br>
> the paragraph."<br>
> - | runLength done stopCondition |<br>
> - destX := spaceX := leftMargin := aParagraph<br>
> leftMarginForCompositionForLin<wbr>e: lineIndex.<br>
> - destY := 0.<br>
> - rightMargin := aParagraph rightMarginForComposition.<br>
> - leftMargin >= rightMargin ifTrue: [self error: 'No room between margins<br>
> to compose'].<br>
> - lastIndex := startIndex. "scanning sets last index"<br>
> - lineHeight := textStyle lineGrid. "may be increased by setFont:..."<br>
> - baseline := textStyle baseline.<br>
> - baselineY := destY + baseline.<br>
> - self setStopConditions. "also sets font"<br>
> - self handleIndentation.<br>
> - runLength := text runLengthFor: startIndex.<br>
> - runStopIndex := (lastIndex := startIndex) + (runLength - 1).<br>
> - line := TextLineInterval<br>
> - start: lastIndex<br>
> - stop: 0<br>
> - internalSpaces: 0<br>
> - paddingWidth: 0.<br>
> - presentationLine := TextLineInterval<br>
> - start: lastIndex<br>
> - stop: 0<br>
> - internalSpaces: 0<br>
> - paddingWidth: 0.<br>
> - numOfComposition := 0.<br>
> - presentation := TextStream on: (Text fromString: (WideString new: text<br>
> size)).<br>
> - spaceCount := 0.<br>
> - done := false.<br>
> - [done]<br>
> - whileFalse:<br>
> - [stopCondition := self scanCharactersFrom: lastIndex to: runStopIndex<br>
> - in: text string rightX: rightMargin stopConditions: stopConditions<br>
> - kern: kern.<br>
> - "See setStopConditions for stopping conditions for composing."<br>
> - (self perform: stopCondition)<br>
> - ifTrue: [presentationLine lineHeight: lineHeight + textStyle leading<br>
> - baseline: baseline + textStyle leading.<br>
> - ^line lineHeight: lineHeight + textStyle leading<br>
> - baseline: baseline + textStyle leading]]!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCompositionScanner>>cr (in category 'stop conditions')<br>
> -----<br>
> - cr<br>
> - "Answer true. Set up values for the text line interval currently being<br>
> - composed."<br>
> -<br>
> - line stop: lastIndex.<br>
> - presentationLine stop: lastIndex - numOfComposition.<br>
> - spaceX := destX.<br>
> - line paddingWidth: rightMargin - spaceX.<br>
> - presentationLine paddingWidth: rightMargin - spaceX.<br>
> - ^true!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCompositionScanner>><wbr>crossedX (in category 'stop<br>
> conditions') -----<br>
> - crossedX<br>
> - "There is a word that has fallen across the right edge of the composition<br>
> - rectangle. This signals the need for wrapping which is done to the last<br>
> - space that was encountered, as recorded by the space stop condition."<br>
> -<br>
> - (breakAtSpace) ifTrue: [<br>
> - spaceCount >= 1 ifTrue:<br>
> - ["The common case. First back off to the space at which we wrap."<br>
> - line stop: breakableIndex.<br>
> - presentationLine stop: breakableIndex - numOfComposition.<br>
> - lineHeight := lineHeightAtBreak.<br>
> - baseline := baselineAtBreak.<br>
> - spaceCount := spaceCount - 1.<br>
> - breakableIndex := breakableIndex - 1.<br>
> -<br>
> - "Check to see if any spaces preceding the one at which we wrap.<br>
> - Double space after punctuation, most likely."<br>
> - [(spaceCount > 1 and: [(text at: breakableIndex) = Space])]<br>
> - whileTrue:<br>
> - [spaceCount := spaceCount - 1.<br>
> - "Account for backing over a run which might<br>
> - change width of space."<br>
> - font := text fontAt: breakableIndex withStyle: textStyle.<br>
> - breakableIndex := breakableIndex - 1.<br>
> - spaceX := spaceX - (font widthOf: Space)].<br>
> - line paddingWidth: rightMargin - spaceX.<br>
> - presentationLine paddingWidth: rightMargin - spaceX.<br>
> - presentationLine internalSpaces: spaceCount.<br>
> - line internalSpaces: spaceCount]<br>
> - ifFalse:<br>
> - ["Neither internal nor trailing spaces -- almost never happens."<br>
> - lastIndex := lastIndex - 1.<br>
> - [destX <= rightMargin]<br>
> - whileFalse:<br>
> - [destX := destX - (font widthOf: (text at: lastIndex)).<br>
> - lastIndex := lastIndex - 1].<br>
> - spaceX := destX.<br>
> - line paddingWidth: rightMargin - destX.<br>
> - presentationLine paddingWidth: rightMargin - destX.<br>
> - presentationLine stop: (lastIndex max: line first).<br>
> - line stop: (lastIndex max: line first)].<br>
> - ^true<br>
> - ].<br>
> -<br>
> - (breakableIndex isNil or: [breakableIndex < line first]) ifTrue: [<br>
> - "Any breakable point in this line. Just wrap last character."<br>
> - breakableIndex := lastIndex - 1.<br>
> - lineHeightAtBreak := lineHeight.<br>
> - baselineAtBreak := baseline.<br>
> - ].<br>
> -<br>
> - "It wasn't a space, but anyway this is where we break the line."<br>
> - line stop: breakableIndex.<br>
> - presentationLine stop: breakableIndex.<br>
> - lineHeight := lineHeightAtBreak.<br>
> - baseline := baselineAtBreak.<br>
> - ^ true.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCompositionScanner>><wbr>endOfRun (in category 'stop<br>
> conditions') -----<br>
> - endOfRun<br>
> - "Answer true if scanning has reached the end of the paragraph.<br>
> - Otherwise step conditions (mostly install potential new font) and answer<br>
> - false."<br>
> -<br>
> - | runLength |<br>
> - lastIndex = text size<br>
> - ifTrue: [line stop: lastIndex.<br>
> - presentationLine stop: lastIndex - numOfComposition.<br>
> - spaceX := destX.<br>
> - line paddingWidth: rightMargin - destX.<br>
> - presentationLine paddingWidth: rightMargin - destX.<br>
> - ^true]<br>
> - ifFalse: [<br>
> - "(text at: lastIndex) charCode = 32 ifTrue: [destX := destX +<br>
> spaceWidth]."<br>
> - runLength := (text runLengthFor: (lastIndex := lastIndex + 1)).<br>
> - runStopIndex := lastIndex + (runLength - 1).<br>
> - self setStopConditions.<br>
> - ^false]<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCompositionScanner>><wbr>forParagraph: (in category<br>
> 'intialize-release') -----<br>
> - forParagraph: aParagraph<br>
> - "Initialize the receiver for scanning the given paragraph."<br>
> -<br>
> - self<br>
> - initializeFromParagraph: aParagraph<br>
> - clippedBy: aParagraph clippingRectangle.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCompositionScanner>><wbr>getPresentation (in category<br>
> 'multilingual scanning') -----<br>
> - getPresentation<br>
> -<br>
> - ^ presentation contents.<br>
> -<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCompositionScanner>><wbr>getPresentationLine (in category<br>
> 'multilingual scanning') -----<br>
> - getPresentationLine<br>
> -<br>
> - ^ presentationLine.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCompositionScanner>><wbr>isBreakableAt:in:in: (in category<br>
> 'multilingual scanning') -----<br>
> - isBreakableAt: index in: sourceString in: encodingClass<br>
> -<br>
> - ^ encodingClass isBreakableAt: index in: sourceString.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCompositionScanner>><wbr>placeEmbeddedObject: (in category<br>
> 'stop conditions') -----<br>
> - placeEmbeddedObject: anchoredMorph<br>
> - | descent |<br>
> - "Workaround: The following should really use #textAnchorType"<br>
> - anchoredMorph relativeTextAnchorPosition ifNotNil:[^true].<br>
> - (super placeEmbeddedObject: anchoredMorph) ifFalse: ["It doesn't fit"<br>
> - "But if it's the first character then leave it here"<br>
> - lastIndex < line first ifFalse:[<br>
> - line stop: lastIndex-1.<br>
> - ^ false]].<br>
> - descent := lineHeight - baseline.<br>
> - lineHeight := lineHeight max: anchoredMorph height.<br>
> - baseline := lineHeight - descent.<br>
> - line stop: lastIndex.<br>
> - presentationLine stop: lastIndex - numOfComposition.<br>
> - ^ true!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCompositionScanner>><wbr>presentation (in category<br>
> 'accessing') -----<br>
> - presentation<br>
> -<br>
> - ^ presentation.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCompositionScanner>><wbr>presentationLine (in category<br>
> 'accessing') -----<br>
> - presentationLine<br>
> -<br>
> - ^ presentationLine.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCompositionScanner>><wbr>registerBreakableIndex (in category<br>
> 'multilingual scanning') -----<br>
> - registerBreakableIndex<br>
> -<br>
> - "Record left x and character index of the line-wrappable point.<br>
> - Used for wrap-around. Answer whether the character has crossed the<br>
> - right edge of the composition rectangle of the paragraph."<br>
> -<br>
> - (text at: lastIndex) = Character space ifTrue: [<br>
> - breakAtSpace := true.<br>
> - spaceX := destX.<br>
> - spaceCount := spaceCount + 1.<br>
> - lineHeightAtBreak := lineHeight.<br>
> - baselineAtBreak := baseline.<br>
> - breakableIndex := lastIndex.<br>
> - destX > rightMargin ifTrue: [^self crossedX].<br>
> - ] ifFalse: [<br>
> - breakAtSpace := false.<br>
> - lineHeightAtBreak := lineHeight.<br>
> - baselineAtBreak := baseline.<br>
> - breakableIndex := lastIndex - 1.<br>
> - ].<br>
> - ^ false.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCompositionScanner>><wbr>removeLastCharFromPresentation (in<br>
> category 'multilingual scanning') -----<br>
> - removeLastCharFromPresentation<br>
> -<br>
> - presentation ifNotNil: [<br>
> - presentation position: presentation position - 1.<br>
> - ].<br>
> - destX := destX - lastWidth.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCompositionScanner>><wbr>rightX (in category 'accessing')<br>
> -----<br>
> - rightX<br>
> - "Meaningful only when a line has just been composed -- refers to the<br>
> - line most recently composed. This is a subtrefuge to allow for easy<br>
> - resizing of a composition rectangle to the width of the maximum line.<br>
> - Useful only when there is only one line in the form or when each line<br>
> - is terminated by a carriage return. Handy for sizing menus and lists."<br>
> -<br>
> - breakAtSpace ifTrue: [^ spaceX].<br>
> -<br>
> - ^ destX.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCompositionScanner>><wbr>setActualFont: (in category<br>
> 'scanning') -----<br>
> - setActualFont: aFont<br>
> - "Keep track of max height and ascent for auto lineheight"<br>
> - | descent |<br>
> - super setActualFont: aFont.<br>
> - "' ', lastIndex printString, ' ' displayAt: (lastIndex * 15)@0."<br>
> - lineHeight == nil<br>
> - ifTrue: [descent := font descent.<br>
> - baseline := font ascent.<br>
> - lineHeight := baseline + descent]<br>
> - ifFalse: [descent := lineHeight - baseline max: font descent.<br>
> - baseline := baseline max: font ascent.<br>
> - lineHeight := lineHeight max: baseline + descent]!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCompositionScanner>><wbr>setFont (in category 'stop<br>
> conditions') -----<br>
> - setFont<br>
> - super setFont.<br>
> - breakAtSpace := false.<br>
> - wantsColumnBreaks == true ifTrue: [<br>
> - stopConditions := stopConditions copy.<br>
> - stopConditions at: TextComposer characterForColumnBreak asciiValue + 1<br>
> put: #columnBreak.<br>
> - ].<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCompositionScanner>><wbr>setStopConditions (in category<br>
> 'stop conditions') -----<br>
> - setStopConditions<br>
> - "Set the font and the stop conditions for the current run."<br>
> -<br>
> - self setFont!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiCompositionScanner>>tab (in category 'stop conditions')<br>
> -----<br>
> - tab<br>
> - "Advance destination x according to tab settings in the paragraph's<br>
> - textStyle. Answer whether the character has crossed the right edge of<br>
> - the composition rectangle of the paragraph."<br>
> -<br>
> - destX := textStyle<br>
> - nextTabXFrom: destX leftMargin: leftMargin rightMargin: rightMargin.<br>
> - destX > rightMargin ifTrue: [^self crossedX].<br>
> - lastIndex := lastIndex + 1.<br>
> - ^false<br>
> - !<br>
><br>
> Item was removed:<br>
> - MultiCharacterScanner subclass: #MultiDisplayScanner<br>
> - instanceVariableNames: 'bitBlt lineY runX foregroundColor backgroundColor<br>
> fillBlt lineHeight paragraph paragraphColor morphicOffset<br>
> ignoreColorChanges'<br>
> - classVariableNames: ''<br>
> - poolDictionaries: ''<br>
> - category: 'Etoys-Squeakland-<wbr>Multilingual-Scanning'!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiDisplayScanner class>>defaultFont (in category<br>
> 'queries') -----<br>
> - defaultFont<br>
> - ^ TextStyle defaultFont!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiDisplayScanner>>cr (in category 'stop conditions')<br>
> -----<br>
> - cr<br>
> - "When a carriage return is encountered, simply increment the pointer<br>
> - into the paragraph."<br>
> -<br>
> - lastIndex := lastIndex + 1.<br>
> - ^false!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiDisplayScanner>>crossedX (in category 'stop<br>
> conditions') -----<br>
> - crossedX<br>
> - "This condition will sometimes be reached 'legally' during display, when,<br>
> - for instance the space that caused the line to wrap actually extends over<br>
> - the right boundary. This character is allowed to display, even though it<br>
> - is technically outside or straddling the clipping ectangle since it is in<br>
> - the normal case not visible and is in any case appropriately clipped by<br>
> - the scanner."<br>
> -<br>
> - ^ true !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiDisplayScanner>><wbr>displayLine:offset:leftInRun: (in<br>
> category 'scanning') -----<br>
> - displayLine: textLine offset: offset leftInRun: leftInRun<br>
> - "The call on the primitive (scanCharactersFrom:to:in:<wbr>rightX:) will be<br>
> interrupted according to an array of stop conditions passed to the scanner<br>
> at which time the code to handle the stop condition is run and the call on<br>
> the primitive continued until a stop condition returns true (which means the<br>
> line has terminated). leftInRun is the # of characters left to scan in the<br>
> current run; when 0, it is time to call setStopConditions."<br>
> - | done stopCondition nowLeftInRun startIndex string lastPos |<br>
> - line := textLine.<br>
> - morphicOffset := offset.<br>
> - lineY := line top + offset y.<br>
> - lineHeight := line lineHeight.<br>
> - rightMargin := line rightMargin + offset x.<br>
> - lastIndex := line first.<br>
> - leftInRun <= 0 ifTrue: [self setStopConditions].<br>
> - leftMargin := (line leftMarginForAlignment: alignment) + offset x.<br>
> - destX := runX := leftMargin.<br>
> - fillBlt == nil ifFalse:<br>
> - ["Not right"<br>
> - fillBlt destX: line left destY: lineY<br>
> - width: line width left height: lineHeight; copyBits].<br>
> - lastIndex := line first.<br>
> - leftInRun <= 0<br>
> - ifTrue: [nowLeftInRun := text runLengthFor: lastIndex]<br>
> - ifFalse: [nowLeftInRun := leftInRun].<br>
> - baselineY := lineY + line baseline.<br>
> - destY := baselineY - font ascent.<br>
> - runStopIndex := lastIndex + (nowLeftInRun - 1) min: line last.<br>
> - spaceCount := 0.<br>
> - done := false.<br>
> - string := text string.<br>
> - [done] whileFalse:[<br>
> - startIndex := lastIndex.<br>
> - lastPos := destX@destY.<br>
> - stopCondition := self scanCharactersFrom: lastIndex to: runStopIndex<br>
> - in: string rightX: rightMargin stopConditions: stopConditions<br>
> - kern: kern.<br>
> - lastIndex >= startIndex ifTrue:[<br>
> - font displayString: string on: bitBlt<br>
> - from: startIndex<br>
> - "XXXX: The following is an interesting bug. All stopConditions exept<br>
> #endOfRun<br>
> - have lastIndex past the last character displayed. #endOfRun sets it *on*<br>
> the character.<br>
> - If we display up until lastIndex then we will also display invisible<br>
> characters like<br>
> - CR and tab. This problem should be fixed in the scanner (i.e., position<br>
> lastIndex<br>
> - consistently) but I don't want to deal with the fallout right now so we<br>
> keep the<br>
> - fix minimally invasive."<br>
> - to: (stopCondition == #endOfRun ifTrue:[lastIndex]<br>
> ifFalse:[lastIndex-1])<br>
> - at: lastPos kern: kern baselineY: baselineY].<br>
> - "see setStopConditions for stopping conditions for displaying."<br>
> - done := self perform: stopCondition.<br>
> - "lastIndex > runStopIndex ifTrue: [done := true]."<br>
> - ].<br>
> - ^ runStopIndex - lastIndex "Number of characters remaining in the<br>
> current run"!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiDisplayScanner>><wbr>displayLines:in:clippedBy: (in category<br>
> 'MVC-compatibility') -----<br>
> - displayLines: linesInterval in: aParagraph clippedBy: visibleRectangle<br>
> - "The central display routine. The call on the primitive<br>
> - (scanCharactersFrom:to:in:<wbr>rightX:) will be interrupted according to an<br>
> - array of stop conditions passed to the scanner at which time the code to<br>
> - handle the stop condition is run and the call on the primitive continued<br>
> - until a stop condition returns true (which means the line has<br>
> - terminated)."<br>
> - | runLength done stopCondition leftInRun startIndex string lastPos |<br>
> - "leftInRun is the # of characters left to scan in the current run;<br>
> - when 0, it is time to call 'self setStopConditions'"<br>
> - morphicOffset := 0@0.<br>
> - leftInRun := 0.<br>
> - self initializeFromParagraph: aParagraph clippedBy: visibleRectangle.<br>
> - ignoreColorChanges := false.<br>
> - paragraph := aParagraph.<br>
> - foregroundColor := paragraphColor := aParagraph foregroundColor.<br>
> - backgroundColor := aParagraph backgroundColor.<br>
> - aParagraph backgroundColor isTransparent<br>
> - ifTrue: [fillBlt := nil]<br>
> - ifFalse: [fillBlt := bitBlt copy. "Blt to fill spaces, tabs, margins"<br>
> - fillBlt sourceForm: nil; sourceOrigin: 0@0.<br>
> - fillBlt fillColor: aParagraph backgroundColor].<br>
> - rightMargin := aParagraph rightMarginForDisplay.<br>
> - lineY := aParagraph topAtLineIndex: linesInterval first.<br>
> - bitBlt destForm deferUpdatesIn: visibleRectangle while: [<br>
> - linesInterval do:<br>
> - [:lineIndex |<br>
> - leftMargin := aParagraph leftMarginForDisplayForLine: lineIndex<br>
> alignment: (alignment ifNil:[textStyle alignment]).<br>
> - destX := (runX := leftMargin).<br>
> - line := aParagraph lines at: lineIndex.<br>
> - lineHeight := line lineHeight.<br>
> - fillBlt == nil ifFalse:<br>
> - [fillBlt destX: visibleRectangle left destY: lineY<br>
> - width: visibleRectangle width height: lineHeight; copyBits].<br>
> - lastIndex := line first.<br>
> - leftInRun <= 0<br>
> - ifTrue: [self setStopConditions. "also sets the font"<br>
> - leftInRun := text runLengthFor: line first].<br>
> - baselineY := lineY + line baseline.<br>
> - destY := baselineY - font ascent. "Should have happened in setFont"<br>
> - runLength := leftInRun.<br>
> - runStopIndex := lastIndex + (runLength - 1) min: line last.<br>
> - leftInRun := leftInRun - (runStopIndex - lastIndex + 1).<br>
> - spaceCount := 0.<br>
> - done := false.<br>
> - string := text string.<br>
> - self handleIndentation.<br>
> - [done] whileFalse:[<br>
> - startIndex := lastIndex.<br>
> - lastPos := destX@destY.<br>
> - stopCondition := self scanCharactersFrom: lastIndex to: runStopIndex<br>
> - in: string rightX: rightMargin stopConditions: stopConditions<br>
> - kern: kern.<br>
> - lastIndex >= startIndex ifTrue:[<br>
> - font displayString: string on: bitBlt<br>
> - from: startIndex to: lastIndex at: lastPos kern: kern baselineY:<br>
> baselineY].<br>
> - "see setStopConditions for stopping conditions for displaying."<br>
> - done := self perform: stopCondition].<br>
> - fillBlt == nil ifFalse:<br>
> - [fillBlt destX: destX destY: lineY width: visibleRectangle right-destX<br>
> height: lineHeight; copyBits].<br>
> - lineY := lineY + lineHeight]]!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiDisplayScanner>>endOfRun (in category 'stop<br>
> conditions') -----<br>
> - endOfRun<br>
> - "The end of a run in the display case either means that there is actually<br>
> - a change in the style (run code) to be associated with the string or the<br>
> - end of this line has been reached."<br>
> - | runLength |<br>
> - lastIndex = line last ifTrue: [^true].<br>
> - runX := destX.<br>
> - runLength := text runLengthFor: (lastIndex := lastIndex + 1).<br>
> - runStopIndex := lastIndex + (runLength - 1) min: line last.<br>
> - self setStopConditions.<br>
> - ^ false!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiDisplayScanner>><wbr>initializeFromParagraph:<wbr>clippedBy: (in<br>
> category 'MVC-compatibility') -----<br>
> - initializeFromParagraph: aParagraph clippedBy: clippingRectangle<br>
> -<br>
> - super initializeFromParagraph: aParagraph clippedBy: clippingRectangle.<br>
> - bitBlt := BitBlt asGrafPort toForm: aParagraph destinationForm.<br>
> - bitBlt sourceX: 0; width: 0. "Init BitBlt so that the first call to a<br>
> primitive will not fail"<br>
> - bitBlt combinationRule: Form paint.<br>
> - bitBlt colorMap:<br>
> - (Bitmap with: 0 "Assumes 1-bit deep fonts"<br>
> - with: (bitBlt destForm pixelValueFor: aParagraph foregroundColor)).<br>
> - bitBlt clipRect: clippingRectangle.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiDisplayScanner>><wbr>isBreakableAt:in:in: (in category<br>
> 'multilingual scanning') -----<br>
> - isBreakableAt: index in: sourceString in: encodingClass<br>
> -<br>
> - ^ false.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiDisplayScanner>><wbr>paddedSpace (in category 'stop<br>
> conditions') -----<br>
> - paddedSpace<br>
> - "Each space is a stop condition when the alignment is right justified.<br>
> - Padding must be added to the base width of the space according to<br>
> - which space in the line this space is and according to the amount of<br>
> - space that remained at the end of the line when it was composed."<br>
> -<br>
> - spaceCount := spaceCount + 1.<br>
> - destX := destX + spaceWidth + (line justifiedPadFor: spaceCount).<br>
> - lastIndex := lastIndex + 1.<br>
> - ^ false!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiDisplayScanner>><wbr>placeEmbeddedObject: (in category<br>
> 'scanning') -----<br>
> - placeEmbeddedObject: anchoredMorph<br>
> - anchoredMorph relativeTextAnchorPosition ifNotNil:[<br>
> - anchoredMorph position:<br>
> - anchoredMorph relativeTextAnchorPosition +<br>
> - (anchoredMorph owner textBounds origin x @ 0)<br>
> - - (0@morphicOffset y) + (0@lineY).<br>
> - ^true<br>
> - ].<br>
> - (super placeEmbeddedObject: anchoredMorph) ifFalse: [^ false].<br>
> - anchoredMorph isMorph ifTrue: [<br>
> - anchoredMorph position: ((destX - anchoredMorph width)@lineY) -<br>
> morphicOffset<br>
> - ] ifFalse: [<br>
> - destY := lineY.<br>
> - baselineY := lineY + anchoredMorph height..<br>
> - runX := destX.<br>
> - anchoredMorph<br>
> - displayOn: bitBlt destForm<br>
> - at: destX - anchoredMorph width @ destY<br>
> - clippingBox: bitBlt clipRect<br>
> - ].<br>
> - ^ true!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiDisplayScanner>>plainTab (in category 'stop<br>
> conditions') -----<br>
> - plainTab<br>
> - | oldX |<br>
> - oldX := destX.<br>
> - super plainTab.<br>
> - fillBlt == nil ifFalse:<br>
> - [fillBlt destX: oldX destY: destY width: destX - oldX height: font<br>
> height; copyBits]!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiDisplayScanner>><wbr>presentationText: (in category<br>
> 'private') -----<br>
> - presentationText: t<br>
> -<br>
> - text := t.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method:<br>
> MultiDisplayScanner>><wbr>scanMultiCharactersCombiningFr<wbr>om:to:in:rightX:<wbr>stopConditions:kern:<br>
> (in category 'multilingual scanning') -----<br>
> - scanMultiCharactersCombiningFr<wbr>om: startIndex to: stopIndex in:<br>
> sourceString rightX: rightX stopConditions: stops kern: kernDelta<br>
> -<br>
> - | encoding f nextDestX maxAscii startEncoding char charValue |<br>
> - lastIndex := startIndex.<br>
> - lastIndex > stopIndex ifTrue: [lastIndex := stopIndex. ^ stops at:<br>
> EndOfRun].<br>
> - startEncoding := (sourceString at: startIndex) leadingChar.<br>
> - font ifNil: [font := (TextConstants at: #DefaultMultiStyle) fontArray at:<br>
> 1].<br>
> - ((font isMemberOf: StrikeFontSet) or: [font isKindOf: TTCFontSet])<br>
> ifTrue: [<br>
> - [f := font fontArray at: startEncoding + 1]<br>
> - on: Exception do: [:ex | f := font fontArray at: 1].<br>
> - f ifNil: [ f := font fontArray at: 1].<br>
> - maxAscii := f maxAscii.<br>
> - spaceWidth := f widthOf: Space.<br>
> - ] ifFalse: [<br>
> - maxAscii := font maxAscii.<br>
> - ].<br>
> -<br>
> - [lastIndex <= stopIndex] whileTrue: [<br>
> - encoding := (sourceString at: lastIndex) leadingChar.<br>
> - encoding ~= startEncoding ifTrue: [lastIndex := lastIndex - 1. ^ stops<br>
> at: EndOfRun].<br>
> - char := (sourceString at: lastIndex).<br>
> - charValue := char charCode.<br>
> - charValue > maxAscii ifTrue: [charValue := maxAscii].<br>
> - (encoding = 0 and: [(stopConditions at: charValue + 1) ~~ nil]) ifTrue:<br>
> [<br>
> - ^ stops at: charValue + 1<br>
> - ].<br>
> - nextDestX := destX + (self widthOf: char inFont: font).<br>
> - nextDestX > rightX ifTrue: [^ stops at: CrossedX].<br>
> - destX := nextDestX + kernDelta.<br>
> - lastIndex := lastIndex + 1.<br>
> - ].<br>
> - lastIndex := stopIndex.<br>
> - ^ stops at: EndOfRun!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiDisplayScanner>><wbr>setDestForm: (in category 'private')<br>
> -----<br>
> - setDestForm: df<br>
> - bitBlt setDestForm: df.!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiDisplayScanner>>setFont (in category 'private') -----<br>
> - setFont<br>
> - foregroundColor := paragraphColor.<br>
> - super setFont. "Sets font and emphasis bits, and maybe foregroundColor"<br>
> - font installOn: bitBlt foregroundColor: foregroundColor backgroundColor:<br>
> Color transparent.<br>
> - text ifNotNil:[<br>
> - baselineY := lineY + line baseline.<br>
> - destY := baselineY - font ascent].<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiDisplayScanner>>setPort: (in category 'private') -----<br>
> - setPort: aBitBlt<br>
> - "Install the BitBlt to use"<br>
> - bitBlt := aBitBlt.<br>
> - bitBlt sourceX: 0; width: 0. "Init BitBlt so that the first call to a<br>
> primitive will not fail"<br>
> - bitBlt sourceForm: nil. "Make sure font installation won't be confused"<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiDisplayScanner>><wbr>setStopConditions (in category 'stop<br>
> conditions') -----<br>
> - setStopConditions<br>
> - "Set the font and the stop conditions for the current run."<br>
> -<br>
> - self setFont.<br>
> - self setConditionArray: (alignment = Justified ifTrue: [#paddedSpace]).<br>
> -<br>
> - "<br>
> - alignment = Justified ifTrue: [<br>
> - stopConditions == DefaultStopConditions<br>
> - ifTrue:[stopConditions := stopConditions copy].<br>
> - stopConditions at: Space asciiValue + 1 put: #paddedSpace]<br>
> - "!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiDisplayScanner>>tab (in category 'stop conditions')<br>
> -----<br>
> - tab<br>
> - self plainTab.<br>
> - lastIndex := lastIndex + 1.<br>
> - ^ false!<br>
><br>
> Item was removed:<br>
> - ----- Method:<br>
> MultiDisplayScanner>>text:<wbr>textStyle:foreground:<wbr>background:fillBlt:<wbr>ignoreColorChanges:<br>
> (in category 'private') -----<br>
> - text: t textStyle: ts foreground: foreColor background: backColor fillBlt:<br>
> blt ignoreColorChanges: shadowMode<br>
> - text := t.<br>
> - textStyle := ts.<br>
> - foregroundColor := paragraphColor := foreColor.<br>
> - (backgroundColor := backColor) isTransparent ifFalse:<br>
> - [fillBlt := blt.<br>
> - fillBlt fillColor: backgroundColor].<br>
> - ignoreColorChanges := shadowMode!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiDisplayScanner>><wbr>textColor: (in category 'private')<br>
> -----<br>
> - textColor: textColor<br>
> - ignoreColorChanges ifTrue: [^ self].<br>
> - foregroundColor := textColor!<br>
><br>
> Item was removed:<br>
> - NewParagraph subclass: #MultiNewParagraph<br>
> - instanceVariableNames: 'presentationText presentationLines'<br>
> - classVariableNames: ''<br>
> - poolDictionaries: 'TextConstants'<br>
> - category: 'Etoys-Squeakland-<wbr>Multilingual-Scanning'!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiNewParagraph>>displayOn:<wbr>using:at: (in category<br>
> 'fonts-display') -----<br>
> - displayOn: aCanvas using: displayScanner at: somePosition<br>
> - "Send all visible lines to the displayScanner for display"<br>
> -<br>
> - | visibleRectangle offset leftInRun line |<br>
> - visibleRectangle := aCanvas clipRect.<br>
> - offset := somePosition - positionWhenComposed.<br>
> - leftInRun := 0.<br>
> - (self lineIndexForPoint: visibleRectangle topLeft)<br>
> - to: (self lineIndexForPoint: visibleRectangle bottomRight)<br>
> - do: [:i | line := lines at: i.<br>
> - self displaySelectionInLine: line on: aCanvas.<br>
> - line first <= line last ifTrue:<br>
> - [leftInRun := displayScanner displayLine: line<br>
> - offset: offset leftInRun: leftInRun]].<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiNewParagraph>><wbr>displayOnTest:using:at: (in category<br>
> 'fonts-display') -----<br>
> - displayOnTest: aCanvas using: displayScanner at: somePosition<br>
> - "Send all visible lines to the displayScanner for display"<br>
> -<br>
> - | visibleRectangle offset leftInRun line |<br>
> - (presentationText isNil or: [presentationLines isNil]) ifTrue: [<br>
> - ^ self displayOn: aCanvas using: displayScanner at: somePosition.<br>
> - ].<br>
> - visibleRectangle := aCanvas clipRect.<br>
> - offset := somePosition - positionWhenComposed.<br>
> - leftInRun := 0.<br>
> - (self lineIndexForPoint: visibleRectangle topLeft)<br>
> - to: (self lineIndexForPoint: visibleRectangle bottomRight)<br>
> - do: [:i | line := presentationLines at: i.<br>
> - self displaySelectionInLine: line on: aCanvas.<br>
> - line first <= line last ifTrue:<br>
> - [leftInRun := displayScanner displayLine: line<br>
> - offset: offset leftInRun: leftInRun]].<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method:<br>
> MultiNewParagraph>><wbr>multiComposeLinesFrom:to:<wbr>delta:into:priorLines:atY: (in<br>
> category 'composition') -----<br>
> - multiComposeLinesFrom: start to: stop delta: delta into: lineColl<br>
> priorLines: priorLines<br>
> - atY: startingY<br>
> - "While the section from start to stop has changed, composition may ripple<br>
> all the way to the end of the text. However in a rectangular container, if<br>
> we ever find a line beginning with the same character as before (ie<br>
> corresponding to delta in the old lines), then we can just copy the old<br>
> lines from there to the end of the container, with adjusted indices and<br>
> y-values"<br>
> -<br>
> - | newResult composer presentationInfo |<br>
> -<br>
> - composer := MultiTextComposer new.<br>
> - presentationLines := nil.<br>
> - presentationText := nil.<br>
> - newResult := composer<br>
> - multiComposeLinesFrom: start<br>
> - to: stop<br>
> - delta: delta<br>
> - into: lineColl<br>
> - priorLines: priorLines<br>
> - atY: startingY<br>
> - textStyle: textStyle<br>
> - text: text<br>
> - container: container<br>
> - wantsColumnBreaks: wantsColumnBreaks == true.<br>
> - lines := newResult first asArray.<br>
> - maxRightX := newResult second.<br>
> - presentationInfo := composer getPresentationInfo.<br>
> - presentationLines := presentationInfo first asArray.<br>
> - presentationText := presentationInfo second.<br>
> - "maxRightX printString displayAt: 0@0."<br>
> - ^maxRightX<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiNewParagraph>><wbr>presentationLines (in category<br>
> 'accessing') -----<br>
> - presentationLines<br>
> -<br>
> - ^ presentationLines.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiNewParagraph>><wbr>presentationText (in category<br>
> 'accessing') -----<br>
> - presentationText<br>
> -<br>
> - ^ presentationText.<br>
> - !<br>
><br>
> Item was removed:<br>
> - TextComposer subclass: #MultiTextComposer<br>
> - instanceVariableNames: 'presentation presentationLines'<br>
> - classVariableNames: ''<br>
> - poolDictionaries: 'TextConstants'<br>
> - category: 'Etoys-Squeakland-<wbr>Multilingual-Scanning'!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiTextComposer>><wbr>composeEachRectangleIn: (in category 'as<br>
> yet unclassified') -----<br>
> - composeEachRectangleIn: rectangles<br>
> -<br>
> - | myLine lastChar |<br>
> -<br>
> - 1 to: rectangles size do: [:i |<br>
> - currCharIndex <= theText size ifFalse: [^false].<br>
> - myLine := scanner<br>
> - composeFrom: currCharIndex<br>
> - inRectangle: (rectangles at: i)<br>
> - firstLine: isFirstLine<br>
> - leftSide: i=1<br>
> - rightSide: i=rectangles size.<br>
> - lines addLast: myLine.<br>
> - presentationLines addLast: scanner getPresentationLine.<br>
> - presentation ifNil: [presentation := scanner getPresentation]<br>
> - ifNotNil: [presentation := presentation, scanner getPresentation].<br>
> - actualHeight := actualHeight max: myLine lineHeight. "includes font<br>
> changes"<br>
> - currCharIndex := myLine last + 1.<br>
> - lastChar := theText at: myLine last.<br>
> - lastChar = Character cr ifTrue: [^#cr].<br>
> - wantsColumnBreaks ifTrue: [<br>
> - lastChar = TextComposer characterForColumnBreak ifTrue:<br>
> [^#columnBreak].<br>
> - ].<br>
> - ].<br>
> - ^false!<br>
><br>
> Item was removed:<br>
> - ----- Method: MultiTextComposer>><wbr>getPresentationInfo (in category 'as yet<br>
> unclassified') -----<br>
> - getPresentationInfo<br>
> -<br>
> - ^ Array with: presentationLines with: presentation.<br>
> - !<br>
><br>
> Item was removed:<br>
> - ----- Method:<br>
> MultiTextComposer>><wbr>multiComposeLinesFrom:to:<wbr>delta:into:priorLines:atY:<wbr>textStyle:text:container:<wbr>wantsColumnBreaks:<br>
> (in category 'as yet unclassified') -----<br>
> - multiComposeLinesFrom: argStart to: argStop delta: argDelta into:<br>
> argLinesCollection priorLines: argPriorLines atY: argStartY textStyle:<br>
> argTextStyle text: argText container: argContainer wantsColumnBreaks:<br>
> argWantsColumnBreaks<br>
> -<br>
> - wantsColumnBreaks := argWantsColumnBreaks.<br>
> - lines := argLinesCollection.<br>
> - presentationLines := argLinesCollection copy.<br>
> - theTextStyle := argTextStyle.<br>
> - theText := argText.<br>
> - theContainer := argContainer.<br>
> - deltaCharIndex := argDelta.<br>
> - currCharIndex := startCharIndex := argStart.<br>
> - stopCharIndex := argStop.<br>
> - prevLines := argPriorLines.<br>
> - currentY := argStartY.<br>
> - defaultLineHeight := theTextStyle lineGrid.<br>
> - maxRightX := theContainer left.<br>
> - possibleSlide := stopCharIndex < theText size and: [theContainer<br>
> isMemberOf: Rectangle].<br>
> - nowSliding := false.<br>
> - prevIndex := 1.<br>
> - scanner := MultiCompositionScanner new text: theText textStyle:<br>
> theTextStyle.<br>
> - scanner wantsColumnBreaks: wantsColumnBreaks.<br>
> - isFirstLine := true.<br>
> - self composeAllLines.<br>
> - isFirstLine ifTrue: ["No space in container or empty text"<br>
> - self<br>
> - addNullLineWithIndex: startCharIndex<br>
> - andRectangle: (theContainer topLeft extent: 0@defaultLineHeight)<br>
> - ] ifFalse: [<br>
> - self fixupLastLineIfCR<br>
> - ].<br>
> - ^{lines asArray. maxRightX}<br>
> -<br>
> - !<br>
><br>
><br>
><br>
><br>
<br>
<br>
</div></div></blockquote></div><br></div></div></div></div>