If your application is a font utility or other application that manages fonts, you may need to notify ATS for Fonts of your actions by calling the function ATSFontNotify. Other applications can sign up to receive notifications of your actions by calling the function ATSFontNotificationSubscribe. When you call the function ATSFontNotify, ATS for Fonts notifies all subscribers of your actions.
When you call the function ATSFontNotify you must supply a notification action (ATSFontNotifyAction). If your application activates or deactivates fonts, you should pass kATSFontNotifyActionFontsChanged. If your application makes changes to a font directory, you should pass the constant kATSFontNotifyActionDirectoriesChanged. You can also optionally supply a pointer to the data you want ATS for Fonts to pass to the applications who subscribe to notifications. You can pass NULL if there is no data associated with your action.
It’s best to call the function ATSFontNotify after your application makes a batch of changes rather than calling this function after each change you make. For example, if your application calls the functions ATSFontActivateFromFileSpecification (Mac OS X v10.4 and earlier), ATSFontActivateFromFileReference (Mac OS X v10.5 and later), or ATSFontDeactivate multiple times to activate and deactivate fonts, you can set the iOptions parameter in these functions to kATSOptionFlagsDoNotNotify set. When you are done activating and deactivating fonts you can call the function ATSFontNotify with the action parameter set to kATSFontNotifyActionFontsChanged. Then ATS notifies all applications who subscribe to notifications of the changes you made.
Last updated: 2007-12-11