LineHeightStyle.Mode


Controls whether to enforce the specified line height.

Font metrics determine the default line height. When the specified line height is too tight for the font, use Mode.Minimum to fall back to system-provided heights. This prevents clipping in languages with tall glyphs (e.g., Arabic, Burmese).

Summary

Public companion properties

LineHeightStyle.Mode

Always use the specified line height on every line but add the necessary paddings on text layout's top and bottom when the system preferred line height is larger.

Cmn
LineHeightStyle.Mode

By specifying Mode.Minimum, when the specified line height is smaller than the system preferred value, the system preferred one is used instead on all lines.

Cmn
LineHeightStyle.Mode

Be able to use the specified line height at all lines, including the first and last.

Cmn

Public functions

open String
Cmn

Public companion properties

Fixed

val FixedLineHeightStyle.Mode

Always use the specified line height on every line but add the necessary paddings on text layout's top and bottom when the system preferred line height is larger. This guarantees that taller glyphs won't be trimmed at the boundaries. On the other hand, middle lines respect the specified line height at all times and tall glyphs can overflow to upper or lower lines.

Minimum

val MinimumLineHeightStyle.Mode

By specifying Mode.Minimum, when the specified line height is smaller than the system preferred value, the system preferred one is used instead on all lines. Top and bottom paddings are also added. This prevents the overflow of tall glyphs in middle lines.

Tight

val TightLineHeightStyle.Mode

Be able to use the specified line height at all lines, including the first and last. This configuration basically gets rid of the safety rails that are added by Mode.Fixed. Tall glyphs might get trimmed at top, bottom, or both when used in conjunction with the corresponding Trim value.

Public functions

toString

open fun toString(): String