FontFamily

Known direct subclasses
FileBasedFontFamily

A base class of FontFamilys that is created from file sources.

LoadedFontFamily

Defines a font family that is already loaded Typeface.

SystemFontFamily

A base class of FontFamilys installed on the system.

Known indirect subclasses
FontListFontFamily

Defines a font family with list of Font.

GenericFontFamily

Defines a font family with a generic font family name.


The primary typography interface for Compose applications.

Summary

Nested types

sealed interface FontFamily.Resolver

Main interface for resolving FontFamily into a platform-specific typeface for use in Compose-based applications.

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 CursiveGenericFontFamily

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

Default

val DefaultSystemFontFamily

The platform default font.

Monospace

val MonospaceGenericFontFamily

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 SansSerifGenericFontFamily

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 SerifGenericFontFamily

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

Protected constructors

FontFamily

protected FontFamily(canLoadSynchronously: Boolean)

Public properties

canLoadSynchronously

val canLoadSynchronouslyBoolean