FontFamily
-
Cmn
sealed class FontFamily
FileBasedFontFamily |
A base class of |
LoadedFontFamily |
Defines a font family that is already loaded Typeface. |
SystemFontFamily |
A base class of |
FontListFontFamily |
Defines a font family with list of |
GenericFontFamily |
Defines a font family with a generic font family name. |
The primary typography interface for Compose applications.
Summary
Nested types |
|---|
sealed interface FontFamily.ResolverMain interface for resolving |
Public companion properties |
||
|---|---|---|
GenericFontFamily |
Cursive, hand-written like font family. |
Cmn
|
SystemFontFamily |
The platform default font. |
Cmn
|
GenericFontFamily |
Font family where glyphs have the same fixed width. |
Cmn
|
GenericFontFamily |
Font family with low contrast and plain stroke endings. |
Cmn
|
GenericFontFamily |
The formal text style for scripts. |
Cmn
|
Protected constructors |
|
|---|---|
FontFamily(canLoadSynchronously: Boolean) |
Cmn
|
Public properties |
||
|---|---|---|
Boolean |
Cmn
|
Public companion properties
Cursive
val Cursive: GenericFontFamily
Cursive, hand-written like font family.
If the device doesn't support this font family, the system will fallback to the default font.
import androidx.compose.material.Text import androidx.compose.ui.text.font.Font import androidx.compose.ui.text.font.FontFamily Text(text = "Demo Text cursive", fontFamily = FontFamily.Cursive)
See CSS cursive
Monospace
val Monospace: GenericFontFamily
Font family where glyphs have the same fixed width.
import androidx.compose.material.Text import androidx.compose.ui.text.font.Font import androidx.compose.ui.text.font.FontFamily Text(text = "Demo Text monospace", fontFamily = FontFamily.Monospace)
See CSS monospace
SansSerif
val SansSerif: GenericFontFamily
Font family with low contrast and plain stroke endings.
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)
See CSS sans-serif
Serif
val Serif: GenericFontFamily
The formal text style for scripts.
import androidx.compose.material.Text import androidx.compose.ui.text.font.Font import androidx.compose.ui.text.font.FontFamily Text(text = "Demo Text serif", fontFamily = FontFamily.Serif)
See CSS serif