FontIcon

fun FontIcon(iconName: String, contentDescription: String?, modifier: GlanceModifier = GlanceModifier, size: Dp = LocalIconSize.current, tint: ColorProvider = LocalGlanceIconTint.current, weight: FontWeight = LocalIconWeight.current, iconFont: IconFont = LocalIconFont.current)

A component that draws the icon iconName using iconFont (with a default value of LocalIconFont). The icon will be size × size dp, and will be tinted with tint. If iconFont is a variable font, weight will applied as a variation setting, or else the font with the nearest weight will be picked.

WARNING: variable fonts are only supported on Android Oreo (API 26) and above. Trying to use them on lower API versions will result in an UnsupportedOperationException being thrown

Parameters

iconName

the icon name in the font (can be a single character or a string)

contentDescription

text used by accessibility services to describe what this icon represents. This should always be provided unless this icon is used for decorative purposes, and does not represent a meaningful action that a user can take. This text should be localized, such as by using androidx.compose.ui.res.stringResource or similar

modifier

the Modifier to be applied to this icon

size

the size of the icon, by default LocalIconSize

tint

the tint to be applied to this icon, by default LocalGlanceIconTint

weight

the font weight of the icon, by default LocalIconWeight

iconFont

the icon font used to draw this icon, by default LocalIconFont


fun FontIcon(icon: Char, contentDescription: String?, modifier: GlanceModifier = GlanceModifier, size: Dp = LocalIconSize.current, tint: ColorProvider = LocalGlanceIconTint.current, weight: FontWeight = LocalIconWeight.current, iconFont: IconFont = LocalIconFont.current)

A component that draws the icon using iconFont (with a default value of LocalIconFont). The icon will be size × size dp, and will be tinted with tint. If iconFont is a variable font, weight will applied as a variation setting, or else the font with the nearest weight will be picked.

WARNING: variable fonts are only supported on Android Oreo (API 26) and above. Trying to use them on lower API versions will result in an UnsupportedOperationException being thrown

Parameters

icon

the icon Unicode character

contentDescription

text used by accessibility services to describe what this icon represents. This should always be provided unless this icon is used for decorative purposes, and does not represent a meaningful action that a user can take. This text should be localized, such as by using androidx.compose.ui.res.stringResource or similar

modifier

the Modifier to be applied to this icon

size

the size of the icon, by default LocalIconSize

tint

the tint to be applied to this icon, by default LocalGlanceIconTint

weight

the font weight of the icon, by default LocalIconWeight

iconFont

the icon font used to draw this icon, by default LocalIconFont