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.

The configuration is applied only when a line height is defined on the text.

trim feature is available only when PlatformParagraphStyle.includeFontPadding is false.

Please check Trim and Alignment for more description.

Summary

Nested types

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

Defines if the specified line height value should be enforced.

Defines whether the space that would be added to the top of first line, and bottom of the last line should be trimmed or not.

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

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

Cmn
LineHeightStyle.Mode

defines the behavior when the specified line height is smaller than system preferred line height.

Cmn
LineHeightStyle.Trim

defines whether the space that would be added to the top of first line, and bottom of the last line should be trimmed or not.

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

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

trim: LineHeightStyle.Trim

defines whether the space that would be added to the top of first line, and bottom of the last line should be trimmed or not. This feature is available only when PlatformParagraphStyle.includeFontPadding is false.

mode: LineHeightStyle.Mode

defines the behavior when the specified line height is smaller than system preferred line height. By specifying Mode.Fixed, the line height is always set to the specified value. This is the default value. By specifying Mode.Minimum, the specified line height is smaller than the system preferred value, the system preferred one is used instead.

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

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

mode

val modeLineHeightStyle.Mode

defines the behavior when the specified line height is smaller than system preferred line height. By specifying Mode.Fixed, the line height is always set to the specified value. This is the default value. By specifying Mode.Minimum, the specified line height is smaller than the system preferred value, the system preferred one is used instead.

trim

val trimLineHeightStyle.Trim

defines whether the space that would be added to the top of first line, and bottom of the last line should be trimmed or not. This feature is available only when PlatformParagraphStyle.includeFontPadding is false.