androidx.compose.foundation.text

TextAutoSizeSince 1.8

Interface · from org.jetbrains.compose.foundation:foundation:1.12.2

No hand-written docs yet.

Interface used by Text composables to override text size to automatically grow or shrink text to fill the layout bounds.

interface TextAutoSize

Used by

Parameters that take a TextAutoSize.

Functions

getFontSize

fun TextAutoSizeLayoutScope.getFontSize(constraints: Constraints, text: AnnotatedString): TextUnit

Calculates font size and provides access to TextAutoSizeLayoutScope, which offers TextAutoSizeLayoutScope.performLayout to lay out the text and use the measured size.

StepBased

fun StepBased(
    minFontSize: TextUnit = TextAutoSizeDefaults.MinFontSize,
    maxFontSize: TextUnit = TextAutoSizeDefaults.MaxFontSize,
    stepSize: TextUnit = 0.25.sp,
): TextAutoSize

Automatically size the text with the biggest font size that fits the available space.

Library docs

Interface used by Text composables to override text size to automatically grow or shrink text to fill the layout bounds.