TypefaceCompat
open class TypefaceCompat
Helper for accessing features in Typeface
.
Summary
Public methods |
open static Typeface |
Retrieves the best matching typeface given the family, style and context.
|
Public methods
create
@NonNull open static fun create(
@NonNull context: Context,
@Nullable family: Typeface?,
style: Int
): Typeface
Retrieves the best matching typeface given the family, style and context. If null is passed for the family, then the "default" font will be chosen.
Parameters |
family |
Typeface?: The font family. May be null. |
style |
Int: The style of the typeface. e.g. NORMAL, BOLD, ITALIC, BOLD_ITALIC |
context |
Context: The context used to retrieve the font. |
Return |
Typeface |
The best matching typeface. |