Layout Oracle is a small static web app for exploring cross-browser wrap drift.
Paste text, choose a width, font, and line height, and compare how a Pretext-based browser-wrap simulator breaks the same content in:
- Chromium-like mode
- Safari-like mode
- Firefox-like mode
It is intentionally narrow:
- no backend
- no screenshots
- no full browser rendering
- just line wrapping diffs
- shows per-engine wrapped line lists
- finds the first divergence line
- renders a simple visual overlay aligned by wrapped line index
- includes built-in demo cases that trigger modeled engine differences
Layout Oracle is not a live browser oracle.
It uses a vendored subset of Pretext and varies the engine-profile heuristics Pretext already models:
lineFitEpsilonpreferPrefixWidthsForBreakableRunspreferEarlySoftHyphenBreakcarryCJKAfterClosingQuote
That makes it best understood as a profile-based wrap simulator, not a full browser emulator.
- Vite
- TypeScript
- vanilla DOM
- a small vendored Pretext slice with an engine-profile override
npm install
npm run devnpm run test
npm run buildThe repo includes .github/workflows/deploy-pages.yml.
To publish with GitHub Pages:
- Open repository settings.
- Go to
Pages. - Set the source to
GitHub Actions.
The workflow sets VITE_BASE_PATH from the repository name so the built assets resolve correctly on Pages.
src/
app/ state, defaults, small DOM helpers
oracle/ engine profiles, multi-engine runs, diff logic
pretext/ vendored upstream subset with a small engine override patch
ui/ controls, overlay rendering, result rendering
- v1 uses
white-space: normalonly - font choice still depends on the fonts installed on the local machine
- custom font input must include a
pxsize or the app falls back to the selected preset