<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
class ResourceFont
internal constructor(
    val resId: Int,
    override val weight: FontWeight = FontWeight.Normal,
    override val style: FontStyle = FontStyle.Normal,
    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 |



## Functions



<h2 id="copy-resid-weight-style">copy</h2>

```kotlin
fun copy(
        resId: Int = this.resId,
        weight: FontWeight = this.weight,
        style: FontStyle = this.style,
    ): ResourceFont
```



<hr class="docs-overload-divider">


<h2 id="copy-resid-weight-style-loadingstrategy-variationsettings">copy</h2>

```kotlin
@ExperimentalTextApi
    fun copy(
        resId: Int = this.resId,
        weight: FontWeight = this.weight,
        style: FontStyle = this.style,
        loadingStrategy: FontLoadingStrategy = this.loadingStrategy,
        variationSettings: FontVariation.Settings = this.variationSettings,
    ): ResourceFont
```