Google is committed to advancing racial equity for Black communities. See how.

FontFamily

@Immutable sealed class FontFamily
kotlin.Any
   ↳ androidx.ui.text.font.FontFamily

The base class of the font families.

Summary

Properties
Boolean

Companion properties
GenericFontFamily

Cursive, hand-written like font family.

SystemFontFamily

The platform default font.

GenericFontFamily

Font family where glyphs have the same fixed width.

GenericFontFamily

Font family with low contrast and plain stroke endings.

GenericFontFamily

The formal text style for scripts.

Properties

canLoadSynchronously

val canLoadSynchronously: Boolean

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.ui.foundation.Text

Text(
    text = "Demo Text cursive",
    fontFamily = FontFamily.Cursive
)

Default

val Default: SystemFontFamily

The platform default font.

Monospace

val Monospace: GenericFontFamily

Font family where glyphs have the same fixed width.

import androidx.ui.foundation.Text

Text(
    text = "Demo Text monospace",
    fontFamily = FontFamily.Monospace
)

SansSerif

val SansSerif: GenericFontFamily

Font family with low contrast and plain stroke endings.

import androidx.ui.foundation.Text

Text(
    text = "Demo Text sans-serif",
    fontFamily = FontFamily.SansSerif
)

Serif

val Serif: GenericFontFamily

The formal text style for scripts.

import androidx.ui.foundation.Text

Text(
    text = "Demo Text serif",
    fontFamily = FontFamily.Serif
)