Such a basic question but I was unable to find anything from the docs or the search here. When listing all of the system fonts on Cocoa, is there really no way to get the actual font names for a font family without using MBS?
Here’s what it says in the docs in regards to the
The only place I’ve found anything about listing the actual font names was via MBS here:
Do we really need to use MBS just to list out the system’s available fonts in Cocoa, or am I missing something somewhere?
you can of course make declares to NSFont class in Cocoa. But I would rather suggest you just get a Cocoa plugin license.
[quote=47617:@Tom I.]Such a basic question but I was unable to find anything from the docs or the search here. When listing all of the system fonts on Cocoa, is there really no way to get the actual font names for a font family without using MBS?
When making the transition from Carbon to Cocoa we made the Cocoa function duplicate what Carbon did - and it only reported the family name not the name of each variant in the family.
Cocoa does the same so we didn’t silently break peoples projects.
I’d take a look at MacOSLib & see if it’s NSFont functionality lets you do what you want
Until now, I thought that setting a font to Bold or Italic when the variant did not exist would not stay True. But unfortunately Xojo returns True even if the font is unable to display the style. Seems odd…
Carbon did a great deal under the hood and if a font had a bold or italic variant it would use it instead of synthesizing anything.
If not it would synthesize things so that it would appear you had a bold or italic variant even though it does not exist in the actual font family (hence why some fonts looked nicer in italic than others)
But you were not aware that it had done so.
So in Carbon you could make any font bold, italic etc.
Cocoa does NOT do that
Norman is right. I filled a feedback case to apple long ago so they add it to Cocoa, but nothing seen so far.
Have had the MBS plugin for year and appreciate your work, Christian! I’ve already solved the issue using MBS, I was just very surprised that the system’s full list of fonts couldn’t be listed without using a plugin.
Norman wrote (and he was right):
Carbon did a great deal under the hood and if a font had a bold or italic variant it would use it
instead of synthesizing anything.
That is what MacOS do all these years. That broke when Cocoa was released.
In other words, in the old times, you can ask for a style (bold, italic, etc.) and get it even when you do not have the specifically styled font. Even when printing to a PostScript laser printer (who had these styled fonts), the transformation was done. It always was better to have the styled font screen to get better results.
NOW: say with Cocoa, the rules changed: you have to have the styled fonts (My Font.Italic for example) to get the style(s).
The Times They Are a-Changing
Right, and that’s fine that it’s a limitation/requirement of Cocoa. It just makes it especially confusing then that you cannot access the names of the styled fonts without a plugin.