How to get a GLMRubricTextPresentation with StandardFonts codeFont ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get a GLMRubricTextPresentation with StandardFonts codeFont ?

Johan Fabry
Hi all,

I posted a question like this a week ago but had no response, so here we go, more explicitly:

I would like a  get a GLMRubricTextPresentation using the StandardFonts codeFont. I do not see how to configure this. The text is not ST so I cannot use the different ST presentations that are available.

I have been looking for some time now, but cannot see a solution. Can anybody help me out?

--
Johan Fabry,  Senior Software Engineer. 
[hidden email] | Email too brief? Here's why! http://emailcharter.org

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to get a GLMRubricTextPresentation with StandardFonts codeFont ?

Tudor Girba-2
Hi,

The font is not settable in the text presentation. You can either create a subclass of text presentation, or extend the existing one. In both cases, you would need to change the morphic renderer as well.

Doru

> On Apr 11, 2018, at 11:48 AM, Johan Fabry <[hidden email]> wrote:
>
> Hi all,
>
> I posted a question like this a week ago but had no response, so here we go, more explicitly:
>
> I would like a  get a GLMRubricTextPresentation using the StandardFonts codeFont. I do not see how to configure this. The text is not ST so I cannot use the different ST presentations that are available.
>
> I have been looking for some time now, but cannot see a solution. Can anybody help me out?
>
> --
> Johan Fabry,  Senior Software Engineer.
> [hidden email] | Email too brief? Here's why! http://emailcharter.org
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.list.inf.unibe.ch/listinfo/moose-dev

--
www.tudorgirba.com
www.feenk.com

“Software has no shape. Actually, it has no one shape. It has many."

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to get a GLMRubricTextPresentation with StandardFonts codeFont ?

Johan Fabry
Hi Doru, all,

thanks for the hint. I searched around some and hacked up a solution. I leave it below for posterity.

After remembering all the flak that Spec got for how hard it is to understand and configure and complexity that seems spurious, I am a bit saddened to find that GT also can be accused of these things. It was much harder for me than I expected to, to get to the bits of code below. In general, I still have no clue how all these presentation things and renderers actually work together, and in specific there is a double dispatch using e.g. renderPharoMethodPresentation: or renderPharoScriptPresentation: that I don't understand its reason for existence.

Whatever>>gtInspectorSourceFragmentIn: composite

        <gtInspectorPresentationOrder: -2>
        ^(composite custom: RCFixedTextPresentation new)
                title: 'Fixed width';
                display: [asdf]

GLMRubricTextPresentation subclass: #RCFixedTextPresentation
        instanceVariableNames: ''
        classVariableNames: ''
        package: 'XXX'

RCFixedTextPresentation >>renderGlamorouslyOn: aRenderer
        self registerAnnouncements.
        ^ RCFixedTextRenderer render: self from: aRenderer

GLMMorphicRubricTextRenderer subclass: #RCFixedTextRenderer
        instanceVariableNames: ''
        classVariableNames: ''
        package: 'XXX'

RCFixedTextRenderer>>render: aPresentation
        | result |
        result := super render: aPresentation.
        result textFont: StandardFonts codeFont.
        ^result

--
Johan Fabry,  Senior Software Engineer. 
[hidden email] | Email too brief? Here's why! http://emailcharter.org

> -----Original Message-----
> From: Moose-dev [mailto:[hidden email]] On Behalf Of
> Tudor Girba
> Sent: Wednesday, April 11, 2018 12:05 PM
> To: Moose-related development <[hidden email]>
> Subject: [Moose-dev] Re: How to get a GLMRubricTextPresentation with
> StandardFonts codeFont ?
>
> Hi,
>
> The font is not settable in the text presentation. You can either create a
> subclass of text presentation, or extend the existing one. In both cases, you
> would need to change the morphic renderer as well.
>
> Doru
>
> > On Apr 11, 2018, at 11:48 AM, Johan Fabry <[hidden email]> wrote:
> >
> > Hi all,
> >
> > I posted a question like this a week ago but had no response, so here we go,
> more explicitly:
> >
> > I would like a  get a GLMRubricTextPresentation using the StandardFonts
> codeFont. I do not see how to configure this. The text is not ST so I cannot use
> the different ST presentations that are available.
> >
> > I have been looking for some time now, but cannot see a solution. Can
> anybody help me out?
> >
> > --
> > Johan Fabry,  Senior Software Engineer.
> > [hidden email] | Email too brief? Here's why! http://emailcharter.org
> >
> > _______________________________________________
> > Moose-dev mailing list
> > [hidden email]
> > https://www.list.inf.unibe.ch/listinfo/moose-dev
>
> --
> www.tudorgirba.com
> www.feenk.com
>
> “Software has no shape. Actually, it has no one shape. It has many."
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.list.inf.unibe.ch/listinfo/moose-dev
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to get a GLMRubricTextPresentation with StandardFonts codeFont ?

Luke Gorrie
Hi John,

I'm also thinking about this again right at the exact same moment :).

The issue for me is that I'd like to apply this to all sorts of presentations e.g. also lists and tables.

How about adding a #fixed property to GLMFormattedPresentation that the user can set and making the existing renderers respect that?

Just now my work-around has been to add a "copy to clipboard" action to all my presentations since they are unreadable in the GUI :-\



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev