Mac Developer Library

Developer

AppKit Framework Reference NSMutableFontCollection Class Reference

Options
Deployment Target:

On This Page
Language:

NSMutableFontCollection

NSMutableFontCollection is a dedicated class that represents a mutable collection of fonts. This subclass is used to create a modifiable version of the NSFontCollection class. Using this class allows you to modify the search queries for the font descriptors used by the parent NSFontCollection class.

Inheritance


Import Statement


Swift

import AppKit

Objective-C

@import AppKit;

Availability


Available in OS X v10.7 and later.
  • Creates a list of NSFontDescriptors to match.

    Declaration

    Swift

    var queryDescriptors: [AnyObject]?

    Objective-C

    @property(copy) NSArray *queryDescriptors

    Parameters

    descriptors

    The font descriptors to match.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Edit the query and exclusion arrays by adding the following font descriptors.

    Declaration

    Swift

    func addQueryForDescriptors(_ descriptors: [AnyObject])

    Objective-C

    - (void)addQueryForDescriptors:(NSArray *)descriptors

    Parameters

    descriptors

    The font descriptor to add to the query.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Edit the query and exclusion arrays by removing the following font descriptors..

    Declaration

    Swift

    func removeQueryForDescriptors(_ descriptors: [AnyObject])

    Objective-C

    - (void)removeQueryForDescriptors:(NSArray *)descriptors

    Parameters

    descriptors

    The font descriptor to add to the query.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Set descriptors that are excluded from matching descriptors.

    Declaration

    Swift

    var exclusionDescriptors: [AnyObject]?

    Objective-C

    @property(copy) NSArray *exclusionDescriptors

    Parameters

    descriptors

    An array of font descriptors to exclude from the matchingDecriptors method.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.7 and later.