TextAppearance

Utility class that contains the data from parsing a TextAppearance style resource.

Constructors

Link copied to clipboard
constructor(@NonNull context: Context, @StyleRes id: Int)
Parses the given TextAppearance style resource.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var textSize: Float
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Returns a fallback Typeface that is retrieved synchronously, in case the actual font is not yet resolved or pending async fetch or an actual Typeface if resolved already.
Link copied to clipboard
Synchronously resolves the font Typeface using the fontFamily, style, and typeface.
Link copied to clipboard
Resolves the requested font using the fontFamily, style, and typeface.
open fun getFontAsync(@NonNull context: Context, @NonNull textPaint: TextPaint, @NonNull callback: TextAppearanceFontCallback)
Asynchronously resolves the requested font Typeface using the fontFamily, style, and typeface, and automatically updates given textPaint using updateTextPaintMeasureState on successful load.
Link copied to clipboard
open fun updateDrawState(@NonNull context: Context, @NonNull textPaint: TextPaint, @NonNull callback: TextAppearanceFontCallback)
Applies the attributes that affect drawing from TextAppearance to the given TextPaint.
Link copied to clipboard
open fun updateMeasureState(@NonNull context: Context, @NonNull textPaint: TextPaint, @NonNull callback: TextAppearanceFontCallback)
Applies the attributes that affect measurement from TextAppearance to the given TextPaint.
Link copied to clipboard
open fun updateTextPaintMeasureState(@NonNull context: Context, @NonNull textPaint: TextPaint, @NonNull typeface: Typeface)
Applies the attributes that affect measurement from Typeface to the given TextPaint.