Contents

preferredFont(forTextStyle:options:)

Returns the font associated with the text style.

Declaration

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

Parameters

  • style:

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

  • options:

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

Return Value

The font associated with the text style.

See Also

Creating System Fonts