O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required