Canvas Text Layout Inspector is a VS Code extension that previews selected text with a deterministic canvas-based text engine. It is designed as a mini layout sandbox for inspecting wrapping, alignment, line boxes, overflow, and measurement data without relying on DOM text flow.
Features
Command palette entry: Canvas Text Layout Inspector: Preview Text Layout
Selected-text preview with full-document fallback
Deterministic line wrapping built on CanvasRenderingContext2D.measureText
Alignment modes: left, center, right, justify
Debug overlays for line boxes and word boxes
Overflow highlighting for words that exceed the width constraint
Measurement labels in pixels
Device presets for mobile, tablet, and desktop widths