Google is committed to advancing racial equity for Black communities. See how.

TypefaceSpan

class TypefaceSpan : MetricAffectingSpan
kotlin.Any
   ↳ android.text.style.CharacterStyle
   ↳ android.text.style.MetricAffectingSpan
   ↳ androidx.compose.ui.text.android.style.TypefaceSpan

Span that displays text in the given Typeface. In Android Framework, TypefaceSpan that accepts a Typeface as constructor argument was added in API 28, therefore was not usable before 28.

Summary

Public methods
Unit

Unit

Properties
Typeface

Typeface to render the text with.

Public methods

updateDrawState

fun updateDrawState(ds: TextPaint): Unit

updateMeasureState

fun updateMeasureState(paint: TextPaint): Unit

Properties

typeface

val typeface: Typeface

Typeface to render the text with.