getFont
Returns a font Typeface associated with a particular resource ID.
This method will block the calling thread to retrieve the requested font, including if it is from a font provider. If you wish to not have this behavior, use getFont instead.
Prior to API level 23, font resources with more than one font in a family will only load the font closest to a regular weight typeface.
Return
A font Typeface object.
Parameters
A context to retrieve the Resources from.
The desired resource identifier of a Typeface, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier.
See also
Throws
Throws NotFoundException if the given ID does not exist.
Returns a font Typeface associated with a particular resource ID asynchronously.
Prior to API level 23, font resources with more than one font in a family will only load the font closest to a regular weight typeface.
Parameters
A context to retrieve the Resources from.
The desired resource identifier of a Typeface, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier.
A callback to receive async fetching of this font. The callback will be triggered on the UI thread.
A handler for the thread the callback should be called on. If null, the callback will be called on the UI thread.
Throws
Throws NotFoundException if the given ID does not exist.
Used by TintTypedArray.