Inherits From: NSPanel : NSWindow : NSResponder : NSObject
Conforms To: NSCoding (NSResponder) NSObject (NSObject)
Declared In: AppKit/NSFontPanel.h
The NSFontPanel class declares the programmatic interface to a user-interface object that displays a list of available fonts, enabling users to preview them and change the typefaces in which text is displayed. Actual changes to text are effected through conversion messages sent to the NSFontManager. There is only one NSFontPanel object for each application.
In general, you add the facilities of the NSFontPanel (and of the other components of the font conversion system: the NSFontManager and the Font menu) to your application through interface construction tools (such as Interface Builder). You do this by including a Font menu into one of your application's menus. At runtime, when the user chooses the Font Panel command for the first time, the NSFontPanel object is created and hooked into the font conversion system. You can also create (or access) NSFontPanel through the sharedFontPanel method.
An NSFontPanel can be customized by adding an additional NSView object or hierarchy of NSView objects by using the setAccessoryView: method. If you want the NSFontManager to instantiate a panel object from some class other than NSFontPanel, use the NSFontManager's setFontPanelFactory: method. See NSFontManager for details on the font manager object that performs font conversion tasks.
Creating an NSFontPanel