class HexaPDF::Layout::Style::LineSpacing

Parent

Defines how the distance between the baselines of two adjacent text lines is determined:

:single

:proportional with value 1.

:double

:proportional with value 2.

:proportional

The y_min of the first line and the y_max of the second line are multiplied with the specified value, and the sum is used as baseline distance.

:fixed

The distance between the baselines is set to the specified value.

:leading

The distance between the baselines is set to the sum of the y_min of the first line, the y_max of the second line and the specified value.

Attributes

type[R]

The type of line spacing - see LineSpacing

value[R]

The value (needed for some types) - see LineSpacing

Public Class Methods

new(type:, value: 1)

Creates a new LineSpacing object for the given type which can be any valid line spacing type or a LineSpacing object.

Public Instance Methods

baseline_distance(line1, line2)

Returns the distance between the baselines of the two given Line objects.

gap(line1, line2)

Returns the gap between the two given Line objects, i.e. the distance between the y_min of the first line and the y_max of the second line.