added in version 26.1.0
belongs to Maven artifact


public class FontsContractCompat
extends Object


Utility class to deal with Font ContentProviders.


Nested classes

class FontsContractCompat.Columns

Defines the constants used in a response from a Font Provider. 

class FontsContractCompat.FontFamilyResult

Object returned from fetchFonts(Context, CancellationSignal, FontRequest)

class FontsContractCompat.FontInfo

Object represent a font entry in the family returned from fetchFonts(Context, CancellationSignal, FontRequest)

class FontsContractCompat.FontRequestCallback

Interface used to receive asynchronously fetched typefaces. 

Public methods

static Typeface buildTypeface(Context context, CancellationSignal cancellationSignal, FontInfo[] fonts)

Build a Typeface from an array of FontsContractCompat.FontInfo Results that are marked as not ready will be skipped.

static FontsContractCompat.FontFamilyResult fetchFonts(Context context, CancellationSignal cancellationSignal, FontRequest request)

Fetch fonts given a font request.

static void requestFont(Context context, FontRequest request, FontsContractCompat.FontRequestCallback callback, Handler handler)

Create a typeface object given a font request.

Inherited methods

From class java.lang.Object

Public methods


added in version 26.1.0
Typeface buildTypeface (Context context,