Interfaces typesetters

SILE typesetter class.

Class typesetter

typesetter:_init(frame) Constructor
typesetter.declareSettings(_) Declare new setting types
typesetter:_repeatEnterLiners(slice) Any unclosed liner is reopened on the current line, so we clone and repeat it.
typesetter._reboxLiners(slice) All pairs of liners are rebuilt as hboxes wrapping their content.
typesetter:_processIfLiner(node) Check if a node is a liner, and process it if so, in a stack.
typesetter:liner(name, content, outputYourself) A liner is a construct that may span multiple lines.


Class typesetter

typesetter:_init(frame)
Constructor

Parameters:

  • frame A initial frame to attach the typesetter to.
typesetter.declareSettings(_)
Declare new setting types

Parameters:

  • _ Settings common to any typesetter instance. These shouldn't be re-declared and overwritten/reset in the typesetter constructor (see issue https //github.com/sile-typesetter/sile/issues/1708). On the other hand, it's fairly acceptable to have them made global: Any derived typesetter, whatever its implementation, should likely provide some logic for them (= widows, orphans, spacing, etc.)
typesetter:_repeatEnterLiners(slice)
Any unclosed liner is reopened on the current line, so we clone and repeat it. An assumption is that the inserts are done after the current slice content, supposed to be just before meaningful (visible) content.

Parameters:

  • slice slice

Returns:

    boolean Whether a liner was reopened
typesetter._reboxLiners(slice)
All pairs of liners are rebuilt as hboxes wrapping their content. Migrating content, however, must be kept outside the hboxes at top slice level.

Parameters:

  • slice table Flat nodes from current line

Returns:

    table New reboxed slice
typesetter:_processIfLiner(node)
Check if a node is a liner, and process it if so, in a stack.

Parameters:

  • node table Current node (any type)

Returns:

    boolean Whether a liner was opened
typesetter:liner(name, content, outputYourself)
A liner is a construct that may span multiple lines. This is the user-facing method for creating such liners in packages. The content may be line-broken, and each bit on each line will be wrapped into a box. These boxes will be formatted according to some output logic. The output method has the same signature as the outputYourself method of a box, and is responsible for outputting the liner inner content with the outputContent(typesetter, line) method, possibly surrounded by some additional effects. If we are already in horizontal-restricted mode, the liner is processed immediately, since line breaking won't occur then.

Parameters:

  • name string Name of the liner (useful for debugging)
  • content table SILE AST to process
  • outputYourself function Output method for wrapped boxes
generated by LDoc 1.5.0 Last updated 1980-01-01 00:00:00