<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">Is this expected to resolve the limitation that you cannot style the different characters in a list item with different attributes/emphases? :-)</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;font-size: 16px">No. It can just configure color and font of the first character for all other characters.</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;font-size: 16px">Best,</span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">Marcel</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 06.02.2022 18:50:39 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>Hi Marcel,</p>
<p><br>
</p>
<p>thank you for all your recent work on the font and graphics domain! These are really valuable for Squeak; I know multiple people that already face away from Squeak because "the text looks so old-fashioned and puny". The new scaling and the convenience for
 installing other fonts for other charsets definitely improve this, even though many of us are familiar with the classical compact display!</p>
<p><br>
</p>
<p>One question about this commit: Is this expected to resolve the limitation that you cannot style the different characters in a list item with different attributes/emphases? :-) If yes, I did not yet figure out how to do this. When I change Context >> #printString
 like this, the entire line remains unformatted:</p>
<p><br>
</p>
<p></p>
<div>printString</div>
<div><span style="white-space:pre"></span>"Answer an emphasized string in case of a breakpoint method"</div>
<div><br>
</div>
<div><span style="white-space:pre"></span>^(self method notNil and: [self method hasBreakpoint])</div>
<div><span style="white-space:pre"></span>ifTrue:[super printString asText , ' [break]' asText allBold]</div>
<div><span style="white-space:pre"></span>ifFalse:[super printString]</div>
<br>
<p></p>
<p>Best,</p>
<p>Christoph</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> Samstag, 5. Februar 2022 17:50:13<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org<br>
<b>Betreff:</b> [squeak-dev] The Trunk: Morphic-mt.1871.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 Morphic to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Morphic-mt.1871.mcz">http://source.squeak.org/trunk/Morphic-mt.1871.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Morphic-mt.1871<br>
Author: mt<br>
Time: 5 February 2022, 5:50:07.252947 pm<br>
UUID: ace9011c-de05-9846-b208-cccb9d5232a8<br>
Ancestors: Morphic-mt.1870<br>
<br>
Adds support for font changes in list items. Use it to spice up the "set style..." dialog in text fields.<br>
<br>
=============== Diff against Morphic-mt.1870 ===============<br>
<br>
Item was changed:<br>
  ----- Method: LazyListMorph>>display:atRow:on: (in category 'drawing') -----<br>
  display: item atRow: row on: canvas<br>
         "display the given item at row row"<br>
  <br>
         | drawBounds leading emphasized rowColor itemAsText alignment |<br>
         itemAsText := item asStringOrText.<br>
         alignment := self cellPositioning.<br>
         <br>
         "If it is a text, we will only use the first character's emphasis."<br>
+        emphasized := itemAsText isText<br>
+                ifFalse: [ font "fast path" ]<br>
+                ifTrue: [ "Note that a font change may interfere with the receiver's uniform item height."<br>
+                        (itemAsText<br>
+                                fontAt: 1 withDefault: font)<br>
+                                emphasized: (itemAsText emphasisAt: 1)].<br>
-        emphasized := itemAsText isText <br>
-                ifTrue: [font emphasized: (itemAsText emphasisAt: 1)] <br>
-                ifFalse: [font].<br>
         <br>
         rowColor := itemAsText isText<br>
                 ifTrue: [itemAsText colorAt: 1 ifNone: [self colorForRow: row]]<br>
                 ifFalse: [self colorForRow: row].<br>
         <br>
         drawBounds := self drawBoundsForRow: row.<br>
         <br>
         alignment ~= #leftCenter ifTrue: [<br>
                 | itemWidth |<br>
                 itemWidth := self widthToDisplayItem: item. "includes left/right margins"<br>
                 alignment == #center ifTrue: [<br>
                         drawBounds := (self center x - (itemWidth / 2) floor) @ drawBounds top corner: (self center x + (itemWidth / 2) ceiling) @ drawBounds bottom].<br>
                 alignment == #rightCenter ifTrue: [<br>
                         drawBounds := (self right - itemWidth) @ drawBounds top corner: self right @ drawBounds bottom]].<br>
  <br>
         "Draw icon if existing. Adjust draw bounds in that case."<br>
         drawBounds := drawBounds translateBy: (self cellInset left @ 0).<br>
         (self icon: row) ifNotNil: [ :icon || top |<br>
                 top := drawBounds top + ((drawBounds height - self iconExtent y) // 2).<br>
                 canvas translucentImage: icon at: drawBounds left @ top.<br>
                 drawBounds := drawBounds left: drawBounds left + self iconExtent x + self cellInset left ].<br>
                 <br>
         "We will only draw strings here."<br>
         leading :=  emphasized lineGapSliceForMorphs. "look vertically centered"<br>
         drawBounds := drawBounds translateBy: (0 @ self cellInset top).<br>
         canvas<br>
                 drawString: itemAsText asString<br>
                 in: (drawBounds origin + (0 @ leading) corner: drawBounds corner)<br>
                 font: emphasized<br>
                 color: rowColor.<br>
  <br>
         "Draw filter matches if any."<br>
         self<br>
                 displayFilterOn: canvas<br>
                 for: row<br>
                 in: drawBounds<br>
                 font: emphasized.!<br>
<br>
Item was changed:<br>
  ----- Method: TextEditor>>changeStyle (in category 'attributes') -----<br>
  changeStyle<br>
         "Let user change styles for the current text pane."<br>
-        | names reply style current menuList |<br>
  <br>
+        | known knownTTCStyles knownLegacyStyles defaultStyles<br>
+        newStyle current currentName menuList |<br>
         current := morph textStyle.<br>
+        currentName := current defaultFamilyName.<br>
+        <br>
+        knownTTCStyles := ((TextStyle actualTextStyles select: [:ea | ea isTTCStyle])<br>
+                sorted: [:a :b | a defaultFamilyName <= b defaultFamilyName])<br>
+                collect: [:ea | ea defaultFamilyName -> ea] as: OrderedDictionary.<br>
+        knownLegacyStyles := ((TextStyle actualTextStyles reject: [:ea | ea isTTCStyle])<br>
+                sorted: [:a :b | a defaultFamilyName <= b defaultFamilyName])<br>
+                collect: [:ea | ea defaultFamilyName -> ea] as: OrderedDictionary.<br>
+        defaultStyles := ((TextStyle defaultFamilyNames<br>
+                collect: [:ea | ea -> (TextStyle named: ea)] as: OrderedDictionary)<br>
+                reject: [:ea | ea isNil "undefined default styles"])<br>
+                sorted: [:a :b | a key <= b key].<br>
+        <br>
+        known := defaultStyles, {'---' -> nil}, knownTTCStyles, {'--- ' -> nil}, knownLegacyStyles.<br>
+        menuList := Array streamContents: [:s |<br>
+                known keysAndValuesDo: [ :knownName :knownStyle |<br>
+                        s nextPut: (((knownStyle notNil and: [knownStyle defaultFamilyName = currentName])<br>
+                                ifTrue: [ (' > ', knownName, ' (current)' translated) asText ]<br>
+                                ifFalse: [ knownName asText ]) addAttribute: (TextFontReference toFont: (knownStyle ifNil: [TextStyle default])defaultFont); yourself)]].<br>
+        known := known values.<br>
+        newStyle := Project uiManager chooseFrom: menuList values: known.<br>
+        newStyle ifNotNil: [morph textStyle: newStyle copy].<br>
-        names := TextStyle knownTextStyles.<br>
-        menuList := names collect: [ :styleName |<br>
-                styleName = current name<br>
-                        ifTrue: [ '<on>', styleName ]<br>
-                        ifFalse: [ '<off>', styleName ]].<br>
-        reply := Project uiManager chooseFrom: menuList values: names.<br>
-        reply ifNotNil: [<br>
-                (style := TextStyle named: reply) ifNil: [Beeper beep. ^ true].<br>
-                morph textStyle: style copy].<br>
         ^ true!<br>
<br>
<br>
</div>
</span></span>
</div></blockquote></div>