Anyone got ANY idea wtf is going on

Maybe it’s just me, but it seems to me that since the change to Xojo, that has been more and more the case.

  • Karen
1 Like

I’d say its what happens when you focus on adding bells & whistles and not maintaining the abstractions adequately

Leaky abstractions - they let platform specific details leak through and then end users HAVE to deal with them even if there is sufficient information to do so

Like where I’m at with Fonts :frowning:

2 Likes

Because that’s what the marketing team wrote, but not what Geoff cares about it. At this point in time, Xojo isn’t a customer orientated company, it’s a Geoff orientated companys, and if your goals align with Geoff’s ideas, that’s great. If not, you are pretty much SOL from Xojo.

I learned the hard way that going against the grain and fighting the Xojo framework, only hurts yourself. If Geoff cared about the product, customers and the community, things would go a lot smoother, but it is what it is.

Reducing your dependency on one man’s vision, will probably make life easier for you in the end.

3 Likes

indeed - why I’ve been writing more & more C# since its relatively portable
yet I can still write fully native macOS apps (which makes me happy)
and android apps and web apps and …
might not be one project to do all that but a lot of code is much more portable between them and its dead easy to reuse code from one project in another

1 Like

Damn
I tried both using a picture that should draw using GDI and one that didnt
And I still get horribly inconsistent results with fonts selected using Xojo’s font functions

Fonts like Roman still misbehave :frowning:

I cant see what, if anything, I’ve done wrong with the info from the post
Here’s my sample project

I don’t think switching to an old mask based pictures forces Xojo to use GDI drawing.

You could see if the MBS DrawRotatedTextMBS function works with those fonts (passing 0 as the rotation). If it does you could then ask Christian if it is using the GDI+ text APIs or GDI text APIs.

My gut feeling is that you are going to have to implement the GDI+ and GDI text functions and call those or DrawString depending on the font type.

Many years ago when RealBasic only support GDI, we implemented GDI+ font support via the Advanced Graphics For Windows RB project (can’t remember the author now). We supported both by first trying to draw the text via GDI+ and falling back to RB GDI based DrawString if we couldn’t get a GDI+ handle for the font.

As with most RB things Windows, IIRC the author was Aaron Ballman

-Karen

2 Likes

Given the post Jurg referred to from Xojo it supposedly did at one time
I dont/didnt recall that
but it seems to not work now or I’m doing something wrong in my simple app using these odd ball fonts

I got the impression that it still used GDI+ but merged / flattened the alpha component when drawing the text.

I thought the only way to use the original GDI was via the Win32 APIs.

I think its supposed to use a GDI compatible renderer

But either way I tried with the picture certain fonts fail in a canvas (or picture) but work in a text area :frowning:

arg !

I found that the font name is not always what the windows registered font name is, not sure this is the issue as I guess your using same name for both but maybe worth checking the properties of the font file to get the actual registered font name. I had to write a TTF decoder to get actual font names so I could register them.

Roman is FontType RASTER_FONTTYPE [1] rather than TRUETYPE_FONTTYPE [4] which is why my PureBasic code above filters it out.

IF TrueType fonts always work I think filtering the list of fonts is going to be your easiest workaround.

I can create a *.dll for you if it helps.

All the Xojo font names work in the text area
That includes Raster & True Type / Open Type

And I exclude the ones whose names start with @ as thats a font that used for vertical print (which is not always the same as the horizontal font)
That part is easy

What isnt is getting the Canvas / Picture to also use those fonts

I do have code to filter out the fonts by type
And it does seem that True Type fonts work in both

That may be what I end up doing as I cant make canvas / picture drawing mimic the text area as is
Drawinto very likely would - but I haven’t gone that route
Yet :slight_smile:

Is there such a thing as NSAttributedString on Windows?

On the Mac you could take it from the NSTextView (TextArea) and then draw it yourself into the canvas with declares.

Or of course generate the NSAttributedString via code and then draw it via declares.

Not that I know of

In my set up there is no text area at all - its just there for comparison purposes

:frowning:

I think I need to just come up with a couple functions

    FontWorksInTextArea( xojoFontName as string ) as boolean

    FontWorksInCanvas( xojoFontName as string ) as boolean

and NOT show those fonts that dont work in both

1 Like