Name

NSFontManager — Mac OS X 10.0

Synopsis

This class defines the interface to the system Cocoa uses to coordinate the usage of fonts in an application. Part of NSFontManager’s duty is to keep track of the currently selected font, and manage the interaction between the Font Panel, Font menu, and text-bearing objects. To obtain an application’s Font Manager, use the class method sharedFontManager.

image with no caption

@interface NSFontManager : NSObject
                                  // Accessor Methods
   - (void)setEnabled:(BOOL)flag;
   - (void)setSelectedFont:(NSFont *)fontObj 
                                 isMultiple:(BOOL)flag;
   - (NSFont *)selectedFont;
   - (void)setDelegate:(id)anObject;
   - (id)delegate;
   - (void)setAction:(SEL)aSelector;
   - (SEL)action;
   - (void)setFontMenu:(NSMenu *)newMenu;
                                  // Class Methods
   + (void)setFontManagerFactory:(Class)factoryId;
   + (void)setFontPanelFactory:(Class)factoryId;
   + (NSFontManager *)sharedFontManager;
                                  // Instance Methods
   - (NSString *)localizedNameForFamily:(NSString *)family 
                                 face:(NSString *)faceKey;
   - (void)addFontTrait:(id)sender;
   - (NSArray *)availableFontFamilies;
   - (NSArray *)availableFontNamesWithTraits:(NSFontTraitMask)someTraits;
   - (NSArray *)availableFonts;
   - (NSArray *)availableMembersOfFontFamily:(NSString *)fam;
   - (NSFont *)convertFont:(NSFont *)fontObj;
   - (NSFont *)convertFont:(NSFont *)fontObj 
                                 toFace:(NSString *)typeface;
   - (NSFont *)convertFont:(NSFont *)fontObj ...

Get Cocoa in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.