WhiteLabelFontFamily
A functional interface for providing font families to the White Label theme.
This interface allows customization of the font family used by WhiteLabelTheme, with locale-aware font selection support.
Default Implementation
The Default companion object provides a default implementation that returns FontFamily.Default:
OudsTheme(theme = WhiteLabelTheme(whiteLabelFontFamily = WhiteLabelFontFamily.Default)) {
// Your composables
}Content copied to clipboard
Custom Implementation
Create a custom implementation to use your own fonts:
val customFontFamily = WhiteLabelFontFamily { locale ->
if (locale.language == "ar") {
FontFamily(
Font(R.font.my_arabic_regular, FontWeight.Normal),
Font(R.font.my_arabic_bold, FontWeight.Bold)
)
} else {
FontFamily(
Font(R.font.my_latin_regular, FontWeight.Normal),
Font(R.font.my_latin_bold, FontWeight.Bold)
)
}
}
OudsTheme(theme = WhiteLabelTheme(whiteLabelFontFamily = customFontFamily)) {
// Your composables
}Content copied to clipboard