FontRequest.Builder


class FontRequest.Builder


Builder for constructing FontRequest instances.

Summary

Public constructors

Builder(request: FontRequest)

Constructs a new Builder initialized with the properties of an existing FontRequest.

Builder(
    providerAuthority: String,
    providerPackage: String,
    query: String,
    systemCertificates: @ArrayRes Int
)

Constructs a new Builder for a system font provider.

Public functions

FontRequest

Builds and returns the FontRequest instance.

FontRequest.Builder
setDebugFallbackCertificates(debugFallbackCertificates: @ArrayRes Int)

Sets the optional debug fallback certificate resource array ID used to verify a non-system font provider during development or testing (for example, when testing against a local development build of GMSCore or running in Robolectric).

FontRequest.Builder
setVariationSettings(variationSettings: String)

Sets the font variation settings to be applied to a variable font when loaded.

Public constructors

Builder

Builder(request: FontRequest)

Constructs a new Builder initialized with the properties of an existing FontRequest.

Builder

Builder(
    providerAuthority: String,
    providerPackage: String,
    query: String,
    systemCertificates: @ArrayRes Int
)

Constructs a new Builder for a system font provider.

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.

query: String

The query to be sent over to the provider.

systemCertificates: @ArrayRes Int

A resource array with the list of sets of hashes for the certificates the system provider should be signed with. The provider package must be installed on the system image (FLAG_SYSTEM or FLAG_UPDATED_SYSTEM_APP).

Public functions

build

fun build(): FontRequest

Builds and returns the FontRequest instance.

setDebugFallbackCertificates

fun setDebugFallbackCertificates(debugFallbackCertificates: @ArrayRes Int): FontRequest.Builder

Sets the optional debug fallback certificate resource array ID used to verify a non-system font provider during development or testing (for example, when testing against a local development build of GMSCore or running in Robolectric).

Warning: Certificates provided here do not require FLAG_SYSTEM and bypass system app verification. Only use this method during development or testing.

setVariationSettings

fun setVariationSettings(variationSettings: String): FontRequest.Builder

Sets the font variation settings to be applied to a variable font when loaded.