# FontsContractCompat.FontFamilyResult

# FontsContractCompat.FontFamilyResult

Artifact:[androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core)  
[View Source](https://cs.android.com/search?q=file:androidx/core/provider/FontsContractCompat.java+class:androidx.core.provider.FontsContractCompat.FontFamilyResult)  
Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/core/provider/FontsContractCompat.FontFamilyResult "View this page in Java")

<br />

```
class FontsContractCompat.FontFamilyResult
```

<br />

*** ** * ** ***

Object returned from[fetchFonts](https://developer.android.com/reference/kotlin/androidx/core/provider/FontsContractCompat#fetchFonts(android.content.Context,android.os.CancellationSignal,androidx.core.provider.FontRequest)).

## Summary

|                                    ### Constants                                    |
|-------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [STATUS_OK](https://developer.android.com/reference/kotlin/androidx/core/provider/FontsContractCompat.FontFamilyResult#STATUS_OK())` = 0` Constant represents that the font was successfully retrieved.                                                                 |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [STATUS_UNEXPECTED_DATA_PROVIDED](https://developer.android.com/reference/kotlin/androidx/core/provider/FontsContractCompat.FontFamilyResult#STATUS_UNEXPECTED_DATA_PROVIDED())` = 2` Constant represents that the provider returns unexpected data.                    |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [STATUS_WRONG_CERTIFICATES](https://developer.android.com/reference/kotlin/androidx/core/provider/FontsContractCompat.FontFamilyResult#STATUS_WRONG_CERTIFICATES())` = 1` Constant represents that the given certificate was not matched with the provider's signature. |

|                                                                                                                                                                                                       ### Public functions                                                                                                                                                                                                       |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[FontsContractCompat.FontInfo](https://developer.android.com/reference/kotlin/androidx/core/provider/FontsContractCompat.FontInfo)`!>!`                                                                                                                                                                                                        | [getFonts](https://developer.android.com/reference/kotlin/androidx/core/provider/FontsContractCompat.FontFamilyResult#getFonts())`()` For a single request, returns an array of the fonts making up the family.                             |
| `(`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[FontsContractCompat.FontInfo](https://developer.android.com/reference/kotlin/androidx/core/provider/FontsContractCompat.FontInfo)`!>!>` | [getFontsWithFallbacks](https://developer.android.com/reference/kotlin/androidx/core/provider/FontsContractCompat.FontFamilyResult#getFontsWithFallbacks())`()` Returns a list of arrays of fonts for each font family requested, in order. |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                                                                                                                                                                                                                                                                      | [getStatusCode](https://developer.android.com/reference/kotlin/androidx/core/provider/FontsContractCompat.FontFamilyResult#getStatusCode())`()`                                                                                             |

## Constants

### STATUS_OK

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
const val STATUS_OK = 0: Int
```

Constant represents that the font was successfully retrieved. Note that when this value is set and[getFonts](https://developer.android.com/reference/kotlin/androidx/core/provider/FontsContractCompat.FontFamilyResult#getFonts())returns an empty array, it means there were no fonts matching the given query.  

### STATUS_UNEXPECTED_DATA_PROVIDED

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
const val STATUS_UNEXPECTED_DATA_PROVIDED = 2: Int
```

Constant represents that the provider returns unexpected data.[getFonts](https://developer.android.com/reference/kotlin/androidx/core/provider/FontsContractCompat.FontFamilyResult#getFonts())returns null if this status was set. For example, this value is set when the font provider gives invalid format of variation settings.  

### STATUS_WRONG_CERTIFICATES

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
const val STATUS_WRONG_CERTIFICATES = 1: Int
```

Constant represents that the given certificate was not matched with the provider's signature.[getFonts](https://developer.android.com/reference/kotlin/androidx/core/provider/FontsContractCompat.FontFamilyResult#getFonts())returns null if this status was set.  

## Public functions

### getFonts

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun getFonts(): Array<FontsContractCompat.FontInfo!>!
```

For a single request, returns an array of the fonts making up the family.

For a request with fallbacks, use[getFontsWithFallbacks](https://developer.android.com/reference/kotlin/androidx/core/provider/FontsContractCompat.FontFamilyResult#getFontsWithFallbacks()), as this will only return the information for the first requested family.  

### getFontsWithFallbacks

Added in[1.15.0](https://developer.android.com/jetpack/androidx/releases/core#1.15.0)  

```
fun getFontsWithFallbacks(): (Mutable)List<Array<FontsContractCompat.FontInfo!>!>
```

Returns a list of arrays of fonts for each font family requested, in order.  

### getStatusCode

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun getStatusCode(): Int
```