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 Font method:
[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?
[/quote]
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.
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.
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).
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.