# Font.ResourceLoader

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/Font.kt+class:androidx.compose.ui.text.font.Font.ResourceLoader) 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) Common/AllAndroid/JVM
- Cmn

  ```
  interface Font.ResourceLoader
  ```

*** ** * ** ***

> [!CAUTION]
> **This interface is deprecated.**   
> Replaced with FontFamily.Resolver during the introduction of async fonts, all usages should be replaced. Custom subclasses can be converted into a FontFamily.Resolver by calling createFontFamilyResolver(myFontFamilyResolver, context)

Interface used to load a font resource.

## Summary

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html` | `[load](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/Font.ResourceLoader#load(androidx.compose.ui.text.font.Font))(font: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/Font)` **This function is deprecated.** Replaced by FontFamily.Resolver, this method should not be called | Cmn |

## Public functions

### load

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)

```
fun [load](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/Font.ResourceLoader#load(androidx.compose.ui.text.font.Font))(font: Font): Any
```

> [!CAUTION]
> **This function is deprecated.**   
> Replaced by FontFamily.Resolver, this method should not be called, use this instead:
>
> ```kotlin
> FontFamily.Resolver.resolve(font, )
> ```

Loads resource represented by the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/Font` object.

| Parameters |
|---|---|
| `font: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/Font` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/Font` to be loaded |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html` | platform specific typeface |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-exception/index.html` | if font cannot be loaded |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if font cannot be loaded |