LineHeightStyle
Class
Common
class LineHeightStyle(val alignment: Alignment, val trim: Trim, val mode: Mode)
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.
Parameters
alignment | defines how to align the line in the space provided by the line height. |
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 | 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. |
Secondary Constructors
constructor(alignment: Alignment, trim: Trim) : this(alignment, trim, Mode.Fixed)
Functions
fun copy(
alignment: Alignment = this.alignment,
trim: Trim = this.trim,
mode: Mode = this.mode,
) = LineHeightStyle(alignment, trim, mode)
Returns a copy of this LineHeightStyle
, optionally overriding some of the values.
Companion Object
Properties
Common
val Default =
LineHeightStyle(alignment = Alignment.Proportional, trim = Trim.Both, mode = Mode.Fixed)
The default configuration for LineHeightStyle
:
- alignment =
Alignment.Proportional
- trim =
Trim.Both
- mode =
Mode.Fixed