tim Rowledge uploaded a new version of Multilingual to project The Trunk:
http://source.squeak.org/trunk/Multilingual-tpr.177.mcz ==================== Summary ==================== Name: Multilingual-tpr.177 Author: tpr Time: 26 September 2013, 5:02:39.835 pm UUID: 1a4fc492-87e5-4fa5-a7b4-2d79bd774000 Ancestors: Multilingual-nice.176 Get rid of EncodedCharSet class>>scanSelector MultiCompositionScanner>>isBreakableAt:in:in: & setFont minor changes to some stopcondition methods =============== Diff against Multilingual-nice.176 =============== Item was removed: - ----- Method: EncodedCharSet class>>scanSelector (in category 'accessing - displaying') ----- - scanSelector - "This appears to be redundant - possibly once used as a default and now usurped by LanguageEnvironmet class>scanSelector ?" - ^ #scanMultiCharactersFrom:to:in:rightX:stopConditions:kern:! Item was changed: ----- Method: MultiCharacterScanner>>isBreakableAt:in:in: (in category 'scanner methods') ----- isBreakableAt: index in: sourceString in: encodingClass + "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" - ^ encodingClass isBreakableAt: index in: sourceString. ! Item was changed: ----- Method: MultiCharacterScanner>>scanMultiCharactersFrom:to:in:rightX:stopConditions:kern: (in category 'scanning') ----- scanMultiCharactersFrom: startIndex to: stopIndex in: sourceString rightX: rightX stopConditions: stops kern: kernDelta | ascii encoding f nextDestX startEncoding floatDestX widthAndKernedWidth nextChar atEndOfRun | lastIndex := startIndex. lastIndex > stopIndex ifTrue: [lastIndex := stopIndex. ^ stops endOfRun]. startEncoding := (sourceString at: startIndex) leadingChar. font ifNil: [font := (TextConstants at: #DefaultMultiStyle) fontArray at: 1]. ((font isMemberOf: StrikeFontSet) or: [font isKindOf: TTCFontSet]) ifTrue: [ f := [font fontArray at: startEncoding + 1] ifError: [nil]. f ifNil: [ f := font fontArray at: 1]. spaceWidth := f widthOf: Space. ]. floatDestX := destX. widthAndKernedWidth := Array new: 2. atEndOfRun := false. [lastIndex <= stopIndex] whileTrue: [ encoding := (sourceString at: lastIndex) leadingChar. encoding ~= startEncoding ifTrue: [lastIndex := lastIndex - 1. ^ stops endOfRun]. ascii := (sourceString at: lastIndex) charCode. (ascii < 256 and: [(stops at: ascii + 1) ~~ nil]) ifTrue: [^ stops at: ascii + 1]. nextChar := (lastIndex + 1 <= stopIndex) ifTrue:[sourceString at: lastIndex + 1] ifFalse:[ atEndOfRun := true. "if there is a next char in sourceString, then get the kern and store it in pendingKernX" lastIndex + 1 <= sourceString size ifTrue:[sourceString at: lastIndex + 1] ifFalse:[ nil]]. font widthAndKernedWidthOfLeft: (sourceString at: lastIndex) right: nextChar into: widthAndKernedWidth. nextDestX := floatDestX + (widthAndKernedWidth at: 1). nextDestX > rightX ifTrue: [destX ~= firstDestX ifTrue: [^stops crossedX]]. floatDestX := floatDestX + kernDelta + (widthAndKernedWidth at: 2). atEndOfRun ifTrue:[ pendingKernX := (widthAndKernedWidth at: 2) - (widthAndKernedWidth at: 1). floatDestX := floatDestX - pendingKernX]. destX := floatDestX . lastIndex := lastIndex + 1. ]. lastIndex := stopIndex. ^ stops endOfRun! Item was removed: - ----- Method: MultiCompositionScanner>>composeFrom:inRectangle:firstLine:leftSide:rightSide: (in category 'scanning') ----- - composeFrom: startIndex inRectangle: lineRectangle - firstLine: firstLine leftSide: leftSide rightSide: rightSide - "Answer an instance of TextLineInterval that represents the next line in the paragraph." - | runLength stopCondition | - "Set up margins" - leftMargin := lineRectangle left. - leftSide ifTrue: [leftMargin := leftMargin + - (firstLine ifTrue: [textStyle firstIndent] - ifFalse: [textStyle restIndent])]. - destX := spaceX := leftMargin. - firstDestX := destX. - rightMargin := lineRectangle right. - rightSide ifTrue: [rightMargin := rightMargin - textStyle rightIndent]. - lastIndex := startIndex. "scanning sets last index" - destY := lineRectangle top. - lineHeight := baseline := 0. "Will be increased by setFont" - self setStopConditions. "also sets font" - runLength := text runLengthFor: startIndex. - runStopIndex := (lastIndex := startIndex) + (runLength - 1). - line := (TextLine start: lastIndex stop: 0 internalSpaces: 0 paddingWidth: 0) - rectangle: lineRectangle. - spaceCount := 0. - self handleIndentation. - leftMargin := destX. - line leftMargin: leftMargin. - - [stopCondition := self scanCharactersFrom: lastIndex to: runStopIndex - in: text string rightX: rightMargin stopConditions: stopConditions - kern: kern. - "See setStopConditions for stopping conditions for composing." - self perform: stopCondition] whileFalse. - - ^ line - lineHeight: lineHeight + textStyle leading - baseline: baseline + textStyle leading! Item was changed: ----- Method: MultiCompositionScanner>>composeLine:fromCharacterIndex:inParagraph: (in category 'scanning') ----- composeLine: lineIndex fromCharacterIndex: startIndex inParagraph: aParagraph "Answer an instance of TextLineInterval that represents the next line in the paragraph." | runLength stopCondition | destX := spaceX := leftMargin := aParagraph leftMarginForCompositionForLine: lineIndex. destY := 0. rightMargin := aParagraph rightMarginForComposition. leftMargin >= rightMargin ifTrue: [self error: 'No room between margins to compose']. lastIndex := startIndex. "scanning sets last index" lineHeight := textStyle lineGrid. "may be increased by setFont:..." baseline := textStyle baseline. - baselineY := destY + baseline. self setStopConditions. "also sets font" self handleIndentation. runLength := text runLengthFor: startIndex. runStopIndex := (lastIndex := startIndex) + (runLength - 1). line := TextLineInterval start: lastIndex stop: 0 internalSpaces: 0 paddingWidth: 0. spaceCount := 0. [stopCondition := self scanCharactersFrom: lastIndex to: runStopIndex in: text string rightX: rightMargin stopConditions: stopConditions kern: kern. "See setStopConditions for stopping conditions for composing." self perform: stopCondition] whileFalse. ^line lineHeight: lineHeight + textStyle leading baseline: baseline + textStyle leading! Item was changed: ----- Method: MultiCompositionScanner>>cr (in category 'stop conditions') ----- cr "Answer true. Set up values for the text line interval currently being composed." pendingKernX := 0. + (lastIndex < text size and: [(text at: lastIndex) = Character cr and: [(text at: lastIndex+1) = Character lf]]) ifTrue: [lastIndex := lastIndex + 1]. - (lastIndex < text size and: [(text at: lastIndex) = CR and: [(text at: lastIndex+1) = Character lf]]) ifTrue: [lastIndex := lastIndex + 1]. line stop: lastIndex. spaceX := destX. line paddingWidth: rightMargin - spaceX. ^true! Item was changed: ----- Method: MultiCompositionScanner>>endOfRun (in category 'stop conditions') ----- endOfRun "Answer true if scanning has reached the end of the paragraph. Otherwise step conditions (mostly install potential new font) and answer false." | runLength | lastIndex = text size ifTrue: [line stop: lastIndex. spaceX := destX. line paddingWidth: rightMargin - destX. ^true] ifFalse: [ - "(text at: lastIndex) charCode = 32 ifTrue: [destX := destX + spaceWidth]." runLength := (text runLengthFor: (lastIndex := lastIndex + 1)). runStopIndex := lastIndex + (runLength - 1). self setStopConditions. ^false] ! Item was removed: - ----- Method: MultiCompositionScanner>>isBreakableAt:in:in: (in category 'multilingual scanning') ----- - isBreakableAt: index in: sourceString in: encodingClass - - ^ encodingClass isBreakableAt: index in: sourceString. - ! Item was removed: - ----- Method: MultiCompositionScanner>>setFont (in category 'stop conditions') ----- - setFont - super setFont. - breakAtSpace := false.! |
On 27-09-2013, at 12:02 AM, [hidden email] wrote: > tim Rowledge uploaded a new version of Multilingual to project The Trunk: > http://source.squeak.org/trunk/Multilingual-tpr.177.mcz > > ==================== Summary ==================== > > Name: Multilingual-tpr.177 > Author: tpr OK, are you going to redo your -nice.177 to account for -tpr.177 ? And loading your Morphic-nice.691 kills the system since it removes the rather crucial composeFrom:… method from CompositionScanner. tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Fractured Idiom:- RIGOR MORRIS - The cat is dead |
In reply to this post by commits-2
I don't understand all you did... #scanSelector is still in use sent by #scanSelectorAt:.This is because #charsetAt: can answer either a LanguageEnvironment or an EncodedCharSet, so why remove it now? same for breakAtSpace (for Japanese only). I'm suspect that this is a slip due to moving methods between packages 2013/9/27 <[hidden email]> tim Rowledge uploaded a new version of Multilingual to project The Trunk: |
On 26-09-2013, at 5:19 PM, Nicolas Cellier <[hidden email]> wrote: > I don't understand all you did... > #scanSelector is still in use sent by #scanSelectorAt:. > This is because #charsetAt: can answer either a LanguageEnvironment or an EncodedCharSet, so why remove it now? It's just the non-used method in EncodedCharSet class. > > Why remove #isBreakable:in:in:? it is still in use by the scanJapanese... > same for breakAtSpace (for Japanese only). I didn't remove the method completely - there is an identical version in MultiCharacterScanner for it to inherit. > > Why remove composeFrom: startIndex inRectangle: snip... ? > I'm suspect that this is a slip due to moving methods between packages Certainly a mistake somewhere to do with moving stuff. tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Oxymorons: Clearly misunderstood |
In reply to this post by timrowledge
OK tim, I have commited version 178 with your changes but scanSelector and compose*... I have also moved breakAtSpace initialization elsewhere because it is still required.2013/9/27 tim Rowledge <[hidden email]>
|
In reply to this post by timrowledge
2013/9/27 tim Rowledge <[hidden email]>
But these are all class methods... charsetAt: answers a class, not an instance... So JISX0208 won't understand scanSelector if ever you introduce leadingChar = 4...
OK, my bad, I saw that after posting
Yes, my own fault, the update was not ready. Oxymorons: Clearly misunderstood |
In reply to this post by Nicolas Cellier
On 26-09-2013, at 5:44 PM, Nicolas Cellier <[hidden email]> wrote: > OK tim, I have commited version 178 with your changes but scanSelector and compose*... > I have also moved breakAtSpace initialization elsewhere because it is still required. Right - the only problem now is that doing an 'update' results in merge issues in a couple of places and the MCConflict code seems to be a bit broken! If you try to do the 'all newer' it fails with a complaint about dNU: fullTimeStamp. I don't think we caused *that* one! tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Useful random insult:- S p a c e d o u t . SqueakDebug.log (22K) Download Attachment |
In reply to this post by Nicolas Cellier
On 26-09-2013, at 5:50 PM, Nicolas Cellier <[hidden email]> wrote: > It's just the non-used method in EncodedCharSet class. > > But these are all class methods... charsetAt: answers a class, not an instance... > So JISX0208 won't understand scanSelector if ever you introduce leadingChar = 4… Oops, yup, you're right. See, I said it was confusing to mix encoding classes and language environment classes! I've now got an image up to update 13032 that seems to work ok, so far. tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Strange OpCodes: REP: Randomly Execute Programmers |
Great! we finally made some progress on the Multi* front.Despite the latency between France and Canada - it must be greater than expected, or one of us is death, look how our thread is interleaved ;) - 2013/9/27 tim Rowledge <[hidden email]>
|
Oops I wrote death instead of deaf... remember I write english like I speak: very bad :) 2013/9/27 Nicolas Cellier <[hidden email]>
|
In reply to this post by Nicolas Cellier
On 26-09-2013, at 6:08 PM, Nicolas Cellier <[hidden email]> wrote: > Great! > Despite the latency between France and Canada > - it must be greater than expected, or one of us is death, look how our thread is interleaved ;) - > we finally made some progress on the Multi* front. > Now there must not be so many differences remaining between the two hierarchies... > I think it's better to merge them before trying to restore lost features (CombinedChar for pre-composed unicode). > La balle est dans votre camp messire Rowledge. Yah - the next trick is to try to remove the need for CompositionScanner and use only MultiCompositionScanner (though we really need to rename that.. maybe it would just be smarter to move all the 'good' stuff to CompositionScanner) and then hit DisplayScanner etc. I'd like to completely remove one full tree. We've got rid of MultiTextComposer & and MultiNewParagraph at least. I'd like to end up being able to add a new primitive to do the equivalent of primitive 103 but better, for the new system. (We can't simply replace 103 since it is needed to support older images) The ultimate aim is just making the usual case(s) go as fast as possible, which is challenging when you look at the insane amount of code involved in displaying a little bit of text. > Oops I wrote death instead of deaf... > remember I write english like I speak: very bad :) > Ah, you write better than quite a few Brits & Yanks that I've worked with (or even worked *for*) tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim "How many Carlos Wus does it take to change a lightbulb?" "With an unlimited breeding licence, who needs lightbulbs?" |
Free forum by Nabble | Edit this page |