Added in API level 26
Deprecated in API level 31

FontsContract.FontFamilyResult


public static class FontsContract.FontFamilyResult
extends Object

java.lang.Object
   ↳ android.provider.FontsContract.FontFamilyResult


This class was deprecated in API level 31.
Use the FontsContractCompat.FontFamilyResult for consistent behavior across all devices

Object returned from FontsContract.fetchFonts(Context, CancellationSignal, FontRequest).

Summary

Constants

int STATUS_OK

Constant represents that the font was successfully retrieved.

int STATUS_REJECTED

Constant represents that the fetching font data was rejected by system.

int STATUS_UNEXPECTED_DATA_PROVIDED

Constant represents that the provider returns unexpected data.

int STATUS_WRONG_CERTIFICATES

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

Public methods

FontInfo[] getFonts()
int getStatusCode()

Inherited methods

Constants

STATUS_OK

Added in API level 26
public static final int STATUS_OK

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.

Constant Value: 0 (0x00000000)

STATUS_REJECTED

Added in API level 26
public static final int STATUS_REJECTED

Constant represents that the fetching font data was rejected by system. This happens if the passed context is restricted.

Constant Value: 3 (0x00000003)

STATUS_UNEXPECTED_DATA_PROVIDED

Added in API level 26
public static final int STATUS_UNEXPECTED_DATA_PROVIDED

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.

Constant Value: 2 (0x00000002)

STATUS_WRONG_CERTIFICATES

Added in API level 26
public static final int STATUS_WRONG_CERTIFICATES

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

Constant Value: 1 (0x00000001)

Public methods

getFonts

Added in API level 26
public FontInfo[] getFonts ()

Returns
FontInfo[] This value cannot be null.

getStatusCode

Added in API level 26
public int getStatusCode ()

Returns
int Value is STATUS_OK, STATUS_WRONG_CERTIFICATES, or STATUS_UNEXPECTED_DATA_PROVIDED