<div class='sourceset sourceset-common'>Common</div>

```kotlin
sealed interface Resolver
```

Main interface for resolving [FontFamily](/jetpack-compose/androidx.compose.ui/ui-text/classes/FontFamily) into a platform-specific typeface for use in
Compose-based applications.

Fonts are loaded via [Resolver.resolve](/jetpack-compose/androidx.compose.ui/ui-text/interfaces/FontFamily.Resolver) from a FontFamily and a type request, and return a
platform-specific typeface.

Fonts may be preloaded by calling [Resolver.preload](/jetpack-compose/androidx.compose.ui/ui-text/interfaces/FontFamily.Resolver) to avoid text reflow when async fonts
load.

## Functions

<h2 id="preload-fontfamily">preload</h2>

```kotlin
suspend fun preload(fontFamily: FontFamily)
```

Preloading resolves and caches all fonts reachable in a [FontFamily](/jetpack-compose/androidx.compose.ui/ui-text/classes/FontFamily).

It checks the cache first, and if there is a miss, it will fetch from the network.

Fonts are consider reachable if they are the first entry in the fallback chain for any
call to [resolve](#resolve).

This method will suspend until:
1. All `FontLoadingStrategy.Async` fonts that are reachable have completed loading, or  failed to load
2. All reachable fonts in the fallback chain have been loaded and inserted into the cache

After returning, all fonts with `FontLoadingStrategy.Async` and
`FontLoadingStrategy.OptionalLocal` will be permanently cached. In contrast to [resolve](#resolve)
this method will throw when a reachable `FontLoadingStrategy.Async` font fails to
resolve.

All fonts with `FontLoadingStrategy.Blocking` will be cached with normal eviction rules.

#### Parameters

| | |
| --- | --- |
| fontFamily | the family to resolve all fonts from |

<hr class="docs-overload-divider">

<h2 id="resolve-fontfamily-fontweight-fontstyle-fontsynthesis">resolve</h2>

```kotlin
fun resolve(
            fontFamily: FontFamily? = null,
            fontWeight: FontWeight = FontWeight.Normal,
            fontStyle: FontStyle = FontStyle.Normal,
            fontSynthesis: FontSynthesis = FontSynthesis.All,
        ): State<Any>
```

Resolves a typeface using any appropriate logic for the [FontFamily](/jetpack-compose/androidx.compose.ui/ui-text/classes/FontFamily).

[FontListFontFamily](/jetpack-compose/androidx.compose.ui/ui-text/classes/FontListFontFamily) will always resolve using fallback chains and load using
[Font.ResourceLoader](/jetpack-compose/androidx.compose.ui/ui-text/interfaces/Font.ResourceLoader).

Platform specific [FontFamily](/jetpack-compose/androidx.compose.ui/ui-text/classes/FontFamily) will resolve according to platform behavior, as documented
for each [FontFamily](/jetpack-compose/androidx.compose.ui/ui-text/classes/FontFamily).

#### Parameters

| | |
| --- | --- |
| fontFamily | family to resolve. If `null` will use `FontFamily.Default` |
| fontWeight | desired font weight |
| fontStyle | desired font style |
| fontSynthesis | configuration for font synthesis |

#### Returns

| | |
| --- | --- |
|  | platform-specific Typeface such as [android.graphics.Typeface](/jetpack-compose/androidx.compose.ui/ui-text/interfaces/Typeface) |