[squeak-dev] #isBreakableAt:in:

Bob Arning arning315 at comcast.net
Thu Sep 26 13:28:50 UTC 2013


I suppose an example would have helped here. So I tried rolling my own:

StringHolder new contents: 'jhdgkjh dfkhg kfg kdjh gkjdhfg kjdfh gkjdfhg 
jkdhf gkjdh fgkjhd fgkjh dfkgjdkjfgh kdjhf gkjdhf gkjdh fgkjdhf gkjdh 
fgkjdh fgkjdh fgkjdhf gkjdh fgkjdhg kjd fhg' asWideString; openLabel: 'foo'

Then I fiddled with the window and tried to see where the code did or 
did not go. It basically didn't go anywhere that seemed related to your 
question because:

     scanner := (theText string isOctetString
                         ifTrue:[CompositionScanner new]
                         ifFalse:[MultiCompositionScanner new]).

detects that my WideString isn't really all that wide and simply uses 
CompositionScanner. (This is from TextComposer composeBlahBlah). Even 
though it uses a plain scanner here, it does use a Multi* scanner when 
trying to figure out where to highlight.

Maybe that's why you weren't seeing what you expected. I'll try again 
with some really wide chars.

Cheers,
Bob

On 9/25/13 10:01 PM, tim Rowledge wrote:
> On 24-09-2013, at 2:21 PM, Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com> wrote:
>
>> 2013/9/21 tim Rowledge <tim at rowledge.org>
>>
>> a) There are {language}environment classes and encoding classes. There is #isBreakableAt:in: implemented in both but seemingly unused in the encoding classes because it is just plain broken there. Should it be removed from the encoders? In the language environment classes it is implemented to return true for space and cr by default, but space, cr & lf in Latin1 and Latin2. Is that as expected?
>>
>>   
>>  From what I understand:
>> - no need to answer true for space, cr, lf since these are already handled in the CharacterScanner stopConditions, so default answer should be ^false (unless one of these is removed from stopConditions, I thought I saw that, but cannot remember...)
>> - whether it should be in EncodedCharSet or LanguageEnvironment, I don't know…
> I'm a bit puzzled by what's going on here, now that I'm looking into it. The Multi* classes actually *do* have stopConditions *without* space, and don't have methods to handle #space. And yet I can't find anything going wrong… this is odd.
>
> With Nicolas' changes to the implementations of #isBreakableAt:in: it seems like we shouldn't be getting any use of registerBreakableIndex (and in fact I'm running code where it isn't even in the scan methods to be called!) and so MultiCompositionScanner>crossedX ought to be getting a bit annoyed by now. The only bit of its code getting run is the last 4 lines and 'breakableIndex'/'lineHeightAtBreak'/'baselineAtBreak' are all nil. This surely ought to be breaking the TextLine 'line' but so far… nothing. Even changing the width of windows to force recomposing doesn't seem to upset things. Why isn't it breaking!
>
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Compatible: Gracefully accepts erroneous data from any source.
>
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20130926/3c990336/attachment.htm


More information about the Squeak-dev mailing list