androidx.compose.ui.text.style

Classes

BaselineShift

Shifts the text baseline vertically (up or down).

Cmn
Hyphens

Automatically hyphenates words when wrapping text.

Cmn
LineBreak

Configures line breaking behavior when text wraps automatically to fit its container.

Cmn
android
LineBreak.Strategy

The strategy used for line breaking.

android
LineBreak.Strictness

Describes the strictness of line breaking, determining before which characters line breaks can be inserted.

android
LineBreak.WordBreak

Describes how line breaks should be inserted within words.

android
LineHeightStyle

Configures line height behavior, including alignment and trimming of extra space.

Cmn
LineHeightStyle.Alignment

Aligns the line within the space provided by the line height.

Cmn
LineHeightStyle.Mode

Controls whether to enforce the specified line height.

Cmn
LineHeightStyle.Trim

Controls trimming of extra space from the first line top and last line bottom.

Cmn
TextAlign

Aligns text horizontally within its container.

Cmn
TextDecoration

Defines text decorations such as underline or line-through.

Cmn
TextDirection

Defines the algorithm used to determine text direction.

Cmn
TextGeometricTransform

Defines geometric transformations for text (such as scaling and skewing).

Cmn
TextIndent

Indents paragraph lines.

Cmn
TextMotion

Configures glyph rendering and placement for readability or smooth animations.

Cmn
android
TextOverflow

Specifies how to handle overflowing text.

Cmn

Enums

ResolvedTextDirection

Describes the directionality of a text.

Cmn

Top-level functions summary

BaselineShift
lerp(start: BaselineShift, stop: BaselineShift, fraction: Float)

Linearly interpolate two BaselineShifts.

Cmn
TextGeometricTransform
lerp(
    start: TextGeometricTransform,
    stop: TextGeometricTransform,
    fraction: Float
)
Cmn
TextIndent
lerp(start: TextIndent, stop: TextIndent, fraction: Float)

Linearly interpolate between two TextIndents.

Cmn

Extension functions summary

inline BaselineShift

If isSpecified is true then this is returned, otherwise block is executed and its result is returned.

Cmn
inline Hyphens
Hyphens.takeOrElse(block: () -> Hyphens)

If isSpecified is true then this is returned, otherwise block is executed and its result is returned.

Cmn
inline TextAlign

If isSpecified is true then this is returned, otherwise block is executed and its result is returned.

Cmn
inline TextDirection

If isSpecified is true then this is returned, otherwise block is executed and its result is returned.

Cmn

Extension properties summary

Boolean

Returns true if this baseline shift is not BaselineShift.Unspecified.

Cmn
Boolean

Returns true if it is not Hyphens.Unspecified.

Cmn
Boolean

Returns true if it is not LineBreak.Unspecified.

Cmn
Boolean

Returns true if this TextAlign is not TextAlign.Unspecified.

Cmn
Boolean

Returns true if this TextDirection is not TextDirection.Unspecified.

Cmn

Top-level functions

lerp

fun lerp(start: BaselineShift, stop: BaselineShift, fraction: Float): BaselineShift

Linearly interpolate two BaselineShifts.

lerp

fun lerp(
    start: TextGeometricTransform,
    stop: TextGeometricTransform,
    fraction: Float
): TextGeometricTransform

lerp

fun lerp(start: TextIndent, stop: TextIndent, fraction: Float): TextIndent

Linearly interpolate between two TextIndents.

The fraction argument represents position on the timeline, with 0.0 meaning that the interpolation has not started, returning start (or something equivalent to start), 1.0 meaning that the interpolation has finished, returning stop (or something equivalent to stop), and values in between meaning that the interpolation is at the relevant point on the timeline between start and stop. The interpolation can be extrapolated beyond 0.0 and 1.0, so negative values and values greater than 1.0 are valid.

Extension functions

BaselineShift.takeOrElse

inline fun BaselineShift.takeOrElse(block: () -> BaselineShift): BaselineShift

If isSpecified is true then this is returned, otherwise block is executed and its result is returned.

Hyphens.takeOrElse

inline fun Hyphens.takeOrElse(block: () -> Hyphens): Hyphens

If isSpecified is true then this is returned, otherwise block is executed and its result is returned.

TextAlign.takeOrElse

inline fun TextAlign.takeOrElse(block: () -> TextAlign): TextAlign

If isSpecified is true then this is returned, otherwise block is executed and its result is returned.

TextDirection.takeOrElse

inline fun TextDirection.takeOrElse(block: () -> TextDirection): TextDirection

If isSpecified is true then this is returned, otherwise block is executed and its result is returned.

Extension properties

BaselineShift.isSpecified

val BaselineShift.isSpecifiedBoolean

Returns true if this baseline shift is not BaselineShift.Unspecified.

See also
Unspecified

Hyphens.isSpecified

val Hyphens.isSpecifiedBoolean

Returns true if it is not Hyphens.Unspecified.

See also
Unspecified

LineBreak.isSpecified

val LineBreak.isSpecifiedBoolean

Returns true if it is not LineBreak.Unspecified.

See also
Unspecified

TextAlign.isSpecified

val TextAlign.isSpecifiedBoolean

Returns true if this TextAlign is not TextAlign.Unspecified.

See also
Unspecified

TextDirection.isSpecified

val TextDirection.isSpecifiedBoolean

Returns true if this TextDirection is not TextDirection.Unspecified.

See also
Unspecified