< Previous PageNext Page > Hide TOC

Creating a Font Panel

In general, you add the facilities of the Font panel to your application, along with the NSFontManager and the Font menu, through which the user opens the Font panel, using Interface Builder. You do this by dragging a Font or Format menu (which contains a Font submenu) into one of your application’s menus. At runtime, the Font panel object is created and hooked into the font conversion system. You can also create (or access) the Font panel using the sharedFontPanel class method.

You can add a custom view object to an NSFontPanel using setAccessoryView, allowing you to add custom controls to the Font panel. You can also limit the fonts displayed (by default, all fonts) by assigning a delegate to the application’s font manager object (see “The Font Panel”).

In Objective-C, if you want the NSFontManager to instantiate the Font panel from some class other than NSFontPanel, use the NSFontManager class method setFontPanelFactory:. See “Converting Fonts Manually” for more information on using the font conversion system.



< Previous PageNext Page > Hide TOC


© 1997, 2004 Apple Computer, Inc. All Rights Reserved. (Last updated: 2004-08-31)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.