Package-level declarations

Types

Link copied to clipboard
typealias FontConstructor = (weight: FontWeight, variationSettings: FontVariation.Settings) -> Font

A function returning a Font object, taking as parameters the weight (FontWeight) and the other variation settings (FontVariation.Settings)

Link copied to clipboard
Link copied to clipboard
sealed class IconFont

An icon font used to draw icons. Subclasses, methods and properties are internal to the library.

Link copied to clipboard

Fixed icon font, for non-variable fonts. Multiple fonts might be provided to support multiple weights.

Link copied to clipboard
abstract class VariableIconFont : IconFont

Properties

Link copied to clipboard

The default IconFont used when none is provided as a parameter of one of the FontIcon composables.

Link copied to clipboard

The default icon size (in Dp) used when none is provided in the composable Modifier.

Link copied to clipboard

The default icon tint (a Color) used when none is provided as a parameter of one of the FontIcon composables.

Link copied to clipboard

The default icon tint provider (a CompositionLocal for a Color) used when none is provided as a parameter of one of the FontIcon composables. If null, the value of LocalIconTint will be used instead. When using Material3, should be most likely set to LocalContentColor.

Link copied to clipboard

The default icon weight (a FontWeight) used when none is provided as a parameter of one of the FontIcon composables.

Functions

Link copied to clipboard
fun createStaticIconFont(vararg fonts: Font, fontFeatureSettings: String? = null): StaticIconFont

Creates a static IconFont using a list of Font objects. Multiple fonts might be provided to support multiple weights.

Link copied to clipboard
fun createVariableIconFont(fontConstructor: FontConstructor, weights: Array<FontWeight>, fontVariationSettings: Array<FontVariation.Setting> = emptyArray(), fontFeatureSettings: String? = null): IconFont

Creates a variable IconFont using a FontConstructor.

fun createVariableIconFont(alias: String, baseTypeface: Typeface, weights: Array<FontWeight>, fontVariationSettings: Array<FontVariation.Setting> = emptyArray(), fontFeatureSettings: String? = null, density: Density): VariableIconFont

Creates a variable IconFont using a Skia Typeface.

Link copied to clipboard
fun Canvas.drawFontIcon(icon: Char, typeface: Typeface, fontFeatureSettings: String?, tint: Color, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp)

An extension function that draws the icon using the typeface into the receiver Canvas. The icon will be size × size dp, and will be tinted with tint.

fun Canvas.drawFontIcon(iconName: String, typeface: Typeface, fontFeatureSettings: String?, tint: Color, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp)

An extension function that draws the icon iconName using the typeface into the receiver Canvas. The icon will be size × size dp, and will be tinted with tint.

fun Canvas.drawFontIcon(icon: Char, iconFont: StaticIconFont, tint: Color, context: Context, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT))

An extension function that draws the icon using the iconFont into the receiver Canvas. The icon will be size × size dp, and will be tinted with tint.

@RequiresApi(value = 26)
fun Canvas.drawFontIcon(icon: Char, iconFont: VariableIconFont, tint: Color, context: Context, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT))

An extension function that draws the icon using the variable iconFont into the receiver Canvas. The icon will be size × size dp, and will be tinted with tint.

fun Canvas.drawFontIcon(iconName: String, iconFont: StaticIconFont, tint: Color, context: Context, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT))

An extension function that draws the icon iconName using the iconFont into the receiver Canvas. The icon will be size × size dp, and will be tinted with tint.

@RequiresApi(value = 26)
fun Canvas.drawFontIcon(iconName: String, iconFont: VariableIconFont, tint: Color, context: Context, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT))

An extension function that draws the icon iconName using the variable iconFont into the receiver Canvas. The icon will be size × size dp, and will be tinted with tint.

@RequiresApi(value = 26)
fun Canvas.drawFontIcon(icon: Char, typeface: Typeface, fontFeatureSettings: String?, fontVariationSettings: Array<out FontVariation.Setting>, tint: Color, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT))

An extension function that draws the icon using the variable typeface into the receiver Canvas. The icon will be size × size dp, and will be tinted with tint.

@RequiresApi(value = 26)
fun Canvas.drawFontIcon(iconName: String, typeface: Typeface, fontFeatureSettings: String?, fontVariationSettings: Array<out FontVariation.Setting>, tint: Color, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT))

An extension function that draws the icon iconName using the variable typeface into the receiver Canvas. The icon will be size × size dp, and will be tinted with tint.

Link copied to clipboard
fun Canvas.drawIcon(icon: Char, context: Context, tint: Color, iconFont: IconFont, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT), density: Density = Density(context))

An extension function that draws the icon using iconFont into the receiver Canvas. 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.

fun Canvas.drawIcon(iconName: String, context: Context, tint: Color, iconFont: IconFont, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT), density: Density = Density(context))

An extension function that draws the icon iconName using iconFont into the receiver Canvas. 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.

Link copied to clipboard
fun FontIcon(icon: Char, contentDescription: String?, modifier: Modifier = Modifier, tint: Color = LocalIconTintProvider.current?.current ?: LocalIconTint.current, weight: FontWeight = LocalIconWeight.current, iconFont: IconFont = LocalIconFont.current)

A component that draws the icon 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.

fun FontIcon(iconName: String, contentDescription: String?, modifier: Modifier = Modifier, tint: Color = LocalIconTintProvider.current?.current ?: LocalIconTint.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.

Link copied to clipboard
fun FontIconBitmap(icon: Char, context: Context, tint: Color, iconFont: IconFont, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT)): Bitmap

A function that draws the icon using iconFont into a new Bitmap. 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.

fun FontIconBitmap(icon: Char, typeface: Typeface, fontFeatureSettings: String?, tint: Color, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp): Bitmap

A function that draws the icon using the typeface into a new Bitmap. The icon will be size × size dp, and will be tinted with tint.

fun FontIconBitmap(iconName: String, context: Context, tint: Color, iconFont: IconFont, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT)): Bitmap

A function that draws the icon iconName using iconFont into a new Bitmap. 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.

fun FontIconBitmap(iconName: String, typeface: Typeface, fontFeatureSettings: String?, tint: Color, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp): Bitmap

A function that draws the icon iconName using the typeface into a new Bitmap. The icon will be size × size dp, and will be tinted with tint.

fun FontIconBitmap(icon: Char, iconFont: StaticIconFont, tint: Color, context: Context, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT)): Bitmap

A function that draws the icon using the iconFont into a new Bitmap. The icon will be size × size dp, and will be tinted with tint.

@RequiresApi(value = 26)
fun FontIconBitmap(icon: Char, iconFont: VariableIconFont, tint: Color, context: Context, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT)): Bitmap

A function that draws the icon using the variable iconFont into a new Bitmap. The icon will be size × size dp, and will be tinted with tint.

fun FontIconBitmap(iconName: String, iconFont: StaticIconFont, tint: Color, context: Context, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT)): Bitmap

A function that draws the icon iconName using the iconFont into a new Bitmap. The icon will be size × size dp, and will be tinted with tint.

@RequiresApi(value = 26)
fun FontIconBitmap(iconName: String, iconFont: VariableIconFont, tint: Color, context: Context, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT)): Bitmap

A function that draws the icon iconName using the variable iconFont into a new Bitmap. The icon will be size × size dp, and will be tinted with tint.

@RequiresApi(value = 26)
fun FontIconBitmap(icon: Char, typeface: Typeface, fontFeatureSettings: String?, fontVariationSettings: Array<out FontVariation.Setting>, tint: Color, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT)): Bitmap

A function that draws the icon using the variable typeface into a new Bitmap. The icon will be size × size dp, and will be tinted with tint.

@RequiresApi(value = 26)
fun FontIconBitmap(iconName: String, typeface: Typeface, fontFeatureSettings: String?, fontVariationSettings: Array<out FontVariation.Setting>, tint: Color, density: Density, size: Dp = DEFAULT_ICON_SIZE_DP.dp, weight: FontWeight = FontWeight(DEFAULT_ICON_WEIGHT)): Bitmap

A function that draws the icon iconName using the variable typeface into a new Bitmap. The icon will be size × size dp, and will be tinted with tint.

Link copied to clipboard
fun ProvideIconParameters(iconFont: IconFont = LocalIconFont.current, size: Dp = LocalIconSize.current, tintProvider: CompositionLocal<Color>? = LocalIconTintProvider.current, weight: FontWeight = LocalIconWeight.current, content: @Composable () -> Unit)
fun ProvideIconParameters(iconFont: IconFont = LocalIconFont.current, size: Dp = LocalIconSize.current, tint: Color = LocalIconTint.current, weight: FontWeight = LocalIconWeight.current, content: @Composable () -> Unit)

A shortcut method to set default values for FontIcon composables. Might be better to use CompositionLocalProvider if it's for setting only one of the default values.

Link copied to clipboard
fun rememberStaticIconFont(font: Font, fontFeatureSettings: String? = null): StaticIconFont

Creates a static IconFont using a Font.

fun rememberStaticIconFont(vararg fonts: Font, fontFeatureSettings: String? = null): StaticIconFont

Creates a static IconFont using a list of Font objects. Multiple fonts might be provided to support multiple weights.

fun rememberStaticIconFont(fontResource: FontResource, fontFeatureSettings: String? = null): StaticIconFont

Creates a static IconFont using a Compose Multiplatform FontResource.

Link copied to clipboard
@RequiresApi(value = 26)
fun rememberVariableIconFont(fileDescriptor: ParcelFileDescriptor, weights: Array<FontWeight>, fontVariationSettings: Array<FontVariation.Setting> = emptyArray(), fontFeatureSettings: String? = null): VariableIconFont

Creates a variable IconFont using a ParcelFileDescriptor. Requires Android Oreo or higher.

fun rememberVariableIconFont(file: File, weights: Array<FontWeight>, fontVariationSettings: Array<FontVariation.Setting> = emptyArray(), fontFeatureSettings: String? = null): VariableIconFont

Creates a variable IconFont from a file.

fun rememberVariableIconFont(fontConstructor: FontConstructor, weights: Array<FontWeight>, fontVariationSettings: Array<FontVariation.Setting> = emptyArray(), fontFeatureSettings: String? = null): VariableIconFont

Creates a variable IconFont using a FontConstructor.

fun rememberVariableIconFont(@FontRes resId: Int, weights: Array<FontWeight>, fontVariationSettings: Array<FontVariation.Setting> = emptyArray(), fontFeatureSettings: String? = null): VariableIconFont

Creates a variable IconFont using a resource id.

actual fun rememberVariableIconFont(fontResource: FontResource, weights: Array<FontWeight>, fontVariationSettings: Array<FontVariation.Setting>, fontFeatureSettings: String?): VariableIconFont
fun rememberVariableIconFont(path: String, weights: Array<FontWeight>, assetManager: AssetManager = rememberLocalContext().current.resources.assets, fontVariationSettings: Array<FontVariation.Setting> = emptyArray(), fontFeatureSettings: String? = null): VariableIconFont

Creates a variable IconFont from a file in the assets directory.

expect fun rememberVariableIconFont(fontResource: FontResource, weights: Array<FontWeight>, fontVariationSettings: Array<FontVariation.Setting> = emptyArray(), fontFeatureSettings: String? = null): VariableIconFont

Creates a variable IconFont using a Compose Multiplatform FontResource.

fun rememberVariableIconFont(file: File, weights: Array<FontWeight>, fontVariationSettings: Array<FontVariation.Setting> = emptyArray(), fontFeatureSettings: String? = null, density: Density = LocalDensity.current): VariableIconFont

Creates a variable IconFont from a file.

fun rememberVariableIconFont(resource: String, weights: Array<FontWeight>, fontVariationSettings: Array<FontVariation.Setting> = emptyArray(), fontFeatureSettings: String? = null, density: Density = LocalDensity.current): VariableIconFont

Creates a variable IconFont using a resource name.

actual fun rememberVariableIconFont(fontResource: FontResource, weights: Array<FontWeight>, fontVariationSettings: Array<FontVariation.Setting>, fontFeatureSettings: String?): VariableIconFont
fun rememberVariableIconFont(alias: String, data: ByteArray, weights: Array<FontWeight>, fontVariationSettings: Array<FontVariation.Setting> = emptyArray(), fontFeatureSettings: String? = null, density: Density = LocalDensity.current): VariableIconFont

Creates a variable IconFont using a byte array with loaded font data.

fun rememberVariableIconFont(alias: String, baseTypeface: Typeface, weights: Array<FontWeight>, fontVariationSettings: Array<FontVariation.Setting> = emptyArray(), fontFeatureSettings: String? = null, density: Density = LocalDensity.current): VariableIconFont

Creates a variable IconFont using a Skia Typeface.

fun rememberVariableIconFont(resource: Any?, weights: Array<FontWeight>, fontVariationSettings: Array<FontVariation.Setting> = emptyArray(), fontFeatureSettings: String? = null, density: Density = LocalDensity.current): VariableIconFont

Creates a variable IconFont using the path of a font.