<div dir="ltr"><div><div><div>I don't understand all you did...<br></div>#scanSelector is still in use sent by #scanSelectorAt:.<br>This is because #charsetAt: can answer either a LanguageEnvironment or an EncodedCharSet, so why remove it now?<br>
<br></div>Why remove #isBreakable:in:in:? it is still in use by the scanJapanese...<br></div><div>same for breakAtSpace (for Japanese only).<br></div><div><br></div>Why remove composeFrom: startIndex inRectangle: snip... ?<br>
I'm suspect that this is a slip due to moving methods between packages<br><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/27 <span dir="ltr"><<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">tim Rowledge uploaded a new version of Multilingual to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Multilingual-tpr.177.mcz" target="_blank">http://source.squeak.org/trunk/Multilingual-tpr.177.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Multilingual-tpr.177<br>
Author: tpr<br>
Time: 26 September 2013, 5:02:39.835 pm<br>
UUID: 1a4fc492-87e5-4fa5-a7b4-2d79bd774000<br>
Ancestors: Multilingual-nice.176<br>
<br>
Get rid of<br>
EncodedCharSet class>>scanSelector<br>
MultiCompositionScanner>>isBreakableAt:in:in: & setFont<br>
minor changes to some stopcondition methods<br>
<br>
=============== Diff against Multilingual-nice.176 ===============<br>
<br>
Item was removed:<br>
- ----- Method: EncodedCharSet class>>scanSelector (in category 'accessing - displaying') -----<br>
- scanSelector<br>
- "This appears to be redundant - possibly once used as a default and now usurped by LanguageEnvironmet class>scanSelector ?"<br>
- ^ #scanMultiCharactersFrom:to:in:rightX:stopConditions:kern:!<br>
<br>
Item was changed:<br>
----- Method: MultiCharacterScanner>>isBreakableAt:in:in: (in category 'scanner methods') -----<br>
isBreakableAt: index in: sourceString in: encodingClass<br>
+ "check with the encoding whether the character at index is a breakable character- only the JISX0208 & JapaneseEnvironment will ever return true, so only the scanJapaneseCharacters... method calls this"<br>
-<br>
^ encodingClass isBreakableAt: index in: sourceString.<br>
!<br>
<br>
Item was changed:<br>
----- Method: MultiCharacterScanner>>scanMultiCharactersFrom:to:in:rightX:stopConditions:kern: (in category 'scanning') -----<br>
scanMultiCharactersFrom: startIndex to: stopIndex in: sourceString rightX: rightX stopConditions: stops kern: kernDelta<br>
<br>
| ascii encoding f nextDestX startEncoding floatDestX widthAndKernedWidth nextChar atEndOfRun |<br>
lastIndex := startIndex.<br>
lastIndex > stopIndex ifTrue: [lastIndex := stopIndex. ^ stops endOfRun].<br>
startEncoding := (sourceString at: startIndex) leadingChar.<br>
font ifNil: [font := (TextConstants at: #DefaultMultiStyle) fontArray at: 1].<br>
((font isMemberOf: StrikeFontSet) or: [font isKindOf: TTCFontSet]) ifTrue: [<br>
f := [font fontArray at: startEncoding + 1] ifError: [nil].<br>
f ifNil: [ f := font fontArray at: 1].<br>
spaceWidth := f widthOf: Space.<br>
].<br>
floatDestX := destX.<br>
widthAndKernedWidth := Array new: 2.<br>
atEndOfRun := false.<br>
[lastIndex <= stopIndex] whileTrue: [<br>
encoding := (sourceString at: lastIndex) leadingChar.<br>
encoding ~= startEncoding ifTrue: [lastIndex := lastIndex - 1. ^ stops endOfRun].<br>
ascii := (sourceString at: lastIndex) charCode.<br>
(ascii < 256 and: [(stops at: ascii + 1) ~~ nil]) ifTrue: [^ stops at: ascii + 1].<br>
nextChar := (lastIndex + 1 <= stopIndex)<br>
ifTrue:[sourceString at: lastIndex + 1]<br>
ifFalse:[<br>
atEndOfRun := true.<br>
"if there is a next char in sourceString, then get the kern<br>
and store it in pendingKernX"<br>
lastIndex + 1 <= sourceString size<br>
ifTrue:[sourceString at: lastIndex + 1]<br>
ifFalse:[ nil]].<br>
font<br>
widthAndKernedWidthOfLeft: (sourceString at: lastIndex)<br>
right: nextChar<br>
into: widthAndKernedWidth.<br>
nextDestX := floatDestX + (widthAndKernedWidth at: 1).<br>
nextDestX > rightX ifTrue: [destX ~= firstDestX ifTrue: [^stops crossedX]].<br>
floatDestX := floatDestX + kernDelta + (widthAndKernedWidth at: 2).<br>
atEndOfRun<br>
ifTrue:[<br>
pendingKernX := (widthAndKernedWidth at: 2) - (widthAndKernedWidth at: 1).<br>
floatDestX := floatDestX - pendingKernX].<br>
destX := floatDestX .<br>
lastIndex := lastIndex + 1.<br>
].<br>
lastIndex := stopIndex.<br>
^ stops endOfRun!<br>
<br>
Item was removed:<br>
- ----- Method: MultiCompositionScanner>>composeFrom:inRectangle:firstLine:leftSide:rightSide: (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 the paragraph."<br>
- | runLength 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 paddingWidth: 0)<br>
- rectangle: lineRectangle.<br>
- spaceCount := 0.<br>
- self handleIndentation.<br>
- leftMargin := destX.<br>
- line leftMargin: leftMargin.<br>
-<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] whileFalse.<br>
-<br>
- ^ line<br>
- lineHeight: lineHeight + textStyle leading<br>
- baseline: baseline + textStyle leading!<br>
<br>
Item was changed:<br>
----- Method: MultiCompositionScanner>>composeLine:fromCharacterIndex:inParagraph: (in category 'scanning') -----<br>
composeLine: lineIndex fromCharacterIndex: startIndex inParagraph: aParagraph<br>
"Answer an instance of TextLineInterval that represents the next line in the paragraph."<br>
| runLength stopCondition |<br>
destX := spaceX := leftMargin := aParagraph leftMarginForCompositionForLine: lineIndex.<br>
destY := 0.<br>
rightMargin := aParagraph rightMarginForComposition.<br>
leftMargin >= rightMargin ifTrue: [self error: 'No room between margins 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>
spaceCount := 0.<br>
<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] whileFalse.<br>
<br>
^line<br>
lineHeight: lineHeight + textStyle leading<br>
baseline: baseline + textStyle leading!<br>
<br>
Item was changed:<br>
----- Method: MultiCompositionScanner>>cr (in category 'stop conditions') -----<br>
cr<br>
"Answer true. Set up values for the text line interval currently being<br>
composed."<br>
<br>
pendingKernX := 0.<br>
+ (lastIndex < text size and: [(text at: lastIndex) = Character cr and: [(text at: lastIndex+1) = Character lf]]) ifTrue: [lastIndex := lastIndex + 1].<br>
- (lastIndex < text size and: [(text at: lastIndex) = CR and: [(text at: lastIndex+1) = Character lf]]) ifTrue: [lastIndex := lastIndex + 1].<br>
line stop: lastIndex.<br>
spaceX := destX.<br>
line paddingWidth: rightMargin - spaceX.<br>
^true!<br>
<br>
Item was changed:<br>
----- Method: MultiCompositionScanner>>endOfRun (in category 'stop 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>
spaceX := destX.<br>
line paddingWidth: rightMargin - destX.<br>
^true]<br>
ifFalse: [<br>
- "(text at: lastIndex) charCode = 32 ifTrue: [destX := destX + 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>>isBreakableAt:in:in: (in category '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>>setFont (in category 'stop conditions') -----<br>
- setFont<br>
- super setFont.<br>
- breakAtSpace := false.!<br>
<br>
<br>
</blockquote></div><br></div>