UIFont

extension UIFont
  • Get Fiori preferred font based on a given UIFontTextStyle. This is a scaled font.

    Supported attributes: Regular, Italic, Light, Bold, BoldItalic, Black, Condensed, CondensedBold.

    72 Font is designed to have the same leading as Apple’s system font. However, due to the limitations of UIKit, the leading property is not modifiable in UIFont. SAPFiori provides a workaround by adding additional line spacing in an attributed string. To get the attributed string with adjusted spacing, use withPreferredFioriFont(forTextStyle:) on either a String or NSattributedString.

    Declaration

    Swift

    public class func preferredFioriFont(forTextStyle textStyle: UIFontTextStyle, weight: UIFont.Weight = .regular, isItalic: Bool = false, isCondensed: Bool = false) -> UIFont

    Parameters

    textStyle

    The UIFontTextStyle text style.

    weight

    The weight of the font.

    isItalic

    The italic version of the font.

    isConsensed

    The condensed version of the font.

    Return Value

    The font object with specified attributes.

  • Get Fiori preferred font with a given size. Not a scaled font.

    Supported attributes: Regular, Italic, Light, Bold, BoldItalic, Black, Condensed, CondensedBold.

    Declaration

    Swift

    public class func preferredFioriFont(fixedSize size: CGFloat, weight: UIFont.Weight = .regular, isItalic: Bool = false, isCondensed: Bool = false) -> UIFont

    Parameters

    size

    The size (in points) to which the font is scaled.

    weight

    The weight of the font.

    isItalic

    The italic version of the font.

    isConsensed

    The condensed version of the font.

    Return Value

    The font object with fixed size.

  • Register Fiori fonts in the app.

    Call UIFont.registerFioriFonts() in AppDelegate to load all the fiori fonts into your app. If it is not called, UIFont.preferredFioriFont(forTextStyle:) will return system font instead.

    Declaration

    Swift

    public static func registerFioriFonts()
  • Undocumented

    Declaration

    Swift

    public static var is72FontsAvailable: Bool { get }
  • Declaration

    Swift

    extension UIFont.TextStyle
    extension UIFont.TextStyle: CustomStringConvertible
    extension UIFont.TextStyle: CaseIterable
  • Declaration

    Swift

    extension UIFont.Weight: CaseIterable, CustomStringConvertible