Class

NSFontCollection

A font collection, which is a group of font descriptors taken together as a single object.

Declaration

@interface NSFontCollection : NSObject

Overview

You can publicize the font collection as a named collection and it is presented through the System user interface such as the font panel and Font Book. The queries can be modified using the NSMutableFontCollection subclass.

Topics

Creating Font Collections

+ fontCollectionWithDescriptors:

Returns a font collection matching the given descriptors.

fontCollectionWithAllAvailableDescriptors

Returns a font collection matching all registered fonts.

+ fontCollectionWithLocale:

Returns a collection of fonts matching the given locale.

Naming Font Collections

+ renameFontCollectionWithName:visibility:toName:error:

Renames the font collection with the specified name and visibility to the second name specified.

+ showFontCollection:withName:visibility:error:

Make the given font collection visible by giving it a name.

+ hideFontCollectionWithName:visibility:error:

Remove from view the named font collection with the specified visibility.

allFontCollectionNames

Returns all named collections visible to this process.

+ fontCollectionWithName:

Returns the font collection with the specified name.

NSFontCollectionName

The constants represent the standard mutable collection names—these names are included in the list of allFontCollectionNames--they have special meaning to the Cocoa font system and should not be hidden or renamed.

+ fontCollectionWithName:visibility:

Returns the font collection with the specified name and visibility.

NSFontCollectionVisibility

Constants that specify the visibility of font collections.

Font Collection Descriptor Matching

matchingDescriptors

An array of font descriptors matching the logical descriptors.

- matchingDescriptorsForFamily:

Returns an array of font descriptors matching the logical descriptors for the given font family.

- matchingDescriptorsForFamily:options:

Returns an array of font descriptors matching the logical descriptors for the given font family and options.

- matchingDescriptorsWithOptions:

Returns an array of font descriptors matching the logical descriptors with the given options.

NSFontCollectionMatchingOptionKey

These constants are used by the matchingDescriptorsWithOptions: and matchingDescriptorsForFamily:options: options dictionary parameters.

queryDescriptors

An array of font descriptors whose matching results produce the collection’s matching descriptors.

exclusionDescriptors

A list of query font descriptors whose matching results are excluded from the list of matching descriptors.

Responding to Changes

NSFontCollectionDidChangeNotification

Posted whenever a font collection is changed.

NSFontCollectionUserInfoKey

These constants are used as keys in the NSFontCollectionDidChangeNotification userInfo dictionary to indicate the changes that have taken place.

NSFontCollectionActionTypeKey

The following actions are possible values of the NSFontCollectionActionKey in the NSFontCollectionDidChangeNotification userInfo method.

Relationships

Inherits From

See Also

Management

NSFontManager

The center of activity for the font conversion system.

NSMutableFontCollection

A mutable collection of fonts used to create a modifiable version of the NSFontCollection class.

NSFontCollectionOptions

Constants that support font collection management.