UIFont
extension UIFont
-
Get
Fioripreferred font based on a givenUIFontTextStyle. This is a scaled font.Supported attributes:
Regular,Italic,Light,Bold,Semibold,SemiboldDuplex,BoldItalic,Black,Condensed,CondensedBold.72 Font is designed to have the same
leadingas Apple’s system font. However, due to the limitations ofUIKit, theleadingproperty is not modifiable inUIFont.SAPFioriprovides a workaround by adding additional line spacing in an attributed string. To get the attributed string with adjusted spacing, usewithPreferredFioriFont(forTextStyle:)on either aStringorNSattributedString.Declaration
Swift
public class func preferredFioriFont(forTextStyle textStyle: UIFontTextStyle, weight: UIFont.Weight = .regular, isItalic: Bool = false, isCondensed: Bool = false) -> UIFontParameters
textStyleThe
UIFontTextStyletext style.weightThe weight of the font.
isItalicThe italic version of the font.
isConsensedThe condensed version of the font.
Return Value
The font object with specified attributes.
-
Get
Fioripreferred font with a given size. Not a scaled font.Supported attributes:
Regular,Italic,Light,Bold,Semibold,SemiboldDuplex,BoldItalic,Black,Condensed,CondensedBold.Declaration
Swift
public class func preferredFioriFont(fixedSize size: CGFloat, weight: UIFont.Weight = .regular, isItalic: Bool = false, isCondensed: Bool = false) -> UIFontParameters
sizeThe size (in points) to which the font is scaled.
weightThe weight of the font.
isItalicThe italic version of the font.
isConsensedThe 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.TextStyleextension UIFont.TextStyle: Swift.CustomStringConvertibleextension UIFont.TextStyle: Swift.CaseIterable -
Declaration
Swift
extension UIFont.Weight: Swift.CaseIterable, Swift.CustomStringConvertible