FontsContractCompat.FontFamilyResult

Added in 1.1.0

public class FontsContractCompat.FontFamilyResult


Object returned from fetchFonts.

Summary

Constants

static final int

Constant represents that the font was successfully retrieved.

static final int

Constant represents that the provider returns unexpected data.

static final int

Constant represents that the given certificate was not matched with the provider's signature.

Public methods

FontsContractCompat.FontInfo[]

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

@NonNull List<FontsContractCompat.FontInfo[]>

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

int

Constants

STATUS_OK

Added in 1.1.0
public static final int STATUS_OK = 0

Constant represents that the font was successfully retrieved. Note that when this value is set and getFonts returns an empty array, it means there were no fonts matching the given query.

STATUS_UNEXPECTED_DATA_PROVIDED

Added in 1.1.0
public static final int STATUS_UNEXPECTED_DATA_PROVIDED = 2

Constant represents that the provider returns unexpected data. 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
public static final int STATUS_WRONG_CERTIFICATES = 1

Constant represents that the given certificate was not matched with the provider's signature. getFonts returns null if this status was set.

Public methods

getFonts

Added in 1.1.0
public FontsContractCompat.FontInfo[] getFonts()

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

For a request with fallbacks, use getFontsWithFallbacks, as this will only return the information for the first requested family.

getFontsWithFallbacks

Added in 1.15.0
public @NonNull List<FontsContractCompat.FontInfo[]> getFontsWithFallbacks()

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

getStatusCode

Added in 1.1.0
public int getStatusCode()