🌈 Create new beautiful Compose Gradients with our new wesite ->
Class

ResourceFont

Defines a font to be used while rendering text with resource ID.

Source set: Common
public class ResourceFont internal constructor(
    public val resId: Int,
    public override val weight: FontWeight = FontWeight.Normal,
    public override val style: FontStyle = FontStyle.Normal,
    public override val variationSettings: FontVariation.Settings =
        FontVariation.Settings(weight, style),
    loadingStrategy: FontLoadingStrategy = FontLoadingStrategy.Async,
) : Font

Defines a font to be used while rendering text with resource ID.

Parameters

resId The resource ID of the font file in font resources. i.e. "R.font.myfont".
weight The weight of the font. The system uses this to match a font to a font request that is given in a androidx.compose.ui.text.TextStyle.
style The style of the font, normal or italic. The system uses this to match a font to a font request that is given in a androidx.compose.ui.text.TextStyle.
loadingStrategy Load strategy for this font

Properties

loadingStrategy

Source set: Common
public override val loadingStrategy: FontLoadingStrategy = loadingStrategy

Functions

copy

Source set: Common
public fun copy(
        resId: Int = this.resId,
        weight: FontWeight = this.weight,
        style: FontStyle = this.style,
    ): ResourceFont

copy

Source set: Common
public fun copy(
        resId: Int = this.resId,
        weight: FontWeight = this.weight,
        style: FontStyle = this.style,
        loadingStrategy: FontLoadingStrategy = this.loadingStrategy,
        variationSettings: FontVariation.Settings = this.variationSettings,
    ): ResourceFont