Module typesetters.nodes.speaker

Speaker change node 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

Some typography conventions use an em-dash at the start of a paragraph line to denote a speaker change in a dialogue. This is the case in particular in French and Turkish typography. All spaces following an em-dash at the beginning of a paragraph in the input should be replaced by a single fixed inter-word space, so that subsequent dialogue lines all start identically, while other inter-wordspaces may still be variable for justification purposes.

Class speakerChangeNode

speakerChangeNode:shape () Shape the node.


Class speakerChangeNode

Speaker change node.
speakerChangeNode:shape ()
Shape the node. The typesetter can insert this node when it detects a speaker change at the start of a paragraph, i.e. an em-dash followed by some space. The typesetter is responsible for passing the correct text to this node, i.e. the em-dash followed by a regular space, as in "— Some dialogue". This special unshaped node subclass, when shaped, replaces the shaped space (now a glue) by a fixed-width kern.

Returns:

    table Array of shaped nodes (nnodes, glues, penalties...)
generated by LDoc 1.5.0 Last updated 2025-09-14 22:28:52