<div dir="ltr"><div>The test did not work because rightMargin should have been further toward east, in the indies (1e6 is a good start).</div><div>The tabsArray are never adapted to character width, and so might be a bit small for large fonts!</div><div>They always take the DefaultTabsArray from TextConstants.</div><div><br></div><div>I see this:<br>(TextStyle default defaultFont widthOf: Character space) = 4<br>(TextStyle default defaultFont widthOf: $m) = 12<br></div><div>DefaultTabsArray is every 24 pixels (6 space width but only 2 m!)<br></div><div><br></div><div>I won't fix the un-adaptative stops by now.</div><div>I don't know what to provide as default and those pixels bug me.</div><div><div>Fonts should never be defined in pixels, they should be defined in points</div><div>(a unit of length use in printing, which is about 1/72 inch, 1/72.27 more exactly).</div><div>In the eighties, a Screen resolution of 72 dpi (dot per inch) was somehow typical, but not nowadays...</div></div><div>Today the resolution of many screens is super high (200 dpi or more).</div><div>Fortunately (???) we draw hideous big squares for what we pretend to be a pixel.<br></div><div><br></div><div>In the meantime, I suggest a quick and dirty fix.<br></div><div>TextConstants is a global, for which we long lost the recipe of making of...</div><div>So I'd suggest some post-script like this for doubling the number of tabs:<br></div><div><br></div><div>    (TextConstants at: #DefaultTabsArray) becomeForward: (24 to: 1440 by: 24) asArray.<br><div>    (TextConstants at: #DefaultMarginTabsArray) becomeForward: ((24 to: 720 by: 24) collect: [:i | {i. i}]).</div><div><br></div><div>Unless we also grow the stops to 32 (8 spaces, 2/3+2 m...)?<br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 15 mai 2019 à 21:51, Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Ah found it, the tabsArray stops at 720 currently in default TextStyle...</div><div>Now that our screen are so wide, maybe it's not enough.<br></div><div>And the test does not pass and does not work like I thought it should.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 15 mai 2019 à 21:36, Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div><div>the (attached) text composition bugs me:</div><div>When a tab occurs after some column, the composition creates a new line, even when there is room for more text...</div><div>I tried to create a test case in CharacterScannerTest</div><div><br></div><div>testCrossedXWithManyTabs<br>  | p text chunkWidth expectedChunkStartX expectedWidth |<br>       text := (String new: 59 streamContents: [:str | (String new: 14 withAll: $m) do: [:m | 5 timesRepeat: [str nextPut: m]] separatedBy: [str tab]]) asText.<br>      chunkWidth := 5*mWidth.<br>       expectedChunkStartX := Array new: 14 streamContents:<br>          [:str |<br>               (1 to: 14) inject: 1 into:<br>                    [:destX :rank |<br>                       str nextPut: destX.<br>                   (style nextTabXFrom: destX + chunkWidth leftMargin: 0 rightMargin: 0)]].<br>      expectedWidth := expectedChunkStartX last + chunkWidth.<br>       p := NewParagraph new.<br>        p<br>             compose: text<br>         style: style<br>          from: 1<br>               in: (0 @ 0 corner: expectedWidth+10 @ (style lineGrid * 2)).<br>  self assert: p lines size = 1 description: 'There is enough composition width for this text'.</div><div><br></div><div>but the test pass (it composes in single line). Any idea where to look at?<br></div><div><br></div></div>
</blockquote></div>
</blockquote></div>