rememberVariableIconFont

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

Creates a variable IconFont using a FontConstructor.

Parameters

fontConstructor

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

weights

the supported weights for the font

fontVariationSettings

the font variation settings, should not include the optical size ('opsz') and must not include the weight ('wght')

fontFeatureSettings

the font feature settings, written in a CSS syntax


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.

Parameters

resId

the Android resource identifier of the font (e.g. R.font.my_icon_font)

weights

the supported weights for the font

fontVariationSettings

the font variation settings, should not include the optical size ('opsz') and must not include the weight ('wght')

fontFeatureSettings

the font feature settings, written in a CSS syntax


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

Creates a variable IconFont from a file.

Parameters

file

the font file

weights

the supported weights for the font

fontVariationSettings

the font variation settings, should not include the optical size ('opsz') and must not include the weight ('wght')

fontFeatureSettings

the font feature settings, written in a CSS syntax


@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.

Parameters

fileDescriptor

the file descriptor for the font file

weights

the supported weights for the font

fontVariationSettings

the font variation settings, should not include the optical size ('opsz') and must not include the weight ('wght')

fontFeatureSettings

the font feature settings, written in a CSS syntax


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.

Parameters

path

the full path starting from the assets directory

weights

the supported weights for the font

assetManager

the Android AssetManager

fontVariationSettings

the font variation settings, should not include the optical size ('opsz') and must not include the weight ('wght')

fontFeatureSettings

the font feature settings, written in a CSS syntax


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

Creates a variable IconFont using a Compose Multiplatform FontResource.

Parameters

fontResource

the Compose Multiplatform resource ID

weights

the supported weights for the font

fontVariationSettings

the font variation settings, should not include the optical size ('opsz') and must not include the weight ('wght')

fontFeatureSettings

the font feature settings, written in a CSS syntax

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

Creates a variable IconFont using a resource name.

Parameters

resource

the resource name in classpath

weights

the supported weights for the font

fontVariationSettings

the font variation settings, should not include the optical size ('opsz') and must not include the weight ('wght')

fontFeatureSettings

the font feature settings, written in a CSS syntax


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

Creates a variable IconFont from a file.

Parameters

file

the font file

weights

the supported weights for the font

fontVariationSettings

the font variation settings, should not include the optical size ('opsz') and must not include the weight ('wght')

fontFeatureSettings

the font feature settings, written in a CSS syntax

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

Creates a variable IconFont using a Skia Typeface.

Parameters

alias

the internal name to differentiate the typeface

baseTypeface

the base Skia SkTypeface that will be cloned for each required variation settings

weights

the supported weights for the font

fontVariationSettings

the font variation settings, should not include the optical size ('opsz') and must not include the weight ('wght')

fontFeatureSettings

the font feature settings, written in a CSS syntax

density

the density of the screen, used to convert the icon size to pixels


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

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

Parameters

alias

the internal name to differentiate the typeface

data

a byte array with loaded font data

weights

the supported weights for the font

fontVariationSettings

the font variation settings, should not include the optical size ('opsz') and must not include the weight ('wght')

fontFeatureSettings

the font feature settings, written in a CSS syntax

density

the density of the screen, used to convert the icon size to pixels


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

Creates a variable IconFont using the path of a font.

Parameters

resource

fetch path of the font file as seen here

weights

supported weights for the font

fontVariationSettings

the font variation settings, should not include the optical size ('opsz') and must not include the weight ('wght')

fontFeatureSettings

the font feature settings, written in a CSS syntax