I'm investigating some font/typography issues in a creative application. I am hoping for some information from Apple developers who know how font activation works in Core Text, and how/whether auto-activation is still supported.
I'm running on Big Sur in an Obj-C Cocoa app. In applicationDidFinishLaunching
the app calls
CTFontManagerSetAutoActivationSetting(NULL, kCTFontManagerAutoActivationEnabled);
After this, what is the correct API to request auto-activation of a font that may not be active but could be activated, e.g. by a third-party font manager?
I have tried using CTFontCreateWithNameAndOptions.
For options, I see there is an CTFontOption
value
kCTFontOptionsPreventAutoActivation
- I assume that as long as I don't set this option, the call will attempt auto-activation.
However, I don't see any auto-activation resulting, either from the third-party font manager or the OS. Instead CTFontCreateWithNameAndOptions
always returns a substitute font (Helvetica).
The font I am attempting to auto-activate is an OTF. It is stored in a third-party font manager, and I also have copies of it on the desktop. I have also tried having it present / disabled in FontBook, which also does not auto-activate it in this case. I've also cleaned font caches after making changes.
How is the kCTFontManagerAutoActivationEnabled supposed to work in Big Sur? Is there a different Core Text call used to auto-activate a font, or is this behavior no longer supported?
Thanks!
Oh I also tried
CTFontManagerSetAutoActivationSetting(kCTFontManagerBundleIdentifier, kCTFontManagerAutoActivationEnabled);
which is supposed to set "global auto-activation", but no difference in behavior.Also a follow-up: could there be an entitlement needed for auto-activation to work from a Sandboxed app?