Retina text code for the IDE

just did a search about the retina display for the IDE, found nothing much except you can turn it on in some way, but it’s buggy.

i’m getting tired of this, so questions :

  • how can i turn retina support for the IDE on mac os, even if it’s buggy. maybe if it’s just for the text editor, will be good enough.

  • i’m searching for some methods for editing the code in external retina capable text editor, at least simple text is good enough.

  • the killer question : can we expect retina support in the IDE anytime soon or not ? it’s been quite a while now…

thanks

You can use Retinizer
http://retinizer.mikelpr.com

[quote=136141:@dazz iko]j

  • how can i turn retina support for the IDE on mac os, even if it’s buggy. maybe if it’s just for the text editor, will be good enough.
    [/quote]
    Retinizer

[quote=136141:@dazz iko]j- i’m searching for some methods for editing the code in external retina capable text editor, at least simple text is good enough.
[/quote]
Nothing that integrates with the IDE
It would basically all be cut & paste operations on your part
But if thats what you want to do then use whatever editor you like (textEdit, BBEdit, TextWrangler etc etc etc)

[quote=136141:@dazz iko]j

  • the killer question : can we expect retina support in the IDE anytime soon or not ? it’s been quite a while now…
    [/quote]
    Not sure exactly what this means ?

[quote=136149:@Norman Palardy]@dazz iko j

  • the killer question : can we expect retina support in the IDE anytime soon or not ? it’s been quite a while now…
    Not sure exactly what this means ?[/quote]
    I think the OP wants to know when Xojo will natively support Retina, not just in the IDE but in apps also?

I don’t think there’s been any formal announcement regarding this, so all we can say is that we don’t generally talk about features until they’ve been announced.

Again what does “natively support retina” mean ?
Its a vague statement that really doesn’t say whats missing or perceived to be missing to “natively support retina”.

[quote=136193:@Norman Palardy]Again what does “natively support retina” mean ?
Its a vague statement that really doesn’t say whats missing or perceived to be missing to “natively support retina”.[/quote]

If the title was not for “Retina text code” where apps do show difference is in the ability to display pictures at 144dpi. But for text ?

Text is ALL drawn using platform API’s so there shouldn’t be any non-retina text

Pictures don’t automagically load the right resolution
And there are still a couple bugs (darned if I can find the reports about them)

Xojo can create Retina Apps but Xoxo IDE is not running in Retina itself. I think dazz wanted to know when Xojo IDE will run on Retina…

I agree, I think the op wanted to know when Xojo itself will be retina-fied?
:slight_smile:

A few things need to happen

Pictures - Basically what you have today is 1 picture in a project = 1 picture on disk. You need a way to be able to set up a single Picture with several actual on disk images so the runtime can select the right resolution at runtime and just use it with no other work on your part. In your code you can still refers to “myPicture” but at runtime this might grab, on a retina screen, myPicture@2x.png, on a non-retina screen myPicture.png.
So there’s framework changes that have to happen to make that work and NOT break existing projects.
And changes in the IDE to make it so you can set up that one image with all the various representations needed.

And the few bugs that exist in the IDE will also affect your apps because the IDE IS just a Xojo app.
Darned if I can find those reports though.

As far as I know once those things are done that should be the entire list and we can set the retina enabled flag on the IDE
And you can do that for your apps too.
The thought here is if we can do that for the IDE then users can do that in their projects as well.
We “eat our own dog food” so to speak.

Maybe the guy mentioned text since the IDE editor is canbas based, so obviously does not display at 144 dpi for reasons said above for pictures, when text controls using font display do use the full resolution ?

It uses drawstring which does draw at correct retina resolutions
However since the IDE does not have the rein ate flag set it will not do that
And we don’t want to set that on until we deal with the issues I’ve mentioned

Ah there’s some of the bugs you can encounter
<https://xojo.com/issue/31776>
<https://xojo.com/issue/27871>

Search for retina in Feedback and you’ll see several cases

Mmm just thinking about the question if these bugs will become obsolete when you switch to AutoLayout completely?

I can see how Pictures would be an issue, basing on guess work it seems to me that the Xojo graphics class uses a CGBitmapContext, where as to draw onto a NSImage (which is how it’s done in Obj-C), you have to use separate NSObjects to draw the elements and then OS will handle Retina (or not).

That would take quite a bit of work to do, to alter the graphics class to use NSObjects when drawing to a NSImage, I also find NSDrawing weird, having to lock the context first so that the global ‘currentContext’ is pointing to where you want as opposed to CG, where you explicitly state which context each command is drawing to.

In my Retina enabled Apps I am looking for the OS ScalingFactor first using a Function:

Soft Declare Function BackingScaleFactor Lib "AppKit" Selector "backingScaleFactor" (target As WindowPtr) As Double

with this function I can access each canvas or Toolbutton with another function like this assuming that you have an standard Icon (here: external32) and another one in x2 Resolution:

[code]dim sf as Single = ScalingFactor

For i = 0 to TOOLBAR_Main1.Count
t = TOOLBAR_Main1.Item(i)
if ToolButton(t).Name = “tbNewLease” then ToolButton(t).Icon = if(sf > 1, external32x2, external32)

next
[/code]

it works pretty well without known glitches…

If Xojo could find a more efficient method for this (e.g. finding the right scalingfactor and assigning the correct graphics automatically) it would be great!

Erm, yeah don’t use this function. It’s been covered before (in many Retina threads), even Apple advise against using this function. There’s a feedback report for removing this example from the Xojo documents.

Xojo may not, but using NSImage via either the MBS plugin, MacOSLib or the Retina Kit, does this the correct way.

Trust me when I say, if you do Retina the right way it saves a lot of headaches down the road.

oh… missed that… thank you Sam!