class HexaPDF::Layout::TextLayouter::Result

Parent

Encapsulates the result of layouting items using a TextLayouter and provides a method for drawing the result (i.e. the layed out lines) on a canvas.

Attributes

height[R]

The actual height of all layed out lines (this includes a possible offset for the first line).

lines[R]

Array of layed out lines.

remaining_items[R]

The remaining items that couldn’t be layed out.

status[R]

The status after layouting the items:

:success

There are no remaining items.

:box_too_wide

A single text or inline box was too wide to fit alone on a line.

:height

There was not enough height for all items to layout.

Even if the result is not :success, the layouting may still be successful depending on the usage. For example, if we expect that there may be too many items to fit, :height is still a success.

Public Class Methods

new(status, lines, remaining_items)

Creates a new Result structure.

Public Instance Methods

draw(canvas, x, y)

Draws the layed out lines onto the canvas with the top-left corner being at [x, y].