Font

public struct Font

A type that represents a font and its configuration.

  • Declaration

    Swift

    public enum Weight
  • Create a font with the large title text style.

    Declaration

    Swift

    public static var largeTitle: Font { get }
  • Create a font with the title text style.

    Declaration

    Swift

    public static var title: Font { get }
  • Create a font with the title 2 text style.

    Declaration

    Swift

    public static var title2: Font { get }
  • Create a font with the title 3 text style.

    Declaration

    Swift

    public static var title3: Font { get }
  • Create a font with the headline text style.

    Declaration

    Swift

    public static var headline: Font { get }
  • Create a font with the subheadline text style.

    Declaration

    Swift

    public static var subheadline: Font { get }
  • Create a font with the body text style.

    Declaration

    Swift

    public static var body: Font { get }
  • Create a font with the callout text style.

    Declaration

    Swift

    public static var callout: Font { get }
  • Create a font with the footnote text style.

    Declaration

    Swift

    public static var footnote: Font { get }
  • Create a font with the caption text style.

    Declaration

    Swift

    public static var caption: Font { get }
  • Create a system font with the given size, weight and design.

    Declaration

    Swift

    public static func system(size: CGFloat, weight: Font.Weight = .regular) -> Font
  • Create a custom font with the given name and size.

    Declaration

    Swift

    public static func custom(_ name: String, size: CGFloat) -> Font
  • Returns a bold version of the font.

    Declaration

    Swift

    public func bold() -> Font
  • Returns a version of the font with the specified font weight.

    Declaration

    Swift

    public func weight(_ weight: Font.Weight) -> Font