Structure

Font

An environment-dependent font.

Declaration

@frozen struct Font

Overview

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.

Topics

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.

Relationships

Conforms To

See Also

Text

struct Text

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

Beta
struct TextField

A control that displays an editable text interface.

Beta
struct SecureField

A control into which the user securely enters private text.

Beta

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