Back to API Reference
Class

LineHeightModifier

Inherits:BaseModifier

Sets each line's height, per paragraph.

Remarks

Parameters (comma-separated): Value, Mode, Scale, Leading — all optional. Mode: content (grow to the tallest font on the line — default), primary (primary font only, so fallback glyphs never enlarge the line), or scaled (exactly Scale × fontSize). Value: optional nudge on top of the mode — 150% or 1.5em (multiplier), 40 (absolute pixels), +10 / -5 (delta pixels). A bare number is pixels, not a multiplier; 0 or empty means no nudge. Scale: the multiplier for scaled mode; ignored otherwise. Leading: how extra spacing is split — halfLeading (CSS), leadingAbove (Figma), leadingBelow (Android). To set a later parameter without the earlier ones, leave them empty: <lh=,primary>, <lh=,scaled,2>. When several ranges set an absolute height on a line, the largest wins.
public UnitValue HeightValue{ get; set }

Optional height nudge on top of the mode (multiplier, absolute px, or delta). A per-range value overrides it.

public LineHeightMode Mode{ get; set }

How the base line height is derived. A per-range value overrides it.

public float Scale{ get; set }

Multiplier used in Scaled mode.

public LeadingDistribution Leading{ get; set }

How extra line spacing is split above/below the text.

protected override void OnEnable()
protected override void OnDisable()
protected override void OnDestroy()
protected override void BeforeApply()
protected override void OnApply()