---
title: NSFont.TextStyle
framework: appkit
role: symbol
role_heading: Structure
path: appkit/nsfont/textstyle
---

# NSFont.TextStyle

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

## Declaration

```swift
struct TextStyle
```

## Discussion

Discussion Pass these constants to preferredFont(forTextStyle:options:) or preferredFontDescriptor(forTextStyle:options:) to retrieve the corresponding font or font descriptor.

## Topics

### Constants

- [body](appkit/nsfont/textstyle/body.md)
- [callout](appkit/nsfont/textstyle/callout.md)
- [caption1](appkit/nsfont/textstyle/caption1.md)
- [caption2](appkit/nsfont/textstyle/caption2.md)
- [footnote](appkit/nsfont/textstyle/footnote.md)
- [headline](appkit/nsfont/textstyle/headline.md)
- [subheadline](appkit/nsfont/textstyle/subheadline.md)
- [largeTitle](appkit/nsfont/textstyle/largetitle.md)
- [title1](appkit/nsfont/textstyle/title1.md)
- [title2](appkit/nsfont/textstyle/title2.md)
- [title3](appkit/nsfont/textstyle/title3.md)

### Initializers

- [init(rawValue:)](appkit/nsfont/textstyle/init(rawvalue:).md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Creating System Fonts

- [preferredFont(forTextStyle:options:)](appkit/nsfont/preferredfont(fortextstyle:options:).md)
- [systemFont(ofSize:)](appkit/nsfont/systemfont(ofsize:).md)
- [systemFont(ofSize:weight:)](appkit/nsfont/systemfont(ofsize:weight:).md)
- [boldSystemFont(ofSize:)](appkit/nsfont/boldsystemfont(ofsize:).md)
- [monospacedSystemFont(ofSize:weight:)](appkit/nsfont/monospacedsystemfont(ofsize:weight:).md)
- [monospacedDigitSystemFont(ofSize:weight:)](appkit/nsfont/monospaceddigitsystemfont(ofsize:weight:).md)
- [systemFontSize](appkit/nsfont/systemfontsize.md)
- [smallSystemFontSize](appkit/nsfont/smallsystemfontsize.md)
- [NSFont.Weight](appkit/nsfont/weight.md)
- [NSFont.TextStyleOptionKey](appkit/nsfont/textstyleoptionkey.md)
