Measure multiline text height using canvas.measureText — no layout reflow, no getBoundingClientRect. 100% accurate across all languages.
Text reflows around the dragon in real‑time at 60fps using layoutNextLine — zero DOM reads, pure arithmetic.

Sample Text
Usage
import { prepare, layout } from '@chenglou/pretext'
const prepared = prepare(
"The quick brown fox jumps over the lazy dog. Typography…",
'16px Georgia'
)
// Arithmetic calculation bypassing DOM representation and visual layouts
const { height, lineCount } = layout(prepared, 320, 26)
// → height: ?px lineCount: ?