androidx.compose.ui.text.style

Classes

BaselineShift

The amount by which the text is shifted up or down from current the baseline.

Cmn
Hyphens

Automatic hyphenation configuration.

Cmn
LineBreak

When soft wrap is enabled and the width of the text exceeds the width of its container, line breaks are inserted in the text to split it over multiple lines.

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

The configuration for line height such as alignment of the line in the provided line height, whether to apply additional space as a result of line height to top of first line top and bottom of last line.

Cmn
LineHeightStyle.Alignment

Defines how to align the line in the space provided by the line height.

Cmn
LineHeightStyle.Mode

Defines if the specified line height value should be enforced.

Cmn
LineHeightStyle.Trim

Defines whether to trim the extra space from the top of the first line and the bottom of the last line of text.

Cmn
TextAlign

Defines how to align text horizontally.

Cmn
TextDecoration

Defines a horizontal line to be drawn on the text.

Cmn
TextDirection

Defines the algorithm to be used while determining the text direction.

Cmn
TextGeometricTransform

Define a geometric transformation on text.

Cmn
TextIndent

Specify the indentation of a paragraph.

Cmn
TextMotion

Defines ways to render and place glyphs to provide readability and smooth animations for text.

Cmn
android
TextOverflow

How overflowing text should be handled.

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

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

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.

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.

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.

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

isSpecified

val BaselineShift.isSpecifiedBoolean

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

See also
Unspecified

isSpecified

val Hyphens.isSpecifiedBoolean

Returns true if it is not Hyphens.Unspecified.

See also
Unspecified

isSpecified

val LineBreak.isSpecifiedBoolean

Returns true if it is not LineBreak.Unspecified.

See also
Unspecified

isSpecified

val TextAlign.isSpecifiedBoolean

Returns true if this TextAlign is not TextAlign.Unspecified.

See also
Unspecified

isSpecified

val TextDirection.isSpecifiedBoolean

Returns true if this TextDirection is not TextDirection.Unspecified.

See also
Unspecified