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.

+ fontCollectionWithLocale:

Returns a collection of fonts matching the given locale.

+ fontCollectionWithName:

Creates a named font collection object.

+ fontCollectionWithName:visibility:

Creates a font collection with the specified name and font visibility.

fontCollectionWithAllAvailableDescriptors

The font collection that matches all registered fonts.

Naming the Font Collection

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

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.

NSFontCollectionVisibility

Constants that specify the visibility of font collections.

Getting the Font Descriptors

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 font descriptors taken together as a single object.

NSFontCollectionOptions

Constants that support font collection management.