Graphics.TextFont Questions

In RealStudio Graphics.TextFont could be set to the filename of the font.
It seems in Xojo that is not the case, it needs to be set to the display name of the font.
In this case, I noticed the issue with “MyriadPro-Semibold” not displaying, while “Myriad Pro Semibold” did.
[ macOS and Windows ]

Is there a cross-platform way to set the font by filename in Xojo?
If the font is unavailable, what font is used? System?

Thanks in advance, the documentation on Graphics.TextFont and http://developer.xojo.com/userguide/fonts don’t seem to have the answers I’m looking for.

I haven’t seen this kind of thing in 20 years or so. All common programs use the internal name of the font today. We are talking Dos and Linux command line era.

That said, about Myriad Pro Semibold, it will be seen differently on Mac and Windows. On Mac, the system will recognize Myriad Pro, but Semibold is not a font family, it is a style variation. Under Windows, Myriad Pro Semibold is a font onto itself.

Add to that the fact that fonts have two naming convention inside. A font has internally a Family Name “Myriad Pro”, a style “Semibold”, a PostScript name which cannot have space into it “MyriadPro”, and to make things complete, there is also sometimes an OpenType Name, an OpenType Family Name, and even a Mac name.

The best resource I know of for this kind of details is http://microsoft.com/typography

Maybe I didn’t ask the right question.

In the RealStudio version of the project, “MyriadPro-Semibold” displays the correct font. In Xojo it does not.
Xojo requires it to be “Myriad Pro Semibold”

Is there a way to get Xojo to use the font like RealStudio, where “MyraidPro-Semibold” would use the correct font?

Also, I still need an answer for:

[quote=293084:@Tim Parnell]In RealStudio Graphics.TextFont could be set to the filename of the font.
It seems in Xojo that is not the case, it needs to be set to the display name of the font.
In this case, I noticed the issue with “MyriadPro-Semibold” not displaying, while “Myriad Pro Semibold” did.
[ macOS and Windows ][/quote]
You are right. This is the same as the first cell is 0-based OR 1-based (it depends, you’d better check in the documentation or make a test by yourself.

If Xojo does not defines it, it certainly will be the OS default font (same for the Font Size).