# FontRequest

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

*** ** * ** ***


```
public final class FontRequest
```

<br />

*** ** * ** ***

Information about a font request that may be sent to a Font Provider.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/core/provider/FontRequest#FontRequest(java.lang.String,java.lang.String,java.lang.String,int)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html providerAuthority, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html providerPackage, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html query, @https://developer.android.com/reference/androidx/annotation/ArrayRes int certificates )` |
| `https://developer.android.com/reference/androidx/core/provider/FontRequest#FontRequest(java.lang.String,java.lang.String,java.lang.String,java.util.List<java.util.List<byte[]>>)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html providerAuthority, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html providerPackage, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html query, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/util/List.html<byte[]>> certificates )` |
| `https://developer.android.com/reference/androidx/core/provider/FontRequest#FontRequest(java.lang.String,java.lang.String,java.lang.String,int,java.lang.String)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html providerAuthority, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html providerPackage, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html query, @https://developer.android.com/reference/androidx/annotation/ArrayRes int certificates, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html variationSettings )` |
| `https://developer.android.com/reference/androidx/core/provider/FontRequest#FontRequest(java.lang.String,java.lang.String,java.lang.String,java.util.List<java.util.List<byte[]>>,java.lang.String)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html providerAuthority, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html providerPackage, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html query, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/util/List.html<byte[]>> certificates, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html variationSettings )` |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/util/List.html<byte[]>>` | `https://developer.android.com/reference/androidx/core/provider/FontRequest#getCertificates()()` Returns the list of certificate sets given for this provider. |
| `@https://developer.android.com/reference/androidx/annotation/ArrayRes int` | `https://developer.android.com/reference/androidx/core/provider/FontRequest#getCertificatesArrayResId()()` Returns the array resource id pointing to the certificate sets given for this provider. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/core/provider/FontRequest#getProviderAuthority()()` Returns the selected font provider's authority. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/core/provider/FontRequest#getProviderPackage()()` Returns the selected font provider's package. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/core/provider/FontRequest#getQuery()()` Returns the query string. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/core/provider/FontRequest#toString()()` |

## Public constructors

### FontRequest

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

```
public FontRequest(
    @NonNull String providerAuthority,
    @NonNull String providerPackage,
    @NonNull String query,
    @ArrayRes int certificates
)
```

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html providerAuthority` | The authority of the Font Provider to be used for the request. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html providerPackage` | The package for the Font Provider to be used for the request. This is used to verify the identity of the provider. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html query` | The query to be sent over to the provider. Refer to your font provider's documentation on the format of this string. |
| `@https://developer.android.com/reference/androidx/annotation/ArrayRes int certificates` | A resource array with the list of sets of hashes for the certificates the provider should be signed with. This is used to verify the identity of the provider. Each set in the list represents one collection of signature hashes. Refer to your font provider's documentation for these values. |

### FontRequest

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

```
public FontRequest(
    @NonNull String providerAuthority,
    @NonNull String providerPackage,
    @NonNull String query,
    @NonNull List<List<byte[]>> certificates
)
```

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html providerAuthority` | The authority of the Font Provider to be used for the request. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html providerPackage` | The package for the Font Provider to be used for the request. This is used to verify the identity of the provider. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html query` | The query to be sent over to the provider. Refer to your font provider's documentation on the format of this string. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/util/List.html<byte[]>> certificates` | The list of sets of hashes for the certificates the provider should be signed with. This is used to verify the identity of the provider. Each set in the list represents one collection of signature hashes. Refer to your font provider's documentation for these values. |

### FontRequest

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

```
public FontRequest(
    @NonNull String providerAuthority,
    @NonNull String providerPackage,
    @NonNull String query,
    @ArrayRes int certificates,
    @Nullable String variationSettings
)
```

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html providerAuthority` | The authority of the Font Provider to be used for the request. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html providerPackage` | The package for the Font Provider to be used for the request. This is used to verify the identity of the provider. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html query` | The query to be sent over to the provider. Refer to your font provider's documentation on the format of this string. |
| `@https://developer.android.com/reference/androidx/annotation/ArrayRes int certificates` | A resource array with the list of sets of hashes for the certificates the provider should be signed with. This is used to verify the identity of the provider. Each set in the list represents one collection of signature hashes. Refer to your font provider's documentation for these values. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html variationSettings` | `https://developer.android.com/reference/java/lang/String.html` specifying the font variation settings (e.g. standard axes like weight, width, and slant, or custom axes) to be applied to a variable font when it is loaded. See `https://developer.android.com/reference/android/graphics/Paint.html#setFontVariationSettings(java.lang.String)` for more information about the format of the string. Supported on API 26 (Android O) and above. Note that these settings will only be effective if the font provider actually returns a variable font. |

### FontRequest

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

```
public FontRequest(
    @NonNull String providerAuthority,
    @NonNull String providerPackage,
    @NonNull String query,
    @NonNull List<List<byte[]>> certificates,
    @Nullable String variationSettings
)
```

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html providerAuthority` | The authority of the Font Provider to be used for the request. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html providerPackage` | The package for the Font Provider to be used for the request. This is used to verify the identity of the provider. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html query` | The query to be sent over to the provider. Refer to your font provider's documentation on the format of this string. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/util/List.html<byte[]>> certificates` | The list of sets of hashes for the certificates the provider should be signed with. This is used to verify the identity of the provider. Each set in the list represents one collection of signature hashes. Refer to your font provider's documentation for these values. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html variationSettings` | `https://developer.android.com/reference/java/lang/String.html` specifying the font variation settings (e.g. standard axes like weight, width, and slant, or custom axes) to be applied to a variable font when it is loaded. See `https://developer.android.com/reference/android/graphics/Paint.html#setFontVariationSettings(java.lang.String)` for more information about the format of the string. Supported on API 26 (Android O) and above. Note that these settings will only be effective if the font provider actually returns a variable font. |

## Public methods

### getCertificates

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

```
public @Nullable List<List<byte[]>> getCertificates()
```

Returns the list of certificate sets given for this provider. This helps the system verify that the provider identified by the given authority is the one requested. Note this might be null if the certificates were provided via a resource id.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/provider/FontRequest#getCertificatesArrayResId()` |   |

### getCertificatesArrayResId

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

```
public @ArrayRes int getCertificatesArrayResId()
```

Returns the array resource id pointing to the certificate sets given for this provider. This helps the system verify that the provider identified by the given authority is the one requested. Note that this may be 0 if the certificates were provided as a list.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/provider/FontRequest#getCertificates()` |   |

### getProviderAuthority

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

```
public @NonNull String getProviderAuthority()
```

Returns the selected font provider's authority. This tells the system what font provider it should request the font from.

### getProviderPackage

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

```
public @NonNull String getProviderPackage()
```

Returns the selected font provider's package. This helps the system verify that the provider identified by the given authority is the one requested.

### getQuery

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

```
public @NonNull String getQuery()
```

Returns the query string. Refer to your font provider's documentation on the format of this string.

### toString

```
public @NonNull String toString()
```