WhiteLabelFontFamily

fun interface 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
}

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
}

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun getFontFamily(locale: Locale): FontFamily

Returns the font family to use for the given locale.