Module typesetters.mixins.hbox

Horizontal box builder mixin for the typesetter.

Some code in this file comes from SILE's core typesetter.

License: MIT. Copyright (c) The SILE Organization / Simon Cozens et al.

This file is part of re·sil·ient, a set of extensions to SILE.

License: MIT. Copyright (c) 2025 Omikhkeia / Didier Willis

Logic for building an hbox from content.

It returns the hbox and an horizontal list of (migrating) elements extracted outside of it. None of these are pushed to the typesetter node queue. The caller is responsible of doing it, if the hbox is built for anything else than e.g. measuring it. Likewise, the call has to decide what to do with the migrating content.

Pre-requisites:

  • The typesetter has a state.hmodeOnly boolean flag,
  • The typesetter has a shapeAll() method,
  • The typesetter has a frame object with appropriate methods.

Class typesetter

typesetter:makeHbox (content) Make an hbox from some content.
typesetter:pushHlist (hlist) Push an horizontal list of nodes to the typesetter node list.


Class typesetter

typesetter:makeHbox (content)
Make an hbox from some content. The content is processed in horizontal-restricted mode, and shaped. Migrating nodes (typically footnotes) are extracted from the content and returned separately. The typesetter is reponsible, if it pushes the hbox for output, for pushing the migrating nodes too, typically just after the hbox. The idea here is that migrating nodes are not part of the hbox, but need to be re-inserted in the main horizontal list at the same place as the hbox.

Parameters:

  • content function AST content to process

Returns:

  1. SILE.types.node.hbox Resulting hbox
  2. table List of migrating nodes extracted from the content
typesetter:pushHlist (hlist)
Push an horizontal list of nodes to the typesetter node list. This is a convenience method, notably used for pushing migrating nodes extracted from an hbox.

Parameters:

  • hlist table List of nodes
generated by LDoc 1.5.0 Last updated 2025-09-14 22:28:52