# FontFamily

Artifact: [androidx.compose.ui:ui-text](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/text/font/FontFamily.kt+class:androidx.compose.ui.text.font.FontFamily) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  sealed class FontFamily
  ```
Known direct subclasses [FileBasedFontFamily](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FileBasedFontFamily), [LoadedFontFamily](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/LoadedFontFamily), [SystemFontFamily](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/SystemFontFamily)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FileBasedFontFamily` | A base class of `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily`s that is created from file sources. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/LoadedFontFamily` | Defines a font family that is already loaded Typeface. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/SystemFontFamily` | A base class of `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily`s installed on the system. |

Known indirect subclasses [FontListFontFamily](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontListFontFamily), [GenericFontFamily](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/GenericFontFamily)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontListFontFamily` | Defines a font family with list of `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/Font`. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/GenericFontFamily` | Defines a font family with a generic font family name. |

*** ** * ** ***

The primary typography interface for Compose applications.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontListFontFamily` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/GenericFontFamily` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver` |   |

## Summary

| ### Nested types |
|---|
| `sealed interface https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver` Main interface for resolving `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily` into a platform-specific typeface for use in Compose-based applications. |

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/GenericFontFamily` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily#Cursive()` Cursive, hand-written like font family. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/SystemFontFamily` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily#Default()` The platform default font. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/GenericFontFamily` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily#Monospace()` Font family where glyphs have the same fixed width. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/GenericFontFamily` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily#SansSerif()` Font family with low contrast and plain stroke endings. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/GenericFontFamily` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily#Serif()` The formal text style for scripts. | Cmn |

| ### Protected constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily#FontFamily(kotlin.Boolean)(canLoadSynchronously: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily#canLoadSynchronously()` **This property is deprecated.** Unused property that has no meaning. | Cmn |

## Public companion properties

### Cursive

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
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.

```kotlin
import androidx.compose.material3.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](https://www.w3.org/TR/css-fonts-3/#cursive)

### Default

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Default: SystemFontFamily
```

The platform default font.

### Monospace

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Monospace: GenericFontFamily
```

Font family where glyphs have the same fixed width.

```kotlin
import androidx.compose.material3.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](https://www.w3.org/TR/css-fonts-3/#monospace)

### SansSerif

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val SansSerif: GenericFontFamily
```

Font family with low contrast and plain stroke endings.

```kotlin
import androidx.compose.material3.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](https://www.w3.org/TR/css-fonts-3/#sans-serif)

### Serif

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Serif: GenericFontFamily
```

The formal text style for scripts.

```kotlin
import androidx.compose.material3.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](https://www.w3.org/TR/css-fonts-3/#serif)

## Protected constructors

### FontFamily

Cmn

```
protected FontFamily(canLoadSynchronously: Boolean)
```

## Public properties

### canLoadSynchronously

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.2.0)

```
val canLoadSynchronously: Boolean
```

> [!CAUTION]
> **This property is deprecated.**   
> Unused property that has no meaning. Do not use.