Inherits from | |
Conforms to | |
Framework | /System/Library/Frameworks/AppKit.framework |
Availability | Available in Mac OS X v10.0 and later. |
Companion guide | |
Declared in | NSFontManager.h |
Related sample code |
NSFontManager
is the center of activity for the font conversion system. It records the currently selected font, updates the Font panel and Font menu to reflect the selected font, initiates font changes, and converts fonts in response to requests from text-bearing objects. In a more prosaic role, NSFontManager
can be queried for the fonts available to the application and for the particular attributes of a font, such as whether it’s condensed or extended.
You normally set up a font manager and the Font menu using Interface Builder. However, you can also do so programmatically by getting the shared font manager instance and having it create the standard Font menu at runtime:
NSFontManager *fontManager = [NSFontManager sharedFontManager]; |
NSMenu *fontMenu = [fontManager fontMenu:YES]; |
You can then add the Font menu to your application’s main menu. Once the Font menu is installed, your application automatically gains the functionality of both the Font menu and the Font panel.
As of Mac OS X version 10.3, font collections are managed by NSFontManager
.
– availableFonts
– availableFontFamilies
– availableFontNamesWithTraits:
– availableMembersOfFontFamily:
– setSelectedFont:isMultiple:
– selectedFont
– isMultiple
– sendAction
– localizedNameForFamily:face:
– addFontTrait:
– removeFontTrait:
– modifyFont:
– modifyFontViaPanel:
– orderFrontStylesPanel:
– orderFrontFontPanel:
– convertFont:
– changeFont:
delegate method
– convertFont:toFace:
– convertFont:toFamily:
– convertFont:toHaveTrait:
– convertFont:toNotHaveTrait:
– convertFont:toSize:
– convertWeight:ofFont:
– currentFontAction
– convertFontTraits:
– setEnabled:
– isEnabled
– fontManager:willIncludeFont:
delegate method
– fontPanel:
– setFontMenu:
– fontMenu:
– availableFontNamesMatchingFontDescriptor:
– collectionNames
– fontDescriptorsInCollection:
– addCollection:options:
– removeCollection:
– addFontDescriptors:toCollection:
– removeFontDescriptor:fromCollection:
Sets the class object used to create the font manager to the given class.
+ (void)setFontManagerFactory:(Class)aClass
The new font manager factory class, which should be a subclass of NSFontManager
.
When the NSFontManager
class object receives a sharedFontManager
message, it creates an instance of aClass, if no instance already exists. Your font manager class should implement init
as its designated initializer. The default font manager factory is NSFontManager
.
This method must be invoked before your application’s main nib file is loaded, such as in the application delegate’s applicationWillFinishLaunching:
method.
NSFontManager.h
Sets the class used to create the Font panel to the given class.
+ (void)setFontPanelFactory:(Class)factoryId
The new font panel factory class, which should be a subclass of NSFontPanel
.
Invoke this method before accessing the Font panel in any way, such as in the application delegate’s applicationWillFinishLaunching:
method.
NSFontManager.h
Returns the shared instance of the font manager for the application, creating it if necessary.
+ (NSFontManager *)sharedFontManager
The shared font manager.
NSFontManager.h
Returns the action sent to the first responder when the user selects a new font from the Font panel or chooses a command from the Font menu.
- (SEL)action
The selector for the action.
The default action is changeFont:
.
NSFontManager.h
Adds a specified font collection to the font manager with a given set of options.
- (BOOL)addCollection:(NSString *)collectionName options:(NSInteger)collectionOptions
The collection to add.
The option described in “Font Collection Mask”
. This option is not yet implemented.
YES
if the font collection was successfully added; otherwise, NO
.
NSFontManager.h
Adds an array of font descriptors to the specified font collection.
- (void)addFontDescriptors:(NSArray *)descriptors toCollection:(NSString *)collectionName
The font descriptors to add.
The font collection to which descriptors are added.
NSFontManager.h
This action method causes the receiver to send its action message up the responder chain.
- (void)addFontTrait:(id)sender
The control that sent the message.
By default, the action message is changeFont:
.
When a responder replies by providing a font to convert in a convertFont:
message, the receiver converts the font by adding the trait specified by sender. This trait is determined by sending a tag
message to sender and interpreting it as a font trait mask for a convertFont:toHaveTrait:
message.
NSFontManager.h
Returns the names of the font families available in the system.
- (NSArray *)availableFontFamilies
The names of the available font families.
These fonts are in various system font directories.
NSFontManager.h
Returns the names of the fonts that match the attributes in the given font descriptor.
- (NSArray *)availableFontNamesMatchingFontDescriptor:(NSFontDescriptor *)descriptor
The font descriptor whose attributes are matched.
The names of the matching fonts.
NSFontManager.h
Returns the names of the fonts available in the system whose traits are described exactly by the given font trait mask (not the NSFont
objects themselves).
- (NSArray *)availableFontNamesWithTraits:(NSFontTraitMask)fontTraitMask
The font traits for which to return font names. You specify the desired traits by combining the font trait mask values described in “Constants” using the C bitwise OR operator.
The names of the corresponding fonts.
These fonts are in various system font directories.
If fontTraitMask is 0, this method returns all fonts that are neither italic nor bold. This result is the same one you’d get if fontTraitMask were NSUnitalicFontMask
|
NSUnboldFontMask
.
NSFontManager.h
Returns the names of the fonts available in the system (not the NSFont
objects themselves).
- (NSArray *)availableFonts
The names of the available fonts.
These fonts are in various system font directories.
NSFontManager.h
Returns an array with one entry for each available member of a font family.
- (NSArray *)availableMembersOfFontFamily:(NSString *)family
The name of a font family, like one that availableFontFamilies
returns.
The available members of family. See the following discussion for a specific description.
Each entry of the returned NSArray
is another NSArray
with four members, as follows:
0. The PostScript font name, as an NSString
object.
1. The part of the font name used in the font panel that’s not the font name, as an NSString
object. This value is not localized—for example, "Roman"
, "Italic"
, or "Bold"
.
2. The font’s weight, as an NSNumber
.
3. The font’s traits, as an NSNumber
.
The members of the family are arranged in the font panel order (narrowest to widest, lightest to boldest, plain to italic).
For example, if you call availableMembersOfFontFamily:@"Times"
, it might return an array like this:
(("Times-Roman", "Roman", 5, 4), |
("Times-Italic", "Italic", 6, 5), |
("Times-Bold", "Bold", 9, 2), |
("Times-BoldItalic", "Bold Italic", 9, 3) |
) |
NSFontManager.h
Returns the names of the currently loaded font collections.
- (NSArray *)collectionNames
The names of the current font collections.
NSFontManager.h
Converts attributes in response to an object initiating an attribute change, typically the Font panel or Font menu.
- (NSDictionary *)convertAttributes:(NSDictionary *)attributes
The current attributes.
The converted attributes, or attributes itself if the conversion isn’t possible.
Attributes unused by the sender should not be changed or removed.
This method is usually invoked on the sender of changeAttributes:
. See NSTextView for more information.
NSFontManager.h
Converts the given font according to the object that initiated a font change, typically the Font panel or Font menu.
- (NSFont *)convertFont:(NSFont *)aFont
The font to convert.
The converted font, or aFont itself if the conversion isn’t possible.
This method is invoked in response to an action message such as addFontTrait:
or modifyFontViaPanel:
. These initiating methods cause the font manager to query the sender for the action to take and the traits to change. See “Converting Fonts Manually” for more information.
– convertFont:toFace:
– convertFont:toFamily:
– convertFont:toHaveTrait:
– convertFont:toNotHaveTrait:
– convertFont:toSize:
– convertWeight:ofFont:
NSFontManager.h
Returns a font whose traits are as similar as possible to those of the given font except for the typeface, which is changed to the given typeface.
- (NSFont *)convertFont:(NSFont *)aFont toFace:(NSString *)typeface
The font whose traits are matched.
The new typeface; a fully specified family-face name, such as Helvetica-BoldOblique or Times-Roman.
A font with matching traits and the given typeface, or aFont if it can’t be converted.
This method attempts to match the weight and posture of aFont as closely as possible. Italic is mapped to Oblique, for example. Weights are mapped based on an approximate numeric scale of 0 to 15.
– convertFont:toFamily:
– convertFont:toHaveTrait:
– convertFont:toNotHaveTrait:
– convertFont:toSize:
– convertWeight:ofFont:
– convertFont:
NSFontManager.h
Returns a font whose traits are as similar as possible to those of the given font except for the font family, which is changed to the given family.
- (NSFont *)convertFont:(NSFont *)aFont toFamily:(NSString *)family
The font whose traits are matched.
The new font famliy; a generic font name, such as Helvetica or Times.
A font with matching traits and the given family, or aFont if it can’t be converted.
This method attempts to match the weight and posture of aFont as closely as possible. Italic is mapped to Oblique, for example. Weights are mapped based on an approximate numeric scale of 0 to 15.
– convertFont:toFace:
– convertFont:toHaveTrait:
– convertFont:toNotHaveTrait:
– convertFont:toSize:
– convertWeight:ofFont:
– convertFont:
NSFontManager.h
Returns a font whose traits are the same as those of the given font, except that the traits are changed to include the single specified trait.
- (NSFont *)convertFont:(NSFont *)aFont toHaveTrait:(NSFontTraitMask)fontTrait
The font whose traits are matched.
The new trait; may be any one of the traits described in “Constants.” Using NSUnboldFontMask
or NSUnitalicFontMask
removes the bold or italic trait, respectively.
A font with matching traits including the given trait, or aFont if it can’t be converted.
Using NSUnboldFontMask
or NSUnitalicFontMask
removes the bold or italic trait, respectively.
– convertFont:toNotHaveTrait:
– convertFont:toFace:
– convertFont:toFamily:
– convertFont:toSize:
– convertWeight:ofFont:
– convertFont:
NSFontManager.h
Returns an NSFont
object with the same traits as the given font, except for the traits in the given font trait mask, which are removed.
- (NSFont *)convertFont:(NSFont *)aFont toNotHaveTrait:(NSFontTraitMask)fontTraitMask
The font whose traits are matched.
The mask for the traits to remove, created using the C bitwise OR operator to combine the traits described in “Constants.” Using NSUnboldFontMask
or NSUnitalicFontMask
removes the bold or italic trait, respectively.
A font with matching traits minus the given traits, or aFont if it can’t be converted.
– convertFont:toHaveTrait:
– convertFont:toFace:
– convertFont:toFamily:
– convertFont:toSize:
– convertWeight:ofFont:
– convertFont:
NSFontManager.h
Returns an NSFont
object whose traits are the same as those of the given font, except for the size, which is changed to the given size.
- (NSFont *)convertFont:(NSFont *)aFont toSize:(CGFloat)size
The font whose traits are matched.
The new font size.
A font with matching traits except in the new size, or aFont if it can’t be converted.
– convertFont:toFace:
– convertFont:toFamily:
– convertFont:toHaveTrait:
– convertFont:toNotHaveTrait:
– convertWeight:ofFont:
– convertFont:
NSFontManager.h
Converts font traits to a new traits mask value.
- (NSFontTraitMask)convertFontTraits:(NSFontTraitMask)traits
The current font traits.
The new traits mask value to be used by convertFont:
.
This method is intended to be invoked to query the font traits while the action message (usually changeFont:
) is being invoked when the current font action is either NSAddTraitFontAction
or NSRemoveTraitFontAction
.
NSFontManager.h
Returns an NSFont
object whose weight is greater or lesser than that of the given font, if possible.
- (NSFont *)convertWeight:(BOOL)increaseFlag ofFont:(NSFont *)aFont
If YES
, a heavier font is returned; if it’s NO
, a lighter font is returned.
The font whose weight is increased or decreased.
A font with matching traits except for the new weight, or aFont if it can’t be converted.
Weights are graded along the following scale. The list on the left gives Apple’s terminology, and the list on the right gives the ISO equivalents. Names on the same line are treated as identical:
Apple Terminology |
ISO Equivalent |
---|---|
1. ultralight |
|
2. thin |
W1. ultralight |
3. light, extralight |
W2. extralight |
4. book |
W3. light |
5. regular, plain, display, roman |
W4. semilight |
6. medium |
W5. medium |
7. demi, demibold |
|
8. semi, semibold |
W6. semibold |
9. bold |
W7. bold |
10. extra, extrabold |
W8. extrabold |
11. heavy, heavyface |
|
12. black, super |
W9. ultrabold |
13. ultra, ultrablack, fat |
|
14. extrablack, obese, nord |
The NSFontManager
implementation of this method refuses to convert a font’s weight if it can’t maintain all other traits, such as italic and condensed. You might wish to override this method to allow a looser interpretation of weight conversion.
– convertFont:toFace:
– convertFont:toFamily:
– convertFont:toHaveTrait:
– convertFont:toNotHaveTrait:
– convertFont:toSize:
– convertFont:
NSFontManager.h
Returns the current font conversion action.
- (NSFontAction)currentFontAction
The current font action used by the convertFont:
method.
This method is intended to be invoked to query the font conversion action while the action message (usually changeFont:
) is being invoked.
NSFontManager.h
Returns the receiver’s delegate.
- (id)delegate
The receiver’s delegate.
NSFontManager.h
Returns an array of the font descriptors in the collection specified by the given collection name.
- (NSArray *)fontDescriptorsInCollection:(NSString *)collectionName
The font collection for which to return descriptors.
The font descriptors.
NSFontManager.h
Returns the menu that’s hooked up to the font conversion system, optionally creating it if necessary.
- (NSMenu *)fontMenu:(BOOL)createFlag
The font conversion system menu.
NSFontManager.h
Indicates whether the given font has all the specified traits.
- (BOOL)fontNamed:(NSString *)typeface hasTraits:(NSFontTraitMask)fontTraitMask
The name of the font.
The font traits to test, specified by combining the font trait mask values described in “Constants” using the C bitwise OR operator.
YES
if the font named typeface has all the traits specified in fontTraitMask; NO
if it doesn’t.
Using NSUnboldFontMask
returns YES
if the font is not bold, NO
otherwise. Using NSUnitalicFontMask
returns YES
if the font is not italic, NO
otherwise.
NSFontManager.h
Returns the application’s shared Font panel object, optionally creating it if necessary.
- (NSFontPanel *)fontPanel:(BOOL)createFlag
The application’s shared Font panel object.
+ sharedFontPanel
(NSFontPanel
)+ sharedFontPanelExists
(NSFontPanel
)+ setFontPanelFactory:
NSFontManager.h
Attempts to load a font with the specified characteristics.
- (NSFont *)fontWithFamily:(NSString *)family traits:(NSFontTraitMask)fontTraitMask weight:(NSInteger)weight size:(CGFloat)size
The generic name of the desired font, such as Times or Helvetica.
The font traits, specified by combining the font trait mask values described in “Constants” using the C bitwise OR operator. Using NSUnboldFontMask
or NSUnitalicFontMask
loads a font that doesn’t have either the bold or italic trait, respectively.
A hint for the weight desired, on a scale of 0 to 15: a value of 5 indicates a normal or book weight, and 9 or more a bold or heavier weight. The weight is ignored if fontTraitMask includes NSBoldFontMask
.
The point size of the desired font.
A font with the specified characteristics if successful, or nil
if not.
NSFontManager.h
Indicates whether the font conversion system’s user interface items (the Font panel and Font menu items) are enabled.
- (BOOL)isEnabled
YES
if the font conversion system’s user interface items (the Font panel and Font menu items) are enabled; NO
if they’re not.
– isEnabled
(NSFontPanel)– isEnabled
(NSMenuItem)– setEnabled:
NSFontManager.h
Indicates whether the last font selection recorded has multiple fonts.
- (BOOL)isMultiple
YES
if the last font selection recorded has multiple fonts; NO
if it’s a single font.
NSFontManager.h
Returns a localized string with the name of the specified font family and face, if one exists.
- (NSString *)localizedNameForFamily:(NSString *)family face:(NSString *)face
The font family, for example, @"Times"
.
The font face, for example, @"Roman"
.
A localized string with the name of the specified font family and face, or, if face is nil
, the font family only.
The user’s locale is determined from the user’s NSLanguages
default setting. The method also loads the localized strings for the font, if they aren’t already loaded.
NSFontManager.h
This action method causes the receiver to send its action message up the responder chain.
- (void)modifyFont:(id)sender
The control that sent the message.
By default, the action message is changeFont:
.
When a responder replies by providing a font to convert in a convertFont:
message, the receiver converts the font in the manner specified by sender. The conversion is determined by sending a tag
message to sender and invoking a corresponding method:
Sender’s Tag |
Method Used |
---|---|
None; the font is returned unchanged. |
|
The Font panel’s |
|
NSFontManager.h
This action method causes the receiver to send its action message up the responder chain.
- (void)modifyFontViaPanel:(id)sender
The control that sent the message.
By default, the action message is changeFont:
.
When a responder replies by providing a font to convert in a convertFont:
message, the receiver converts the font by sending a panelConvertFont:
message to the Font panel. The panel in turn may send convertFont:toFamily:
, convertFont:toHaveTrait:
, and other specific conversion methods to make its change.
NSFontManager.h
This action method opens the Font panel by sending it an orderFront:
message, creating the Font panel if necessary.
- (void)orderFrontFontPanel:(id)sender
The control that sent the message.
NSFontManager.h
This action method opens the Font styles panel.
- (void)orderFrontStylesPanel:(id)sender
The control that sent the message.
NSFontManager.h
Removes the specified font collection.
- (BOOL)removeCollection:(NSString *)collectionName
The collection to remove.
YES
if the font collection was successfully removed; otherwise, NO
.
NSFontManager.h
Removes the specified font descriptor from the specified collection.
- (void)removeFontDescriptor:(NSFontDescriptor *)descriptor fromCollection:(NSString *)collection
The font descriptor to remove.
The font collection from which to remove the descriptor.
NSFontManager.h
This action method causes the receiver to send its action message up the responder chain.
- (void)removeFontTrait:(id)sender
The control that sent the message.
By default, the action message is changeFont:
.
When a responder replies by providing a font to convert in a convertFont:
message, the receiver converts the font by removing the trait specified by sender. This trait is determined by sending a tag
message to sender and interpreting it as a font trait mask for a convertFont:toNotHaveTrait:
message.
NSFontManager.h
Returns the last font recorded.
- (NSFont *)selectedFont
The last font recorded with a setSelectedFont:isMultiple:
message
While fonts are being converted in response to a convertFont:
message, you can determine the font selected in the Font panel like this:
NSFontManager *fontManager = [NSFontManager sharedFontManager]; |
panelFont = [fontManager convertFont:[fontManager selectedFont]]; |
NSFontManager.h
Sends the receiver’s action message up the responder chain, initiating a font change for whatever conversion and trait to change were last requested.
- (BOOL)sendAction
YES
if some object handled the changeFont:
message; NO
if the message went unheard.
By default, the receiver’s action message is changeFont:
.
This method is used internally by the font conversion system. You should never need to invoke it directly. Instead, use the action methods such as addFontTrait:
or modifyFontViaPanel:
.
NSFontManager.h
Sets the action that’s sent to the first responder, when the user selects a new font from the Font panel or chooses a command from the Font menu, to the given selector.
- (void)setAction:(SEL)aSelector
The selector to set.
The default action is changeFont:
. You should rarely need to change this setting.
NSFontManager.h
Sets the receiver’s delegate to the given object.
- (void)setDelegate:(id)anObject
The new delegate.
NSFontManager.h
Controls whether the font conversion system’s user interface items (the Font panel and Font menu items) are enabled.
- (void)setEnabled:(BOOL)flag
– setEnabled:
(NSFontPanel)– isEnabled
NSFontManager.h
Records the given menu as the application’s Font menu.
- (void)setFontMenu:(NSMenu *)aMenu
The new Font menu.
NSFontManager.h
Informs the paragraph and character formatting panels when text in a selection has changed attributes.
- (void)setSelectedAttributes:(NSDictionary *)attributes isMultiple:(BOOL)flag
The new attributes.
If YES
, informs the panel that multiple fonts or attributes are enclosed within the selection.
This method is used primarily by NSTextView
.
NSFontManager.h
Records the given font as the currently selected font and updates the Font panel to reflect this.
- (void)setSelectedFont:(NSFont *)aFont isMultiple:(BOOL)flag
The font to set as selected.
If YES
, the Font panel indicates that more than one font is contained in the selection; if NO
, it does not.
An object that manipulates fonts should invoke this method whenever it becomes first responder and whenever its selection changes. It shouldn’t invoke this method in the process of handling a changeFont:
message, as this causes the font manager to lose the information necessary to effect the change. After all fonts have been converted, the font manager itself records the new selected font.
NSFontManager.h
Sets the target for the sendAction
method.
- (void)setTarget:(id)aTarget
The target to set.
NSFontManager.h
Returns the target for the sendAction
method.
- (id)target
The target for the receiver’s sendAction
method.
NSFontManager.h
Returns the traits of the given font.
- (NSFontTraitMask)traitsOfFont:(NSFont *)aFont
The font whose traits are returned.
The font traits, returned as a mask created by combining values listed in “Constants” with the C bitwise OR operator.
NSFontManager.h
Returns a rough numeric measure the weight of the given font.
- (NSInteger)weightOfFont:(NSFont *)aFont
The font whose weight is returned.
A rough numeric measure the weight of the given font, where 0 indicates the lightest possible weight, 5 indicates a normal or book weight, and 9 or more indicates a bold or heavier weight.
NSFontManager.h
Informs responders of a font change.
- (void)changeFont:(id)sender
The object that sent the message.
Generally this change is because the user changed the font either in the selection of a rich text field or in a whole plain text field. Any object that contains a font the user can change must respond to the changeFont:
message by sending a convertFont:
message back to sender (an NSFontManager object) for each font in the selection. For more information, see “Responding to Font Changes”.
Be aware that selectedFont
at this point may return unpredictable results. The font returned from this method may not be the last font selected, or there may be multiple fonts selected at the time changeFont:
is called. The use of selectedFont
from within changeFont:
is strongly discouraged.
– addFontTrait:
– convertFont:toHaveTrait:
– convertFont:toFace:
– convertFont:toFamily:
– convertFont:toNotHaveTrait:
– convertFont:toSize:
– convertWeight:ofFont:
– convertFont:
– removeFontTrait:
– modifyFontViaPanel:
– modifyFont:
NSFontManager.h
Requests permission from the Font panel delegate to display the given font name in the Font panel.
- (BOOL)fontManager:(id)theFontManager willIncludeFont:(NSString *)fontName
The font manager making the request.
The full PostScript name of the font to display, such as Helvetica-BoldOblique or Helvetica-Narrow-Bold.
If the Font panel delegate returns YES
, fontName is listed; if the delegate returns NO
, it isn’t.
In Mac OS X versions 10.2 and earlier, this method is invoked repeatedly as necessary whenever the Font panel needs updating, such as when the Font panel is first loaded, and when the user selects a family name to see which typefaces in that family are available. Your implementation should execute fairly quickly to ensure the responsiveness of the Font panel.
NSFontManager.h
This constant specifies options accepted by addCollection:options:
.
enum { NSFontCollectionApplicationOnlyMask = 1 << 0 };
NSFontCollectionApplicationOnlyMask
Makes the collection available only to the application. This option is not yet implemented.
Available in Mac OS X v10.3 and later.
Declared in NSFontManager.h
.
NSFontManager.h
Mask of traits assigned to a font, assigned using the values in Font traits
.
typedef unsigned int NSFontTraitMask;
NSFontManager.h
Font traits defined and supported by NSFontManager
.
enum { NSItalicFontMask = 0x00000001, NSBoldFontMask = 0x00000002, NSUnboldFontMask = 0x00000004, NSNonStandardCharacterSetFontMask = 0x00000008, NSNarrowFontMask = 0x00000010, NSExpandedFontMask = 0x00000020, NSCondensedFontMask = 0x00000040, NSSmallCapsFontMask = 0x00000080, NSPosterFontMask = 0x00000100, NSCompressedFontMask = 0x00000200, NSFixedPitchFontMask = 0x00000400, NSUnitalicFontMask = 0x01000000 };
NSItalicFontMask
A mask that specifies an italic font.
Available in Mac OS X v10.0 and later.
Declared in NSFontManager.h
.
NSBoldFontMask
A mask that specifies a bold font.
Available in Mac OS X v10.0 and later.
Declared in NSFontManager.h
.
NSUnboldFontMask
A mask that specifies a font that is not bold.
Available in Mac OS X v10.0 and later.
Declared in NSFontManager.h
.
NSNonStandardCharacterSetFontMask
A mask that specifies a font that uses a non-standard character set.
Available in Mac OS X v10.0 and later.
Declared in NSFontManager.h
.
NSNarrowFontMask
A mask that specifies a narrow font.
Available in Mac OS X v10.0 and later.
Declared in NSFontManager.h
.
NSExpandedFontMask
A mask that specifies an expanded font.
Available in Mac OS X v10.0 and later.
Declared in NSFontManager.h
.
NSCondensedFontMask
A mask that specifies a condensed font.
Available in Mac OS X v10.0 and later.
Declared in NSFontManager.h
.
NSSmallCapsFontMask
A mask that specifies a small-caps font.
Available in Mac OS X v10.0 and later.
Declared in NSFontManager.h
.
NSPosterFontMask
A mask that specifies a poster-style font.
Available in Mac OS X v10.0 and later.
Declared in NSFontManager.h
.
NSCompressedFontMask
A mask that specifies a compressed font.
Available in Mac OS X v10.0 and later.
Declared in NSFontManager.h
.
NSFixedPitchFontMask
A mask that specifies a fixed pitch font.
Available in Mac OS X v10.0 and later.
Declared in NSFontManager.h
.
NSUnitalicFontMask
A mask that specifies a font that is not italic.
Available in Mac OS X v10.0 and later.
Declared in NSFontManager.h
.
NSFontManager
categorizes fonts according to a small set of traits. You can convert fonts by adding and removing individual traits, and you can get a font with a specific combination of traits.
These pairs of traits are mutually exclusive:
NSFontManager.h
These constants specify what action modifyFont:
will take.
typedef enum _NSFontAction { NSNoFontChangeAction = 0, NSViaPanelFontAction = 1, NSAddTraitFontAction = 2, NSSizeUpFontAction = 3, NSSizeDownFontAction = 4, NSHeavierFontAction = 5, NSLighterFontAction = 6, NSRemoveTraitFontAction = 7 } NSFontAction;
NSNoFontChangeAction
No action; the font is returned unchanged.
Available in Mac OS X v10.0 and later.
Declared in NSFontManager.h
.
NSViaPanelFontAction
Converts the font according to the NSFontPanel
method panelConvertFont:
.
Available in Mac OS X v10.0 and later.
Declared in NSFontManager.h
.
NSAddTraitFontAction
Converts the font to have an additional trait using convertFont:toHaveTrait:
.
Available in Mac OS X v10.0 and later.
Declared in NSFontManager.h
.
NSSizeUpFontAction
Converts the font to a larger size using convertFont:toSize:
.
Available in Mac OS X v10.0 and later.
Declared in NSFontManager.h
.
NSSizeDownFontAction
Converts the font to a smaller size using convertFont:toSize:
.
Available in Mac OS X v10.0 and later.
Declared in NSFontManager.h
.
NSHeavierFontAction
Converts the font to a heavier weight using convertWeight:ofFont:
.
Available in Mac OS X v10.0 and later.
Declared in NSFontManager.h
.
NSLighterFontAction
Converts the font to a lighter weight using convertWeight:ofFont:
.
Available in Mac OS X v10.0 and later.
Declared in NSFontManager.h
.
NSRemoveTraitFontAction
Converts the font to remove a trait using convertFont:toNotHaveTrait:
.
Available in Mac OS X v10.0 and later.
Declared in NSFontManager.h
.
NSFontManager.h
© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-04-06)