site_archiver@lists.apple.com Delivered-To: pro-apps-dev@lists.apple.com Fred, I’m not entirely sure I understand all your needs here. If you just need the font for your own plug-in, you can load it from your plug-in’s bundle in its Fonts directory like this:
NSBundle *bundle = [NSBundle bundleWithIdentifier: @"com.apple.motion.TextFramework"]; NSArray *fontPaths = [bundle pathsForResourcesOfType:nil inDirectory:@"Fonts"]; for (NSString *fontPath in fontPaths) { CFURLRef url = CFURLCreateWithFileSystemPath(NULL, (CFStringRef)fontPath, kCFURLPOSIXPathStyle, false); if (url) { CFErrorRef error = NULL; bool succ = CTFontManagerRegisterFontsForURL(url, kCTFontManagerScopeProcess, &error);
if (!succ) { //Handle the error here } CFRelease(url); } }
That’s the code we use to load custom fonts from Motion’s TextFramework bundle that lives inside the app. (You’ll obviously want to load from your own bundle, not from Motion's TextFramework bundle.) I’m not sure what the implications would be if the plug-in was loaded out-of-process, as we hope to be able to do one day. If you’re just using the fonts for rendering, I think that would be fine. But if the user wants to be able to use the fonts in other ways within the app, they won’t show up in the app’s UI if the plug-in is out-of-process. But of course, that’s not how it works today, so probably not a problem for the near term. Darrin
On Sep 28, 2017, at 12:56 PM, fnelson@clemuniversity.com wrote:
I'm curious as to the recommended method of including fonts with a pluging (especially one that's Motion only). Having an installer install to the user directory's font directory can sometimes pose issues if it's installed somewhere else like the system font directory. Do you recommend compiling a .app just to provide the fonts? Thanks for any suggestions!
Fred _______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/pro-apps-dev/dcardani%40apple.com
This email sent to dcardani@apple.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/pro-apps-dev/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com