---
title: "FontListFontFamily"
description: "Defines a font family with list of [Font]."
type: "class"
---

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


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

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


```kotlin
class FontListFontFamily
internal constructor(
    /** The fallback list of fonts used for resolving typefaces for this FontFamily. */
    val fonts: List<Font>
) : FileBasedFontFamily(), List<Font> by fonts
```


Defines a font family with list of `Font`.



## Code Examples

### CustomFontFamilySample
```kotlin
@Composable
fun CustomFontFamilySample() {
    val fontFamily =
        FontFamily(
            Font(
                resId = R.font.my_font_400_regular,
                weight = FontWeight.W400,
                style = FontStyle.Normal,
            ),
            Font(
                resId = R.font.my_font_400_italic,
                weight = FontWeight.W400,
                style = FontStyle.Italic,
            ),
        )
    Text(text = "Demo Text", fontFamily = fontFamily)
}
```

### FontFamilySansSerifSample
```kotlin
@Composable
fun FontFamilySansSerifSample() {
    Text(text = "Demo Text sans-serif", fontFamily = FontFamily.SansSerif)
}
```

