"mp-tikz-wasm" infont "cmbx10", Computer Modern Type 1 outlines converted to SVG paths by MetaPost's own backend.John Hobby's MetaPost 2.11, pdfTeX 1.40 and dvisvgm 3.4 compiled to WebAssembly. MetaPost source in; SVG with real glyph outlines, EPS and structured JSON out — including btex … etex labels typeset by plain TeX or LaTeX. And whole TikZ/PGF documents: LaTeX to DVI to SVG, shadings and pgfplots included. No server, no web fonts, no rendering shortcuts: the output is byte-identical to native mpost and latex + dvisvgm from TeX Live 2025. (The full build adds a fourth engine, LuaTeX, for TikZ graph drawing; it is left out of this single file for size.)
Every figure below was produced by this build of the engine (rendered in Node when the page was assembled). Load any of them into the editor above and change it.
These are complete documents — \documentclass[tikz]{standalone}, pgfplots, Latin Modern — typeset by pdfTeX in DVI mode and converted by dvisvgm, both running here. Shadings, patterns, clipping and opacity survive as native SVG. Open one and edit it.
Native MetaPost shells out to TeX from the middle of its scanner. WebAssembly cannot, so the TeX step is lifted out of the run:
input-ed file are scanned for btex/verbatimtex blocks with a TypeScript port of mpto's lexer, tested byte-for-byte against the C original.plain.fmt, latex.fmt) were built by this same wasm engine.dvitomp, linked into mplib.wasm, turns the DVI into .mpx picture expressions, split per block and cached by a hash of engine, format, preceding verbatimtex chain and body.extensions=1; its make_text callback answers each btex synchronously from the cache. Type 1 fonts become SVG paths (prologues:=3).scantokens) misses, comes back as nullpicture, and the run repeats once it has been typeset — LaTeX's own trick for cross-references.TikZ takes the other road. A TikZ document is not a label but a whole page, so it skips MetaPost entirely: pdfTeX writes a DVI whose \specials carry PGF's drawing commands, and dvisvgm — the reference converter, with its PGF/dvisvgm special handlers, FreeType and potrace — turns each page into SVG with glyph outlines. Same engine, same fonts, same bundles; a different last step.
| Artifact | Size |
|---|
| Scenario (Node, M-series Mac) | Time |
|---|---|
geometry figure, incl. parsing plain.mp | 14 ms |
label("MetaPost") with outlines | 6 ms |
| plain TeX label, cold cache | 115 ms |
| LaTeX + amsmath, cold cache | 185 ms |
| the same, warm cache | 5 ms |
| 40 labels, cold cache | 62 ms, one TeX run |
| 40 labels, one edited | 91 ms, one page |
The golden corpus — paths, pens, fills, transforms, clipping, labels, plain-TeX and LaTeX labels, boxes, graph, error recovery — is byte-identical to mpost in EPS and SVG (15 of 15 cases). The mtrap conformance run produces the same figures as native MetaPost 2.11. tex.wasm reproduces the oracle's DVI byte for byte.
static flag in psout.w crashed the second MetaPost instance in a process on any font render;extensions=1 scanner never matched an etex at the end of a line, and required a space before it (TeX Live's own texnum.mp writes btex$-$etex);stroke-miterlimit for filldraw from uninitialised memory;mpto's prologue had a bare % in a printf format — glibc, BSD and musl each did something different.