Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

FontsContract.FontFamilyResult

public static class FontsContract.FontFamilyResult
extends Object

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


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 will never 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.