# Scalar source whitespace

This unpublished candidate replaces prose whitespace normalization with source-preserving line fitting. `fitText` returns `SourceTextFit`; `wrapText` returns its displayed lines. `TextLineSource` stores half-open UTF-16 start/end/nextStart, soft/hard/end boundary, measured width and text/tab segments. Reconstruct source with each displayed line followed by the original substring between end and nextStart. CRLF, CR, LF, repeated/leading/trailing spaces and blank lines remain distinguishable. Existing code type names remain compatibility aliases.

Tabs use stops every four measured spaces from each displayed line origin. Control characters never reach font advance/outline calls. Accepted scalar placement unions segment outlines at those stops. Nonbreaking spaces (U+00A0/U+202F), word joiner and the deprecated nonbreaking U+FEFF protect their token in plain prose: an oversized protected token remains intact and reports overflow at the selected floor. Ordinary long tokens retain grapheme-safe emergency wrapping. This is not a complete language-aware line breaker; rich-run nonbreaking behavior and multilingual shaping still need separate work.

Retained spaces contribute to fitting. The former 70-repeat quote-footer fixture now reports overflow instead of silently dropping spaces; a nearby 68-repeat control demonstrates automatic selection of the arrangement that fits. No tolerance or floor was lowered.

The renderer consumes accepted source lines, preserves SVG whitespace and explicitly positions tabs. It records source ranges separately from rich-text formatting offsets and gives blank scalar groups their actual layout boxes. Measured scalar advances use geometric precision and accepted text lengths; raw font comparison remains distinct from constrained output. The editor uses the blank boxes as selection targets and preserves each input event against its last canonical draft, so separate edits do not normalize untouched mixed endings between them. A single wholesale replacement still uses the existing replacement-range newline policy; native IME and arbitrary editing are not certified by these tests.

The converter exports editable scalar lines with explicit tab stops. Standard DrawingML tags retain line order, roles and only the original hard-break separators, never old source words. Complete groups rebuild from current native text; clearing text, renaming and reordering remain supported. Invalid/incomplete/duplicated/bulleted groups fall back to visible native content with diagnostics. Legacy heading tags preserve their former native-line behavior. Plain body tags prevent geometry-based heading promotion; current native placeholders remain authoritative. Reimport does not reconstruct arbitrary OPF nesting, formatting or original geometry.

Evidence: [Mac scalar workflow](../evidence/mac-source-whitespace/README.md) and the renderer's coordinated source-whitespace corpus review. The separate 805-slide checkpoint changes 279 slides, retains 526 identical hashes and preserves every historical baseline. Native PowerPoint acceptance is still pending; the existing native image blockage and tab rounding failures are unaffected.
