Skip to main content

coalesce_scales

Function coalesce_scales 

Source
pub fn coalesce_scales(scales: &[u16], total_cols: u32) -> Vec<ScaleRun>
Expand description

F.3 (Thread F): coalesce a per-column scales slice into contiguous same-scale ScaleRuns across total_cols columns, exactly as a renderer coalesces per-cell fg into text runs.

Columns beyond scales.len() (or when scales is empty) default to BASE_SCALE. The returned runs cover 0..total_cols contiguously, in column order, and never split two adjacent columns that share a scale. total_cols == 0 ⇒ empty. Pure and allocation-light (O(total_cols)); unit-testable without a renderer.