[squeak-dev] Weird text composition when tab happens at large destX

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Wed May 15 19:51:06 UTC 2019


Ah found it, the tabsArray stops at 720 currently in default TextStyle...
Now that our screen are so wide, maybe it's not enough.
And the test does not pass and does not work like I thought it should.

Le mer. 15 mai 2019 à 21:36, Nicolas Cellier <
nicolas.cellier.aka.nice at gmail.com> a écrit :

> Hi,
> the (attached) text composition bugs me:
> When a tab occurs after some column, the composition creates a new line,
> even when there is room for more text...
> I tried to create a test case in CharacterScannerTest
>
> testCrossedXWithManyTabs
> | p text chunkWidth expectedChunkStartX expectedWidth |
> text := (String new: 59 streamContents: [:str | (String new: 14 withAll:
> $m) do: [:m | 5 timesRepeat: [str nextPut: m]] separatedBy: [str tab]])
> asText.
> chunkWidth := 5*mWidth.
> expectedChunkStartX := Array new: 14 streamContents:
> [:str |
> (1 to: 14) inject: 1 into:
> [:destX :rank |
> str nextPut: destX.
> (style nextTabXFrom: destX + chunkWidth leftMargin: 0 rightMargin: 0)]].
> expectedWidth := expectedChunkStartX last + chunkWidth.
> p := NewParagraph new.
> p
> compose: text
> style: style
> from: 1
> in: (0 @ 0 corner: expectedWidth+10 @ (style lineGrid * 2)).
> self assert: p lines size = 1 description: 'There is enough composition
> width for this text'.
>
> but the test pass (it composes in single line). Any idea where to look at?
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190515/042e4c55/attachment.html>


More information about the Squeak-dev mailing list