<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        Hi Christoph --<div><br></div><div>> <span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">Sigh, these things could be so much easier if we had something like a TextCharacter that could be put into a String. :D</span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px"><br></span></div><div><span style="font-family: Calibri, Helvetica, sans-serif"><span style="font-size: 16px">Well, I think that it is a good thing that String is as simple as it is now. Text combines TextAttribute with String, which is a clean concept in itself. Messing around with this separation of concerns wouldn't help that much.</span></span></div><div><span style="font-family: Calibri, Helvetica, sans-serif"><span style="font-size: 16px"><br></span></span></div><div><span style="font-family: Calibri, Helvetica, sans-serif"><span style="font-size: 16px">Think about the issue with ByteString and ByteArray we have already. Encoding is not that explicit and clients have to be very careful. See #squeakToUtf8 and #utf8ToSqueak as well as how the #binary mode is treated in out TextConverter variations, especially Utf8TextConverter.</span></span></div><div><span style="font-family: Calibri, Helvetica, sans-serif"><span style="font-size: 16px"><br></span></span></div><div><span style="font-family: Calibri, Helvetica, sans-serif"><span style="font-size: 16px">Best,</span></span></div><div><span style="font-family: Calibri, Helvetica, sans-serif"><span style="font-size: 16px">Marcel</span></span></div><div><span style="font-family: Calibri, Helvetica, sans-serif"><span style="font-size: 16px"><br></span></span></div><div class="mb_sig"></div>
                                        <blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 26.03.2022 16:32:12 schrieb Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de>:</p><div style="font-family:Arial,Helvetica,sans-serif">


<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size: 12pt;color: #000000;font-family: Calibri,Helvetica,sans-serif">
<p>Sigh, these things could be so much easier if we had something like a TextCharacter that could be put into a String. :D</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><span style="font-family: Calibri, sans-serif;color: #000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von commits@source.squeak.org <commits@source.squeak.org><br>
<b>Gesendet:</b> Montag, 14. März 2022 15:54:31<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org<br>
<b>Betreff:</b> [squeak-dev] The Trunk: Collections-mt.995.mcz</span>
<div> </div>
</div>
</div>
<span style="font-size: 10pt"><span style="font-size: 10pt">
<div class="PlainText">Marcel Taeumel uploaded a new version of Collections to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Collections-mt.995.mcz">http://source.squeak.org/trunk/Collections-mt.995.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Collections-mt.995<br>
Author: mt<br>
Time: 14 March 2022, 3:54:27.937786 pm<br>
UUID: 2b6b2cae-7f50-f74b-bf55-732ed03daed5<br>
Ancestors: Collections-mt.994<br>
<br>
Adds #withNoLineLongerThan: to Text. Complements Graphics-mt.498 (and also Morphic-mt.1933 in some sense).<br>
<br>
Feel free to check all three implementors and learn about their differences. :-)<br>
<br>
=============== Diff against Collections-mt.994 ===============<br>
<br>
Item was added:<br>
+ ----- Method: Text>>withNoLineLongerThan: (in category 'converting') -----<br>
+ withNoLineLongerThan: numChars<br>
+        "Font-specific version of String >> #withNoLineLongerThan: that supports font family and point size changes throughout the text. Compose the receiver's contents and answer a text that has all soft line breaks converted to hard line breaks.
<br>
+        NOTE THAT while we keep the name from the String protocol, it will happen that some lines are longer or shorter than numChars because composition happens in a rectangle. If you want a character-perfect result, call #withNoLineLongerThan: on the receiver's
 string contents. The average length of a line, however, will approximate numChars.<br>
+        (Note that, in Morphic, you can use TextMorph if you want to keep the soft line breaks and not modify the text contents.)"<br>
+ <br>
+        | style paragraph |<br>
+        self ifEmpty: [^ self copy].<br>
+                <br>
+        (self environment classNamed: #NewParagraph)<br>
+                ifNil: [^ (self asString withNoLineLongerThan: numChars) asText]<br>
+                ifNotNil: [:paragraphClass | paragraph := paragraphClass new].<br>
+        <br>
+        "Configure the paragraph with a text style. Use the default text style only if the receiver has no custom font set for the first character. In that case, use the style that comes with that custom font. Use #asNewTextStyle to create a copy that has
 the correct #defaultFont (and point size) set."<br>
+        paragraph<br>
+                compose: self<br>
+                style: (style := (self fontAt: 1 withStyle: TextStyle default)<br>
+                        asNewTextStyle)<br>
+                from: 1<br>
+                in: (0@0 extent: (style compositionWidthFor: numChars) @ 9999999).<br>
+        <br>
+        ^ paragraph asTextWithLineBreaks!<br>
<br>
<br>
</div>
</span></span>
</div></blockquote></div>