<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,</p>
<p><br>
</p>
<p>> <span style="font-size:12pt">Also, I don't see how two font refs can ever be stacked, it makes not much sense, no?</span></p>
<p><br>
</p>
<p>That was exactly my point. 'foo' asText beAllFont: font1; beAllFont: font2 does not make any sense, of course, but when a text is passed from somewhere else, you may not know which formatting has already been applied to it ...</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph<br>
<span style="font-size:12pt"></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><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> Donnerstag, 3. September 2020 00:13:24<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"><br>
> On 02.09.2020, at 23:29, Thiede, Christoph <Christoph.Thiede@student.hpi.uni-potsdam.de> wrote:<br>
> <br>
> Hi Tobias, thanks for the tips! :-)<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>
> Would you expect such a Text>>#setFont:from:to: only to add a TextFontReference or also to remove all existing TextFontReferences from the interval?<br>
> <br>
<br>
I'd be wary of using #set... because exactly that expectation happens.<br>
Vocabulary is cumbersome, tho.<br>
see TextMorph's _be_AllFont, Text's _make_Bold and the attributes only ever add.<br>
<br>
Also, I don't see how two font refs can ever be stacked, it makes not much sense, no?<br>
Coalescing the runs would probably take care of chopping up the different font runs, but that's beneath the cover.<br>
<br>
That said, I liked the Seaside/Magritte-wording with beSomething on their brushes or models respectively…<br>
<br>
Best regards<br>
        -Tobias<br>
<br>
> Best,<br>
> Christoph<br>
> Von: Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Tobias Pape <Das.Linux@gmx.de><br>
> Gesendet: Mittwoch, 2. September 2020 22:04:38<br>
> An: The general-purpose Squeak developers list<br>
> Betreff: Re: [squeak-dev] Inspector Custom Value Panes & Related<br>
>  <br>
> 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! Seehttp://forum.world.st/Please-try-out-Inspector-Refactoring-td5114974.html andhttps://squeak.org/downloads/#current-trunk-image-2:~:text=Current-,Trunk,-Image
 :-)<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>
</div>
</span></font>
</body>
</html>