<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>Hi Tobias, thanks for the tips! :-)</p>
<p><br>
</p>
<p>> <span style="font-size:12pt">I think the "TextFontReference toFont:" and explicit "addAttribute:" are a bit involved; maybe something akin to Text>>#makeBoldFrom:to:/Text>>#allBold would be nice.</span></p>
<div><br>
</div>
<p></p>
<div id="x_Signature">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="x_divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">
<div class="x__rp_U4 x_ms-font-weight-regular x_ms-font-color-neutralDark x_rpHighlightAllClass x_rpHighlightBodyClass" id="x_Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="x_divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="x_Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont"></font></div>
</div>
</font></div>
</div>
</div>
</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">Would you expect such a Text>>#setFont:from:to: only to add a TextFontReference or also to remove all existing TextFontReferences from the interval?<span></span></div>
<div class="x__rp_T4" id="x_Item.MessagePartBody"><br>
</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">Best,</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">Christoph</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Tobias Pape <Das.Linux@gmx.de><br>
<b>Gesendet:</b> Mittwoch, 2. September 2020 22:04:38<br>
<b>An:</b> The general-purpose Squeak developers list<br>
<b>Betreff:</b> Re: [squeak-dev] Inspector Custom Value Panes & Related</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Hi<br>
<br>
> On 02.09.2020, at 21:14, Thiede, Christoph <Christoph.Thiede@student.hpi.uni-potsdam.de> wrote:<br>
> <br>
> Hi Eric,<br>
> <br>
> > I can't seem to find MorphInspector in a current (5.3 here) image. Is this a separate package?<br>
> <br>
> MorphInspector, FormInspector, and a bunch of other small new improvements to the inspector framework have arrived in the Squeak Trunk just a few months ago! See
<a href="http://forum.world.st/Please-try-out-Inspector-Refactoring-td5114974.html">
http://forum.world.st/Please-try-out-Inspector-Refactoring-td5114974.html</a> and
<a href="https://squeak.org/downloads/#current-trunk-image-2:~:text=Current-,Trunk,-Image">
https://squeak.org/downloads/#current-trunk-image-2:~:text=Current-,Trunk,-Image</a> :-)<br>
> <br>
> > I find the whole relationship between a Text and TextStyle a bit confusing, especially where it comes to setting Fonts. It appears that there are lots of different "kinds" of Fonts, and there's a good amount of indirection so it's difficult to determine
 which kind of fonts (StrikeFont? TTFont?) "live" and how to see what's available and pick programmatically. Is there a good primer somewhere on Text/TextStyle?<br>
> <br>
> These are good questions others can probably answer better than I could do.<br>
> This is all I can tell you:<br>
>        • Font rendering in Squeak is difficult and the default font (DejaVu Sans) appears to be the only one that looks kind of nice in all sizes. I almost never choose a different font.<br>
>        • To change the font in a Text, use something like:<br>
> 'foo' asText<br>
> addAttribute: (TextFontReference toFont: (StrikeFont<br>
> familyName: 'Darkmap DejaVu Sans'<br>
> pointSize: 20));<br>
> openAsMorph<br>
<br>
I'd suggest to use the TextStyle indirection, so you don't have to guess wether the font is a Strike font or a TTFont or whatever:<br>
<br>
        'foo' asText<br>
                addAttribute: (TextFontReference toFont: ((TextStyle named: 'Darkmap DejaVu Sans') fontOfSize: 20));<br>
                openAsMorph<br>
<br>
<br>
If you are just after changing the font used in a TextMorph (not the text itself), I'd use<br>
<br>
        'foo' asTextMorph <br>
                beAllFont: ((TextStyle named: 'Darkmap DejaVu Sans') fontOfSize: 20);
<br>
                openInHand<br>
<br>
<br>
That way, the name string can be easily exchanged, such  as 'BitstreamVeraSans', or anything imported with the FontImporterTool<br>
<br>
I think the "TextFontReference toFont:" and explicit "addAttribute:" are a bit involved; maybe something akin to Text>>#makeBoldFrom:to:/Text>>#allBold would be nice.<br>
<br>
<br>
Best regards<br>
        -Tobias<br>
<br>
<br>
> <br>
> > Also -- how can I disable editing of a TextMorph?<br>
> <br>
> See TextMorph >> #readOnly: or also Morph >> #lock to disable any interaction.<br>
> <br>
> Best,<br>
> Christoph<br>
> Von: Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Eric Gade <eric.gade@gmail.com><br>
> Gesendet: Mittwoch, 2. September 2020 17:01:45<br>
> An: The general-purpose Squeak developers list<br>
> Betreff: Re: [squeak-dev] Inspector Custom Value Panes & Related<br>
>  <br>
> Hi Christoph,<br>
> <br>
> On Tue, Sep 1, 2020 at 7:32 PM Christoph Thiede <christoph.thiede@student.hpi.uni-potsdam.de> wrote:<br>
> <br>
> for displaying graphics in an inspector, have a look at MorphInspector (screenshot) or FormInspector (pixels). Custom interactive fields are not (yet?) supported, but in theory, you could subclass Inspector and override the relevant toolbuilder methods.
<br>
> <br>
> I can't seem to find MorphInspector in a current (5.3 here) image. Is this a separate package?<br>
>  <br>
> <br>
> Regarding to your second question - why don't you use a TextMorphs? The composition of different formatting styles applied to a string is just what makes up a Text<br>
> <br>
> Aha, yes, I think I've looked into this before. I find the whole relationship between a Text and TextStyle a bit confusing, especially where it comes to setting Fonts. It appears that there are lots of different "kinds" of Fonts, and there's a good amount
 of indirection so it's difficult to determine which kind of fonts (StrikeFont? TTFont?) "live" and how to see what's available and pick programmatically. Is there a good primer somewhere on Text/TextStyle? Also -- how can I disable editing of a TextMorph?
<br>
> <br>
> Thanks again<br>
<br>
<br>
<br>
<br>
</div>
</span></font>
</body>
</html>