You normally set up a font manager and the Font menu using Interface Builder. However, you can also do so programmatically by getting the shared font manager instance and having it create the standard Font menu at runtime, as in this Objective-C example:
NSFontManager *fontManager = [NSFontManager sharedFontManager]; |
NSMenu *fontMenu = [fontManager fontMenu:YES]; |
You can then add the Font menu to your application’s menus. Once the Font menu is installed, your application automatically gains the functionality of both the Font menu and the Font panel.
© 1997, 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-02-08)