LineHeightStyle


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

Applies only when a line height is defined on the text.

Summary

Nested types

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

Controls whether to enforce the specified line height.

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

Public companion properties

LineHeightStyle

The default configuration for LineHeightStyle:

Cmn

Public constructors

Cmn
LineHeightStyle(
    alignment: LineHeightStyle.Alignment,
    trim: LineHeightStyle.Trim,
    mode: LineHeightStyle.Mode
)
Cmn

Public functions

LineHeightStyle
copy(
    alignment: LineHeightStyle.Alignment,
    trim: LineHeightStyle.Trim,
    mode: LineHeightStyle.Mode
)

Returns a copy of this LineHeightStyle, optionally overriding some of the values.

Cmn
open operator Boolean
equals(other: Any?)
Cmn
open Int
Cmn
open String
Cmn

Public properties

LineHeightStyle.Alignment

alignment of the line within the allocated line height.

Cmn
LineHeightStyle.Mode

behavior when the specified line height is smaller than the system default (see Mode).

Cmn
LineHeightStyle.Trim

trimming behavior for the top of the first line and bottom of the last line.

Cmn

Public companion properties

Default

val DefaultLineHeightStyle

The default configuration for LineHeightStyle:

Public constructors

LineHeightStyle

LineHeightStyle(
    alignment: LineHeightStyle.Alignment,
    trim: LineHeightStyle.Trim
)

LineHeightStyle

LineHeightStyle(
    alignment: LineHeightStyle.Alignment,
    trim: LineHeightStyle.Trim,
    mode: LineHeightStyle.Mode
)
Parameters
alignment: LineHeightStyle.Alignment

alignment of the line within the allocated line height.

trim: LineHeightStyle.Trim

trimming behavior for the top of the first line and bottom of the last line. Requires PlatformParagraphStyle.includeFontPadding to be false.

mode: LineHeightStyle.Mode

behavior when the specified line height is smaller than the system default (see Mode).

Public functions

copy

fun copy(
    alignment: LineHeightStyle.Alignment = this.alignment,
    trim: LineHeightStyle.Trim = this.trim,
    mode: LineHeightStyle.Mode = this.mode
): LineHeightStyle

Returns a copy of this LineHeightStyle, optionally overriding some of the values.

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

alignment

val alignmentLineHeightStyle.Alignment

alignment of the line within the allocated line height.

mode

val modeLineHeightStyle.Mode

behavior when the specified line height is smaller than the system default (see Mode).

trim

val trimLineHeightStyle.Trim

trimming behavior for the top of the first line and bottom of the last line. Requires PlatformParagraphStyle.includeFontPadding to be false.