DSFontRenderingType

public enum DSFontRenderingType : String, CaseIterable

Type that defines the rendering font that a generic Anatomy control should use.

A rendering font can be used to determine the appearance of various views. Where possible, a DSLabel is preferred over a UILabel when displaying text because some rendering fonts should be paired with specific colors and color is not part of a UIFont.

Preferred:

let label = DSLabel(renderingType: .headlineWhite)

Not preferred:

let label = UILabel()

label.font = UIFont.headlineWhite
label.textColor = UIColor.grayscaleWhite

Enumeration Cases

  • Denotes that we will manually choose our font and color

    Declaration

    Swift

    case none
  • The largest font available

    Declaration

    Swift

    case largeTitleEmphasized
  • Emphasized Title 1 text

    Declaration

    Swift

    case title1Emphasized
  • Title 2 text

    Declaration

    Swift

    case title2
  • Emphasized Title 2 text

    Declaration

    Swift

    case title2Emphasized
  • Title 2 white text

    Declaration

    Swift

    case title2White
  • Title 3 text

    Declaration

    Swift

    case title3
  • Headline text

    Declaration

    Swift

    case headline
  • Headline white text

    Declaration

    Swift

    case headlineWhite
  • Headline link text

    Declaration

    Swift

    case headlineLink
  • Headline disabled text

    Declaration

    Swift

    case headlineDisabled
  • Body text

    Declaration

    Swift

    case body
  • Deemphasized body text

    Declaration

    Swift

    case bodyDeemphasized
  • Body link text

    Declaration

    Swift

    case bodyLink
  • Emphasized body link text

    Declaration

    Swift

    case bodyLinkEmphasized
  • Callout text

    Declaration

    Swift

    case callout
  • Subhead text

    Declaration

    Swift

    case subhead
  • Emphasized subhead text

    Declaration

    Swift

    case subheadEmphasized
  • Deemphasized subhead text

    Declaration

    Swift

    case subheadDeemphasized
  • Footnote text

    Declaration

    Swift

    case footnote
  • Emphasized footnote text

    Declaration

    Swift

    case footnoteEmphasized
  • Deemphasized footnote text

    Declaration

    Swift

    case footnoteDeemphasized
  • Caption 1 text

    Declaration

    Swift

    case caption1
  • Emphasized caption 1 text

    Declaration

    Swift

    case caption1Emphasized
  • Deemphasized caption 1 text

    Declaration

    Swift

    case caption1Deemphasized

Static Accessors

  • Declaration

    Swift

    public static var allStrings: [String] { get }

Accessors

  • Returns an English name of the rendering font. Useful mostly for debugging.

    Declaration

    Swift

    public var name: String { get }
  • Returns an associated UIFont for the rendering font.

    Declaration

    Swift

    public var font: UIFont { get }
  • Returns an associated UIColor for the rendering font.

    Declaration

    Swift

    public var color: UIColor { get }