LineHeightStyle.Mode


Defines if the specified line height value should be enforced.

The line height is determined by the font file used in the text. So, sometimes the specified text height can be too tight to show the given text. By using Adjustment.Minimum the line height can be adjusted to the system provided value if the specified line height is too tight. This is useful for supporting languages that use tall glyphs, e.g. Arabic, Myanmar, etc.

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