All Fiori components are built to the SAP Fiori for iOS accessibility specifications. FioriThemeManager provides the SAP 72 font family, which supports Dynamic Type out of the box so text scales with the user’s preferred reading size.
Registering Fiori fonts
Before using any Fiori font, register it during app startup:
// AppDelegate.swift
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
Font.registerFioriFonts()
return true
}
Skipping this step causes Fiori fonts to fall back to the system font.
Dynamic Type fonts
Use Font.fiori(forTextStyle:) to get a SAP 72 font that scales with the user’s Dynamic Type setting. Pass a standard UIFont.TextStyle to map to the correct semantic size:
Text("Section heading")
.font(.fiori(forTextStyle: .headline))
Text("Body copy")
.font(.fiori(forTextStyle: .body))
Text("Caption label")
.font(.fiori(forTextStyle: .caption1))
The condensed variant follows the same pattern:
Text("Compact label")
.font(.fioriCondensed(forTextStyle: .subheadline))
Supported text styles
All standard UIFont.TextStyle values are supported:
| Text style | Typical use |
|---|
.largeTitle | Screen titles |
.title1 / .title2 / .title3 | Section titles |
.headline | Emphasized body text |
.body | Primary reading text |
.callout | Supporting callouts |
.subheadline | Secondary labels |
.footnote | Supplementary information |
.caption1 / .caption2 | Captions and metadata |
Fixed-size fonts
If you need a font that does not scale with Dynamic Type — for example, in a chart axis label where layout depends on a fixed size — use Font.fiori(fixedSize:):
Text("42")
.font(.fiori(fixedSize: 34))
Text("Axis label")
.font(.fioriCondensed(fixedSize: 11))
Fixed-size fonts do not respond to the user’s Dynamic Type preference. Use them only where the layout cannot accommodate variable sizes. Always prefer Font.fiori(forTextStyle:) for body text, labels, and other readable content.
Choosing the right text style
Matching text to the correct semantic style ensures the Fiori accessibility hierarchy is preserved and that VoiceOver announces content in the right order.
// Do: use semantic styles
VStack(alignment: .leading) {
Text(item.title)
.font(.fiori(forTextStyle: .headline))
Text(item.subtitle)
.font(.fiori(forTextStyle: .subheadline))
Text(item.footnote)
.font(.fiori(forTextStyle: .footnote))
}
// Avoid: fixed sizes for readable text
VStack(alignment: .leading) {
Text(item.title)
.font(.fiori(fixedSize: 17)) // Does not scale with accessibility settings
}
Font weight
Specify weight as part of the text style call:
Text("Emphasized label")
.font(.fiori(forTextStyle: .body, weight: .semibold))
Text("Bold heading")
.font(.fiori(forTextStyle: .headline, weight: .bold))
Components and accessibility
All components in FioriSwiftUICore are built following the Fiori accessibility specifications:
- Interactive controls have appropriate accessibility labels and traits.
- Components respond to Dynamic Type by default when you use
Font.fiori(forTextStyle:).
- Color usage follows the Fiori color palette, which includes high-contrast variants automatically applied when the user enables increased contrast in iOS Settings.
Use Color.preferredColor(_:display:) with .device (the default) to ensure high-contrast color variants are applied automatically based on the user’s accessibility settings. See the Dark mode guide for details.