# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Nested Classes | Methods | Inherited Methods

# FontsContract

`public class FontsContract`
`extends Object` ``

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

Utility class to deal with Font ContentProviders.

## Summary

### Nested classes
`class` | `FontsContract.Columns` Defines the constants used in a response from a Font Provider.
`class` | `FontsContract.FontFamilyResult` Object returned from `FontsContract.fetchFonts(Context, CancellationSignal, FontRequest)`.
`class` | `FontsContract.FontInfo` Object represent a font entry in the family returned from `FontsContract.fetchFonts(Context, CancellationSignal, FontRequest)`.
`class` | `FontsContract.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 `FontInfo` Results that are marked as not ready will be skipped.
`static FontsContract.FontFamilyResult` | `fetchFonts(Context context, CancellationSignal cancellationSignal, FontRequest request)` Fetch fonts given a font request.
`static void` | `requestFonts(Context context, FontRequest request, Handler handler, CancellationSignal cancellationSignal, FontsContract.FontRequestCallback callback)` Create a typeface object given a font request.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public methods

### buildTypeface

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

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

Parameters
`context` | `Context`: A `Context` that will be used to fetch the font contents. This value cannot be `null`.
`cancellationSignal` | `CancellationSignal`: A signal to cancel the operation in progress, or null if none. If the operation is canceled, then `OperationCanceledException` will be thrown. This value may be `null`.
`fonts` | `FontInfo`: An array of `FontInfo` to be used to create a Typeface. This value cannot be `null`.

Returns
`Typeface` | A Typeface object. Returns null if typeface creation fails.

### fetchFonts

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

Fetch fonts given a font request.

Parameters
`context` | `Context`: A `Context` to be used for fetching fonts. This value cannot be `null`.
`cancellationSignal` | `CancellationSignal`: A signal to cancel the operation in progress, or null if none. If the operation is canceled, then `OperationCanceledException` will be thrown when the query is executed. This value may be `null`.
`request` | `FontRequest`: A `FontRequest` object that identifies the provider and query for the request. This value cannot be `null`.

Returns
`FontsContract.FontFamilyResult` | `FontFamilyResult`

Throws
`PackageManager.NameNotFoundException` | If requested package or authority was not found in system.

### requestFonts

    public static void requestFonts (Context context,
                    FontRequest request,
                    Handler handler,
                    CancellationSignal cancellationSignal,
                    FontsContract.FontRequestCallback callback)

Create a typeface object given a font request. The font will be asynchronously fetched, therefore the result is delivered to the given callback. See `FontRequest`. Only one of the methods in callback will be invoked, depending on whether the request succeeds or fails. These calls will happen on the caller thread. Note that the result Typeface may be cached internally and the same instance will be returned the next time you call this method with the same request. If you want to bypass this cache, use `fetchFonts(Context, CancellationSignal, FontRequest)` and `buildTypeface(Context, CancellationSignal, FontsContract.FontInfo[])` instead.

Parameters
`context` | `Context`: A context to be used for fetching from font provider. This value cannot be `null`.
`request` | `FontRequest`: A `FontRequest` object that identifies the provider and query for the request. May not be null. This value cannot be `null`.
`handler` | `Handler`: A handler to be processed the font fetching. This value cannot be `null`.
`cancellationSignal` | `CancellationSignal`: A signal to cancel the operation in progress, or null if none. If the operation is canceled, then `OperationCanceledException` will be thrown. This value may be `null`.
`callback` | `FontsContract.FontRequestCallback`: A callback that will be triggered when results are obtained. May not be null. This value cannot be `null`.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*