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

# NSFont.TextStyle

Constants that specify the preferred text styles you use with fonts.

```
struct TextStyle
```

## Discussion

Pass these constants to [`preferredFont(forTextStyle:options:)`](/documentation/AppKit/NSFont/preferredFont(forTextStyle:options:)) or [`preferredFontDescriptor(forTextStyle:options:)`](/documentation/AppKit/NSFontDescriptor/preferredFontDescriptor(forTextStyle:options:)) to retrieve the corresponding font or font descriptor.

## Topics

### Constants

[`NSFontTextStyleBody`](/documentation/AppKit/NSFont/TextStyle/body)

The font you use for body text.

[`NSFontTextStyleCallout`](/documentation/AppKit/NSFont/TextStyle/callout)

The font you use for callouts.

[`NSFontTextStyleCaption1`](/documentation/AppKit/NSFont/TextStyle/caption1)

The font you use for standard captions.

[`NSFontTextStyleCaption2`](/documentation/AppKit/NSFont/TextStyle/caption2)

The font you use for alternate captions.

[`NSFontTextStyleFootnote`](/documentation/AppKit/NSFont/TextStyle/footnote)

The font you use in footnotes.

[`NSFontTextStyleHeadline`](/documentation/AppKit/NSFont/TextStyle/headline)

The font you use for headings.

[`NSFontTextStyleSubheadline`](/documentation/AppKit/NSFont/TextStyle/subheadline)

The font you use for subheadings.

[`NSFontTextStyleLargeTitle`](/documentation/AppKit/NSFont/TextStyle/largeTitle)

The font you use for large titles.

[`NSFontTextStyleTitle1`](/documentation/AppKit/NSFont/TextStyle/title1)

The font you use for first-level hierarchical headings.

[`NSFontTextStyleTitle2`](/documentation/AppKit/NSFont/TextStyle/title2)

The font you use for second-level hierarchical headings.

[`NSFontTextStyleTitle3`](/documentation/AppKit/NSFont/TextStyle/title3)

The font you use for third-level hierarchical headings.

### Initializers

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

Creates a new instance with the specified raw value.

## Relationships

### Conforms To

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

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

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

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

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

---

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)