FontsContractCompat

Utility class to deal with Font ContentProviders.

Types

Link copied to clipboard
Defines the constants used in a response from a Font Provider.
Link copied to clipboard
open class FontFamilyResult
Object returned from fetchFonts.
Link copied to clipboard
open class FontInfo
Object represent a font entry in the family returned from fetchFonts.
Link copied to clipboard
Interface used to receive asynchronously fetched typefaces.
Link copied to clipboard

Properties

Link copied to clipboard
Constant used to identify the List of ParcelFileDescriptor item in the Bundle returned to the ResultReceiver in getFont.

Functions

Link copied to clipboard
Build a Typeface from an array of FontInfo Results that are marked as not ready will be skipped.
Link copied to clipboard
Fetch fonts given a font request.
Link copied to clipboard
open fun getFontSync(context: Context, request: FontRequest, @Nullable fontCallback: ResourcesCompat.FontCallback, @Nullable handler: Handler, isBlockingFetch: Boolean, timeout: Int, style: Int): Typeface
Link copied to clipboard
Link copied to clipboard
A helper function to create a mapping from Uri to ByteBuffer.
Link copied to clipboard
Create a typeface object given a font request.
open fun requestFont(@NonNull context: Context, @NonNull request: FontRequest, style: Int, @Nullable loadingExecutor: Executor, @NonNull callbackExecutor: Executor, @NonNull callback: FontsContractCompat.FontRequestCallback)
Request a font async as specified with FontRequest Loading may take several seconds, and the loadingExecutor passed should be available to run blocking requests for several seconds.
open fun requestFont(@NonNull context: Context, @NonNull request: FontRequest, style: Int, isBlockingFetch: Boolean, @IntRange(from = 0) timeout: Int, @NonNull handler: Handler, @NonNull callback: FontsContractCompat.FontRequestCallback): Typeface
open fun requestFont(@NonNull context: Context, @NonNull requests: List<FontRequest>, style: Int, isBlockingFetch: Boolean, @IntRange(from = 0) timeout: Int, @NonNull handler: Handler, @NonNull callback: FontsContractCompat.FontRequestCallback): Typeface
Loads a Typeface.
Link copied to clipboard
open fun requestFontWithFallbackChain(@NonNull context: Context, @NonNull requests: List<FontRequest>, style: Int, @Nullable loadingExecutor: Executor, @NonNull callbackExecutor: Executor, @NonNull callback: FontsContractCompat.FontRequestCallback)
Request a font async as specified with FontRequest Loading may take several seconds, and the loadingExecutor passed should be available to run blocking requests for several seconds.
Link copied to clipboard
Link copied to clipboard