An environment-dependent font.


@frozen struct Font


The system resolves a font’s value at the time it uses the font in a given environment because Font is a late-binding token.


Getting Standard Fonts

static let largeTitle: Font

A font with the large title text style.

static let title: Font

A font with the title text style.

static var headline: Font

A font with the headline text style.

static var subheadline: Font

A font with the subheadline text style.

static var body: Font

A font with the body text style.

static var callout: Font

A font with the callout text style.

static var caption: Font

A font with the caption text style.

static var footnote: Font

A font with the footnote text style.

Getting System Fonts

Styling a Font

func bold() -> Font

Adds bold styling to the font.

func italic() -> Font

Adds italics to the font.

func monospacedDigit() -> Font

Adjusts the font to use monospace digits.

func smallCaps() -> Font

Adjusts the font to use small capitals.

func weight(Font.Weight) -> Font

Sets the weight of the font.

struct Font.Weight

A weight to use for fonts.


Conforms To

See Also


struct Text

A view that displays one or more lines of read-only text.

struct TextField

A control that displays an editable text interface.

struct SecureField

A control into which the user securely enters private text.


Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software