Skip to content

Most visited

Recently visited

navigation

FontsContract.Columns

public static final class FontsContract.Columns
extends Object implements BaseColumns

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


Defines the constants used in a response from a Font Provider. The cursor returned from the query should have the ID column populated with the content uri ID for the resulting font. This should point to a real file or shared memory, as the client will mmap the given file descriptor. Pipes, sockets and other non-mmap-able file descriptors will fail to load in the client application.

Summary

Constants

String FILE_ID

Constant used to request data from a font provider.

String ITALIC

Constant used to request data from a font provider.

String RESULT_CODE

Constant used to request data from a font provider.

int RESULT_CODE_FONT_NOT_FOUND

Constant used to represent a result was not found.

int RESULT_CODE_FONT_UNAVAILABLE

Constant used to represent a result was found, but cannot be provided at this moment.

int RESULT_CODE_MALFORMED_QUERY

Constant used to represent that the query was not in a supported format by the provider.

int RESULT_CODE_OK

Constant used to represent a result was retrieved successfully.

String TTC_INDEX

Constant used to request data from a font provider.

String VARIATION_SETTINGS

Constant used to request data from a font provider.

String WEIGHT

Constant used to request data from a font provider.

Inherited constants

From interface android.provider.BaseColumns

Inherited methods

From class java.lang.Object

Constants

FILE_ID

added in API level 26
String FILE_ID

Constant used to request data from a font provider. The cursor returned from the query may populate this column with a long for the font file ID. The client will request a file descriptor to "file/FILE_ID" with this ID immediately under the top-level content URI. If not present, the client will request a file descriptor to the top-level URI with the given base font ID. Note that several results may return the same file ID, e.g. for TTC files with different indices.

Constant Value: "file_id"

ITALIC

added in API level 26
String ITALIC

Constant used to request data from a font provider. The cursor returned from the query should have this column populated with the int italic for the resulting font. This should be 0 for regular style and 1 for italic.

Constant Value: "font_italic"

RESULT_CODE

added in API level 26
String RESULT_CODE

Constant used to request data from a font provider. The cursor returned from the query should have this column populated to indicate the result status of the query. This will be checked before any other data in the cursor. Possible values are RESULT_CODE_OK, RESULT_CODE_FONT_NOT_FOUND, RESULT_CODE_MALFORMED_QUERY and RESULT_CODE_FONT_UNAVAILABLE for system defined values. You may also define your own values in the 0x000010000..0xFFFF0000 range. If not present, RESULT_CODE_OK will be assumed.

Constant Value: "result_code"

RESULT_CODE_FONT_NOT_FOUND

added in API level 26
int RESULT_CODE_FONT_NOT_FOUND

Constant used to represent a result was not found. See RESULT_CODE.

Constant Value: 1 (0x00000001)

RESULT_CODE_FONT_UNAVAILABLE

added in API level 26
int RESULT_CODE_FONT_UNAVAILABLE

Constant used to represent a result was found, but cannot be provided at this moment. Use this to indicate, for example, that a font needs to be fetched from the network. See RESULT_CODE.

Constant Value: 2 (0x00000002)

RESULT_CODE_MALFORMED_QUERY

added in API level 26
int RESULT_CODE_MALFORMED_QUERY

Constant used to represent that the query was not in a supported format by the provider. See RESULT_CODE.

Constant Value: 3 (0x00000003)

RESULT_CODE_OK

added in API level 26
int RESULT_CODE_OK

Constant used to represent a result was retrieved successfully. The given fonts will be attempted to retrieve immediately via openFile(Uri, String). See RESULT_CODE.

Constant Value: 0 (0x00000000)

TTC_INDEX

added in API level 26
String TTC_INDEX

Constant used to request data from a font provider. The cursor returned from the query should have this column populated with an int for the ttc index for the resulting font.

Constant Value: "font_ttc_index"

VARIATION_SETTINGS

added in API level 26
String VARIATION_SETTINGS

Constant used to request data from a font provider. The cursor returned from the query may populate this column with the font variation settings String information for the font.

Constant Value: "font_variation_settings"

WEIGHT

added in API level 26
String WEIGHT

Constant used to request data from a font provider. The cursor returned from the query should have this column populated with the int weight for the resulting font. This value should be between 100 and 900. The most common values are 400 for regular weight and 700 for bold weight.

Constant Value: "font_weight"

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!

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)