Expand description
Microtypographic justification controls for the Knuth-Plass pipeline.
This module provides stretch/shrink/spacing penalty configuration that
modulates how the line-break optimizer distributes white space across
justified text. It complements super::vertical_metrics (vertical
spacing) with horizontal spacing controls.
§Design
All widths are in cell columns (terminal-native units). The stretch and shrink values define the allowable range of space adjustment per space category. The optimizer penalizes deviations from the natural width according to a cubic badness function (TeX convention).
§TeX heritage
The glue model follows TeX’s concept: each space has a natural width,
a stretchability, and a shrinkability. The adjustment ratio r is
computed as slack / (total_stretch or total_shrink), and badness is
|r|³ × scale.
Structs§
- Glue
Spec - TeX-style glue specification: natural width + stretch + shrink.
- Justification
Control - Unified justification configuration.
- Space
Penalty - Penalty modifiers for space adjustment quality.
Enums§
- Justify
Mode - Text alignment mode.
- Space
Category - Classification of horizontal space types.
Constants§
- SUBCELL_
SCALE - Sub-cell units per cell column.