SystemFontFamily

public struct SystemFontFamily : FontFamily

Information about the system font. System font implementation of FontFamily.

  • Declaration

    Swift

    public var familyName: String { get }
  • Returns a font for the specified weight and pointSize that is compatible with the traitCollection

    Declaration

    Swift

    public func font(
        for weight: Typography.FontWeight,
        pointSize: CGFloat,
        compatibleWith traitCollection: UITraitCollection?
    ) -> UIFont

    Parameters

    weight

    desired font weight

    pointSize

    desired font point size

    traitCollection

    trait collection to consider (UITraitCollection.legibilityWeight). If nil then UIAccessibility.isBoldTextEnabled will be considered instead