Thank you for the clarification. Then I will add that other limitation to one of my huge wishlists ... :-)<br>
<br>
Best,<br>
Christoph<br>
<br>
<font color="#808080">---<br>
</font><font color="#808080"><i>Sent from </i></font><font color="#808080"><i><a href="https://github.com/hpi-swa-lab/squeak-inbox-talk"><u><font color="#808080">Squeak Inbox Talk</font></u></a></i></font><br>
<br>
On 2022-02-07T21:17:31+01:00, marcel.taeumel@hpi.de wrote:<br>
<br>
> HI Christoph --<br>
> <br>
> >Is this expected to resolve the limitation that you cannot style the different characters in a list item with different attributes/emphases? :-)<br>
> <br>
> No. It can just configure color and font of the first character for all other characters.<br>
> <br>
> Best,<br>
> Marcel<br>
> Am 06.02.2022 18:50:39 schrieb Thiede, Christoph <christoph.thiede at student.hpi.uni-potsdam.de>:<br>
> Hi Marcel,<br>
> <br>
> 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!<br>
> <br>
> 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:<br>
> <br>
> printString<br>
> "Answer an emphasized string in case of a breakpoint method"<br>
> <br>
> ^(self method notNil and: [self method hasBreakpoint])<br>
> ifTrue:[super printString asText , ' [break]' asText allBold]<br>
> ifFalse:[super printString]<br>
> <br>
> Best,<br>
> Christoph<br>
> Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von commits at source.squeak.org <commits at source.squeak.org><br>
> Gesendet: Samstag, 5. Februar 2022 17:50:13<br>
> An: squeak-dev at lists.squeakfoundation.org; packages at lists.squeakfoundation.org<br>
> Betreff: [squeak-dev] The Trunk: Morphic-mt.1871.mcz<br>
>  <br>
> Marcel Taeumel uploaded a new version of Morphic to project The Trunk:<br>
> http://source.squeak.org/trunk/Morphic-mt.1871.mcz [http://source.squeak.org/trunk/Morphic-mt.1871.mcz]<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>
> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220207/8d4a6b03/attachment.html><br>
> <br>