FontListFontFamily


Defines a font family with list of Font.

import androidx.compose.material.Text
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily

Text(text = "Demo Text sans-serif", fontFamily = FontFamily.SansSerif)
import androidx.compose.material.Text
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontStyle
import androidx.compose.ui.text.font.FontWeight

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)

Summary

Public functions

open operator Boolean
equals(other: Any?)
Cmn
open Int
Cmn
open String
Cmn

Public properties

List<Font>

The fallback list of fonts used for resolving typefaces for this FontFamily.

Cmn

Inherited functions

From kotlin.collections.List
open operator Boolean
contains(element: Font)
Cmn
open Boolean
Cmn
open operator Font
get(index: Int)
Cmn
open Int
indexOf(element: Font)
Cmn
open Boolean
Cmn
open operator Iterator<Font>
Cmn
open Int
lastIndexOf(element: Font)
Cmn
open ListIterator<Font>
Cmn
open ListIterator<Font>
listIterator(index: Int)
Cmn
open List<Font>
subList(fromIndex: Int, toIndex: Int)
Cmn

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

fonts

val fontsList<Font>

The fallback list of fonts used for resolving typefaces for this FontFamily.