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. johan@raincode.com | Email too brief? Here's why! http://emailcharter.org
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 Johan@raincode.com 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. johan@raincode.com | Email too brief? Here's why! http://emailcharter.org
Moose-dev mailing list Moose-dev@list.inf.unibe.ch 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."
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. johan@raincode.com | Email too brief? Here's why! http://emailcharter.org
-----Original Message----- From: Moose-dev [mailto:moose-dev-bounces@list.inf.unibe.ch] On Behalf Of Tudor Girba Sent: Wednesday, April 11, 2018 12:05 PM To: Moose-related development moose-dev@list.inf.unibe.ch 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 Johan@raincode.com 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. johan@raincode.com | Email too brief? Here's why! http://emailcharter.org
Moose-dev mailing list Moose-dev@list.inf.unibe.ch 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 Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev
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 :-\