Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

TypefaceCompat

open class TypefaceCompat
kotlin.Any
   ↳ androidx.core.graphics.TypefaceCompat

Helper for accessing features in Typeface.

Summary

Public methods
open static Typeface
create(@NonNull context: Context, @Nullable family: Typeface?, style: Int)

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 Context: The font family. May be null.
style Context: 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.