Contents

preferredFontDescriptor(forTextStyle:options:)

Returns a font descriptor that contains the text style.

Declaration

class func preferredFontDescriptor(forTextStyle style: NSFont.TextStyle, options: [NSFont.TextStyleOptionKey : Any] = [:]) -> NSFontDescriptor

Parameters

  • style:

    The text style for which to return a font descriptor. See Textstyle for available values.

  • options:

    A dictionary you use to further configure the returned font descriptor. See Textstyleoptionkey for a list of valid keys. Pass an empty dictionary to use the default configuration.

Return Value

The font descriptor that contains the text style.

Discussion

The font descriptor contains a dictionary of attributes that you use to create an NSFont object. See NSFontDescriptor for more information.

See Also

Creating a Font Descriptor