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

androidx.ui.text.platform

Top-level functions summary

Typeface
typefaceFromFontFamily(context: Context, fontFamily: FontFamily, necessaryStyles: List<Pair<FontWeight, FontStyle>>? = null)

Android specific Typeface builder function from FontFamily.

Top-level properties summary

(paragraphIntrinsics: ParagraphIntrinsics, maxLines: Int, ellipsis: Boolean, constraints: ParagraphConstraints) -> Paragraph

(text: String, style: TextStyle, spanStyles: List<AnnotatedString.Range<SpanStyle>>, placeholders: List<AnnotatedString.Range<Placeholder>>, density: Density, resourceLoader: Font.ResourceLoader) -> ParagraphIntrinsics

Top-level functions

typefaceFromFontFamily

fun typefaceFromFontFamily(
    context: Context,
    fontFamily: FontFamily,
    necessaryStyles: List<Pair<FontWeight, FontStyle>>? = null
): Typeface

Android specific Typeface builder function from FontFamily.

You can pass necessaryStyles for loading only specific styles. The font style matching happens only with the loaded Typeface.

This function caches the internal native Typeface but always create the new Typeface object. Caller should cache if necessary.

Parameters
context: Context the context to be used for loading Typeface.
fontFamily: FontFamily the font family to be loaded
necessaryStyles: List<Pair<FontWeight, FontStyle>>? = null optional style filter for loading subset of fontFamily. null means load all fonts in fontFamily.
Return
A loaded Typeface.

Top-level properties

paragraphActualFactory

var paragraphActualFactory: (paragraphIntrinsics: ParagraphIntrinsics, maxLines: Int, ellipsis: Boolean, constraints: ParagraphConstraints) -> Paragraph

Deprecated.

paragraphIntrinsicsActualFactory

var paragraphIntrinsicsActualFactory: (text: String, style: TextStyle, spanStyles: List<AnnotatedString.Range<SpanStyle>>, placeholders: List<AnnotatedString.Range<Placeholder>>, density: Density, resourceLoader: Font.ResourceLoader) -> ParagraphIntrinsics

Deprecated.