Cocoa font loading - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Tools & Technology (/forum-10.html)
+--- Thread: Cocoa font loading (/thread-10311.html)
Cocoa font loading - ajrs84 - Sep 19, 2012 09:24 PM
My project targets both iOS and mac osx. I'm trying to embed a true type font using the "fonts provided by application" key in both target's info.plist however, it only works for the iOS version - additionally I tried using ATSApplicationFontsPath for the osx target but no luck either. Any ideas?
RE: Cocoa font loading - SethWillits - Sep 19, 2012 10:23 PM
Did you (for example) set ATSApplicationFontsPath to "Fonts" and then add a Fonts folder into the Resources folder of the application bundle? (Has to be a blue folder in Xcode, not a yellow folder.) Or you can add a custom Copy Files build phase to copy into a Fonts subfolder of Resources and make sure the ttf file is added to that build phase rather than the standard Resources phase.
RE: Cocoa font loading - OneSadCookie - Sep 20, 2012 01:16 PM
ATSApplicationFontsPath is pretty finicky and I'm pretty sure (from memory) not all the cases mentioned in the documentation actually work.
For Extendaword I apparently couldn't make it work at all, and ended up doing this: https://github.com/OneSadCookie/Extendaword/blob/master/Extendaword/main.m