<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
                                        
                                        
                                            
                                        
                                        
                                        Plus, TextFontReference is a rather fixed pointer to a specific font and size, which breaks when using Squeak's notion of High-DPI with bigger fonts in general. TextFontChange works better with its index. And so does TextEmphasis for italic.<div><br></div><div><div>Best,</div><div>Marcel<br><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 03.09.2020 15:53:35 schrieb Tobias Pape <das.linux@gmx.de>:</p><div style="font-family:Arial,Helvetica,sans-serif">Hi<br>> On 03.09.2020, at 15:04, Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de> wrote:<br>> <br>> Hi Tobias,<br>> <br>> > Also, I don't see how two font refs can ever be stacked, it makes not much sense, no?<br>> <br>> 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 ...<br><br>That is true. But if you want to change the font, there's only so much you can do.<br>If you want just change an upright font to an italic one, the FontReference will not work in any case.<br>The TextFontChange attribute is seemingly intended for that, but it only understands "Font array indices" which is most unhelpful :D<br><br>Best regards<br>   -Tobias<br><br><br>> <br>> Best,<br>> Christoph<br>> <br>> Von: Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Tobias Pape <das.linux@gmx.de><br>> Gesendet: Donnerstag, 3. September 2020 00:13:24<br>> An: The general-purpose Squeak developers list<br>> Betreff: Re: [squeak-dev] Inspector Custom Value Panes & Related<br>>  <br>> <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></christoph.thiede@student.hpi.uni-potsdam.de></eric.gade@gmail.com></squeak-dev-bounces@lists.squeakfoundation.org></christoph.thiede@student.hpi.uni-potsdam.de></das.linux@gmx.de></squeak-dev-bounces@lists.squeakfoundation.org></christoph.thiede@student.hpi.uni-potsdam.de></das.linux@gmx.de></squeak-dev-bounces@lists.squeakfoundation.org></christoph.thiede@student.hpi.uni-potsdam.de></div></blockquote>
                                        
                                        </div></div></div>