FontRequest

Added in 1.1.0

class FontRequest


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

Summary

Nested types

Builder for constructing FontRequest instances.

Public constructors

FontRequest(
    providerAuthority: String,
    providerPackage: String,
    query: String,
    certificates: @ArrayRes Int
)
FontRequest(
    providerAuthority: String,
    providerPackage: String,
    query: String,
    certificates: (Mutable)List<(Mutable)List<ByteArray<Byte>!>!>
)
FontRequest(
    providerAuthority: String,
    providerPackage: String,
    query: String,
    certificates: @ArrayRes Int,
    variationSettings: String?
)
FontRequest(
    providerAuthority: String,
    providerPackage: String,
    query: String,
    certificates: (Mutable)List<(Mutable)List<ByteArray<Byte>!>!>,
    variationSettings: String?
)

Public functions

(Mutable)List<(Mutable)List<Array<Byte>!>!>?

Returns the list of certificate sets given for this provider.

@ArrayRes Int

Returns the array resource id pointing to the certificate sets given for this provider.

@ArrayRes Int

Returns the array resource id pointing to the debug fallback certificate sets given for this provider, or 0 if not set.

String

Returns the selected font provider's authority.

String

Returns the selected font provider's package.

String

Returns the query string.

(Mutable)List<(Mutable)List<Array<Byte>!>!>?

Returns the list of system certificate sets given for this provider.

@ArrayRes Int

Returns the array resource id pointing to the system certificate sets given for this provider.

String?

Returns the font variation settings.

String

Public constructors

FontRequest

Added in 1.1.0
FontRequest(
    providerAuthority: String,
    providerPackage: String,
    query: String,
    certificates: @ArrayRes Int
)
Parameters
providerAuthority: String

The authority of the Font Provider to be used for the request.

providerPackage: String

The package for the Font Provider to be used for the request. This is used to verify the identity of the provider.

query: String

The query to be sent over to the provider. Refer to your font provider's documentation on the format of this string.

certificates: @ArrayRes Int

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
FontRequest(
    providerAuthority: String,
    providerPackage: String,
    query: String,
    certificates: (Mutable)List<(Mutable)List<ByteArray<Byte>!>!>
)
Parameters
providerAuthority: String

The authority of the Font Provider to be used for the request.

providerPackage: String

The package for the Font Provider to be used for the request. This is used to verify the identity of the provider.

query: String

The query to be sent over to the provider. Refer to your font provider's documentation on the format of this string.

certificates: (Mutable)List<(Mutable)List<ByteArray<Byte>!>!>

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.0
FontRequest(
    providerAuthority: String,
    providerPackage: String,
    query: String,
    certificates: @ArrayRes Int,
    variationSettings: String?
)
Parameters
providerAuthority: String

The authority of the Font Provider to be used for the request.

providerPackage: String

The package for the Font Provider to be used for the request. This is used to verify the identity of the provider.

query: String

The query to be sent over to the provider. Refer to your font provider's documentation on the format of this string.

certificates: @ArrayRes Int

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.

variationSettings: String?

String 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 setFontVariationSettings 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.0
FontRequest(
    providerAuthority: String,
    providerPackage: String,
    query: String,
    certificates: (Mutable)List<(Mutable)List<ByteArray<Byte>!>!>,
    variationSettings: String?
)
Parameters
providerAuthority: String

The authority of the Font Provider to be used for the request.

providerPackage: String

The package for the Font Provider to be used for the request. This is used to verify the identity of the provider.

query: String

The query to be sent over to the provider. Refer to your font provider's documentation on the format of this string.

certificates: (Mutable)List<(Mutable)List<ByteArray<Byte>!>!>

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.

variationSettings: String?

String 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 setFontVariationSettings 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 functions

getCertificates

Added in 1.1.0
fun getCertificates(): (Mutable)List<(Mutable)List<Array<Byte>!>!>?

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.

getCertificatesArrayResId

Added in 1.1.0
fun getCertificatesArrayResId(): @ArrayRes Int

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
getCertificates

getDebugFallbackCertificatesArrayResId

fun getDebugFallbackCertificatesArrayResId(): @ArrayRes Int

Returns the array resource id pointing to the debug fallback certificate sets given for this provider, or 0 if not set.

getProviderAuthority

Added in 1.1.0
fun getProviderAuthority(): String

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
fun getProviderPackage(): String

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
fun getQuery(): String

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

getSystemCertificates

fun getSystemCertificates(): (Mutable)List<(Mutable)List<Array<Byte>!>!>?

Returns the list of system certificate sets given for this provider. This helps the system verify that the provider identified by the given authority is the one requested, and is only trusted if the provider is installed as a system application (FLAG_SYSTEM or FLAG_UPDATED_SYSTEM_APP). Note this might be null if the certificates were provided via a resource id.

getSystemCertificatesArrayResId

fun getSystemCertificatesArrayResId(): @ArrayRes Int

Returns the array resource id pointing to the system certificate sets given for this provider. This helps the system verify that the provider identified by the given authority is the one requested, and is only trusted if the provider is installed as a system application (FLAG_SYSTEM or FLAG_UPDATED_SYSTEM_APP). Note that this may be 0 if the certificates were provided as a list.

getVariationSettings

fun getVariationSettings(): String?

Returns the font variation settings. See setFontVariationSettings for more information about the format of the string.

toString

fun toString(): String