Class

NSFont​Collection

The NSFont​Collection class represents a font collection, that is, a group of font descriptors taken together as a single object. You can publicize the font collection as a named collection and it is presented through the System user interface such as the font panel & Font Book. The queries can be modifed using the NSMutable​Font​Collection subclass.

Symbols

Creating Font Collections

init(descriptors:​ [NSFont​Descriptor])

Returns a font collection matching the given descriptors.

class func with​All​Available​Descriptors()

Returns a font collection matching all registered fonts.

init?(locale:​ Locale)

Returns a collection of fonts matching the given locale.

Naming Font Collections

class func rename(from​Name:​ String, visibility:​ NSFont​Collection​Visibility, to​Name:​ String)

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

class func hide(with​Name:​ String, visibility:​ NSFont​Collection​Visibility)

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

class func all​Font​Collection​Names()

Returns all named collections visible to this process.

init?(name:​ String)

Returns the font collection with the specified name.

init?(name:​ String, visibility:​ NSFont​Collection​Visibility)

Returns the font collection with the specified name and visibility.

Font Collection Descriptor Matching

var matching​Descriptors:​ [NSFont​Descriptor]?

An array of font descriptors matching the logical descriptors.

func matching​Descriptors(for​Family:​ String)

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

func matching​Descriptors(for​Family:​ String, options:​ [String :​ NSNumber]? = nil)

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

func matching​Descriptors(options:​ [String :​ NSNumber]? = nil)

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

var query​Descriptors:​ [NSFont​Descriptor]?

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

var exclusion​Descriptors:​ [NSFont​Descriptor]?

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

Constants

Standard Named Font Collections

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

NSFont​Collection​Visibility

These constants specify the visibility of font collections.

NSFont​Collection​Did​Change​Notification User​Info Keys

These constants are used as keys in the NSFont​Collection​Did​Change user​Info dictionary to indicate the changes that have taken place.

NSFont​Collection​Action Key Values

The following actions are possible values of the NSFont​Collection​Action​Key in the NSFont​Collection​Did​Change user​Info method.

Notifications