Retired Document
Important: This document is deprecated. Please see Cocoa Text Architecture Guide for information about font handling in the Cocoa text system.
Creating a Font Manager
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.
Copyright © 1997, 2012 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2012-07-23