CPCFontMetrics

internal struct CPCFontMetrics

Container for various CPCFontMetricsProtocol implementations.

  • Creates new CPCFontMetricsProtocol instance that scales values according to a specific text style.

    Declaration

    Swift

    internal static func metrics(for textStyle: UIFont.TextStyle) -> CPCFontMetricsProtocol

    Parameters

    textStyle

    Text style that is used to scale various values.

    Return Value

    An instance of FontMetrics (iOS 11.0+) or LegacyFontMetrics (iOS 10.3 and older).