Skip to content

Most visited

Recently visited

navigation

FontsContract.FontFamilyResult

public static class FontsContract.FontFamilyResult
extends Object

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


Object returned from 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

From class java.lang.Object

Constants

STATUS_OK

added in API level 26
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
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
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
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
FontInfo[] getFonts ()

Returns
FontInfo[]

This value will never be null.

getStatusCode

added in API level 26
int getStatusCode ()

Returns
int

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)