# ResourcesCompat.FontCallback

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1  
Summary:[Ctors](https://developer.android.com/reference/android/support/v4/content/res/ResourcesCompat.FontCallback#pubctors)\|[Methods](https://developer.android.com/reference/android/support/v4/content/res/ResourcesCompat.FontCallback#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v4/content/res/ResourcesCompat.FontCallback#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v4/content/res/ResourcesCompat.FontCallback#)  

# ResourcesCompat.FontCallback

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public
static

abstract
class
ResourcesCompat.FontCallback
`  
`

extends Object


``


`

|---|-------------------------------------------------------------|
| java.lang.Object                                               ||
| ↳ | android.support.v4.content.res.ResourcesCompat.FontCallback |

<br />

*** ** * ** ***

Interface used to receive asynchronous font fetching events.

## Summary

|                                                                            ### Public constructors                                                                            ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[ResourcesCompat.FontCallback](https://developer.android.com/reference/android/support/v4/content/res/ResourcesCompat.FontCallback#ResourcesCompat.FontCallback())`() ` |

|                                                                                                                                                               ### Public methods                                                                                                                                                                ||
|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void` | ` `[onFontRetrievalFailed](https://developer.android.com/reference/android/support/v4/content/res/ResourcesCompat.FontCallback#onFontRetrievalFailed(int))`(int reason) ` Called when an asynchronous font failed to load.                                                                                                    |
| ` abstract void` | ` `[onFontRetrieved](https://developer.android.com/reference/android/support/v4/content/res/ResourcesCompat.FontCallback#onFontRetrieved(android.graphics.Typeface))`(`[Typeface](https://developer.android.com/reference/android/graphics/Typeface.html)` typeface) ` Called when an asynchronous font was finished loading. |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/content/res/ResourcesCompat.FontCallback#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Public constructors

### ResourcesCompat.FontCallback

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
ResourcesCompat.FontCallback ()
```

<br />

<br />

## Public methods

### onFontRetrievalFailed

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onFontRetrievalFailed (int reason)
```

Called when an asynchronous font failed to load.

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ||
|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `reason` | `int`: The reason the font failed to load. One of[FAIL_REASON_PROVIDER_NOT_FOUND](https://developer.android.com/reference/android/support/v4/provider/FontsContractCompat.FontRequestCallback#FAIL_REASON_PROVIDER_NOT_FOUND),[FAIL_REASON_WRONG_CERTIFICATES](https://developer.android.com/reference/android/support/v4/provider/FontsContractCompat.FontRequestCallback#FAIL_REASON_WRONG_CERTIFICATES),[FAIL_REASON_FONT_LOAD_ERROR](https://developer.android.com/reference/android/support/v4/provider/FontsContractCompat.FontRequestCallback#FAIL_REASON_FONT_LOAD_ERROR),[FAIL_REASON_SECURITY_VIOLATION](https://developer.android.com/reference/android/support/v4/provider/FontsContractCompat.FontRequestCallback#FAIL_REASON_SECURITY_VIOLATION),[FAIL_REASON_FONT_NOT_FOUND](https://developer.android.com/reference/android/support/v4/provider/FontsContractCompat.FontRequestCallback#FAIL_REASON_FONT_NOT_FOUND),[FAIL_REASON_FONT_UNAVAILABLE](https://developer.android.com/reference/android/support/v4/provider/FontsContractCompat.FontRequestCallback#FAIL_REASON_FONT_UNAVAILABLE)or[FAIL_REASON_MALFORMED_QUERY](https://developer.android.com/reference/android/support/v4/provider/FontsContractCompat.FontRequestCallback#FAIL_REASON_MALFORMED_QUERY). <br /> |

### onFontRetrieved

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onFontRetrieved (Typeface typeface)
```

Called when an asynchronous font was finished loading.

<br />

|                        Parameters                        ||
|------------|----------------------------------------------|
| `typeface` | `Typeface`: The font that was loaded. <br /> |

-

  ## Classes

  - [ConfigurationHelper](https://developer.android.com/reference/android/support/v4/content/res/ConfigurationHelper)
  - [ResourcesCompat](https://developer.android.com/reference/android/support/v4/content/res/ResourcesCompat)
  - [ResourcesCompat.FontCallback](https://developer.android.com/reference/android/support/v4/content/res/ResourcesCompat.FontCallback)