The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
using a mac system font in TTF_OpenFont()
jeroen.clarysse


Joined: 22 Feb 2010
Posts: 69
is there a way to pass for instance “Arial” WITHOUT having to include the Arial.ttf in my bundle ?

I would like the users to be able to pick any system font available on their computer

I’ve read as much as I could about NSFontManager and this call :

NSMutableArray * fontList = [[NSMutableArray alloc] initWithArray:[[NSFontManager sharedFontManager] availableFontFamilies]];


gives me a list of available fonts, but simply passing one of these strings to TTF_openFont won’t work since it isn’t a full path. And I have no idea how to figure out where each font of these families is stored (could be /Library/Fonts but also ~/Library/Fonts)

any hints ?


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org