# Shared vector outlines and accepted text placement

This is unpublished work on `codex/shared-metric-integration-20260910`, beyond core 0.9.0, renderer/PPTX 0.7.0 and editor 0.6.0. Check the [handoff](../handoff-2026-09-08.md) for exact source checkpoints and release gates.

## Contract

`TextMeasurement.outlineBounds(text, fontSize, resolvedStyle)` optionally returns a shaped vector outline rectangle relative to the left baseline origin, with positive y downward. `null` means no outline, such as spaces; an absent method means unavailable measurement. Core validates finite coordinates and nonnegative dimensions. The font registry measures outlines and advances from the same local font bytes and style resolution. Vector rectangles do not certify hinting, antialiasing, decorations, color glyphs or arbitrary rasterizers.

`placeTextLines` preserves nominal alignment when possible, moves a line horizontally to contain its outline, and shifts subsequent baselines together when tall outlines need separation. It returns absolute accepted origins, outline rectangles, occupied height and overflow. It never clips or edits text. Scalar/rich text and headings use this placement during fitting; the bounded search retains the selected minimum and tries at most 65 sizes. Rich-run font ratios remain tied to the original requested size. Width-only providers retain their earlier fitting behavior.

Pass the same `textMeasurement` and `textRasterPadding` to composition, renderer, explicit pagination, editor and PPTX export. Padding defaults to one reference pixel at a 720-pixel canvas short edge and scales with the canvas. It is an explicit layout input, not a relaxed validation tolerance or a promise about every device-pixel ratio. Zero disables that clearance. The `grid-score-v6` explanation reports outline availability and effective padding; scoring and strict overflow include placed scalar/rich text. Existing code, quote, list, table, chart and timeline internals retain their previous models; their full ink coverage is still work.

The subsequent metric candidate extends the same outline placement to complete metric fields. Each source-preserving line unions the outlines of its measured text segments at their explicit tab positions. Bounded fitting reserves clearance, actual occupied height and horizontal overhangs. The inline value/unit pair keeps a shared accepted baseline, and stacked metadata follows the occupied ink/line height. Consumers continue using `linePositions`; `fit.placement` exposes the accepted absolute lines and outlines. Width-only providers keep their former geometry, and `textRasterPadding: 0` explicitly disables additional clearance. Oversized outlines reject at the selected readability floor instead of being clipped. Empty values retain a usable editor target. See [metric outline evidence](../evidence/metric-outline-placement/README.md).

Consumers use `fit.placement` without another measurement pass. SVG trace positions match painted origins. Native PPTX keeps editable line boxes and the accepted alignment anchors without autofit. Complete standard DrawingML heading tags recover title/subtitle/tag roles and current native text in line order. Renamed/reordered shapes remain supported; damaged, incomplete or ambiguous groups fall back to ordinary import with diagnostics. Tags contain no original heading text. Original whitespace, wrapping, formatting, layout and arbitrary Office structure are not recovered. The later [scalar whitespace candidate](plain-text-whitespace.md) replaces plain normalization and adds source-boundary tags; the preceding description remains the legacy tag behavior.

## Evidence and remaining gates

The original four Carlito portrait/right title failures were actual Edge ink: pixel (497,186), coverage 90/255, exceeded a cell ending at 496.8. The vector outline stayed within its advance. Switching Edge's text-rendering mode did not change that pixel. Shared clearance fixes all 24 cases with the unchanged 0.1-pixel mask gate; zero-clearance controls reproduce exactly the four failures on Node 20/24.

See [portable evidence](../evidence/text-placement/README.md) for versions, hashes, package/browser checks and retained failures. Native DrawingML geometry is checked independently of browser paint. The [Windows follow-up](../evidence/windows-native-2026-09-10/README.md) now contains complete accepted-text observations on both runtimes, together with preserved chart/metric failures and later bounded chart investigations. The metric candidate's 96 actual offline SVG cases pass on both Node runtimes; its width-only browser control also passes, so it does not reproduce the separate native Calibri failure. Adversarial outline-provider controls expose the core acceptance gap and pass after repair. Fresh native metric evidence in core #68 clears the portrait/right ink overflow; six leading-tab outliers remain per runtime (maximum 0.0226745605469pt against the unchanged 0.02pt gate). The native-created tab control in core #70 reproduces that rounding difference without OPF input, with precise DrawingML and separate COM/PDF observations. The gate remains failed; no tolerance or consumer offset changed. Source quality, glyph appearance, multilingual shaping, native equivalence and public adoption need their own evidence.
