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.
Last updated: 2004-08-31