<!--
{
  "availability" : [
    "macOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSFont/TextStyleOptionKey",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@T@NSFontTextStyleOptionKey"
  },
  "title" : "NSFont.TextStyleOptionKey"
}
-->

# NSFont.TextStyleOptionKey

The options that you apply when requesting the font or font descriptor of a preferred text style.

```
struct TextStyleOptionKey
```

## Discussion

Pass a dictionary that contains any combination of these keys and their corresponding values to [`preferredFont(forTextStyle:options:)`](/documentation/AppKit/NSFont/preferredFont(forTextStyle:options:)) or [`preferredFontDescriptor(forTextStyle:options:)`](/documentation/AppKit/NSFontDescriptor/preferredFontDescriptor(forTextStyle:options:)) to further configure the returned font or font descriptor.

## Topics

### Initializers

[`init(rawValue:)`](/documentation/AppKit/NSFont/TextStyleOptionKey/init(rawValue:))

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`Sendable`](/documentation/Swift/Sendable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`Equatable`](/documentation/Swift/Equatable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)