driftype

Download the embed

Everything needed to put a driftype piece on your own page. Two files and an example, plus the integration guide. No build step on your side.

driftype-embed.zip 1.1M

What is in it

Keep driftype-embed.js and driftype.wasm in the same directory. The runtime resolves the engine relative to its own URL, so separating them is the one mistake that breaks everything with a confusing error.

Using it

<!-- unpack next to your page, then -->
<script type="module" src="driftype-embed-auto.js"></script>

<drift-type src="hero.json" width="1000" height="400">
  calm &rarr; frantic
</drift-type>

The text inside the tag is the fallback. It stays visible until a frame is actually drawn and comes back if anything fails, so put the real words there — it is what a reader sees on a browser without WebGPU.

Your own document

The archive plays a piece out of the box: serve the folder and open example.html, which shows example.json. Or open embedding.html straight from disk — the guide carries its own copy of the engine and plays the same piece with no server at all.

Your own piece is a document exported from the editor, carrying its own glyph geometry so nothing requests a font at runtime. A short wordmark is about 7 KB. Press Export in the editor and it downloads as <id>.json, named from the document's own id — so several pieces sit in one directory as several files rather than overwriting each other. Point each <drift-type> at its own.

An exported document contains outlines taken from whatever font you authored with, so shipping one distributes that geometry. Check the licence covers it. The bundled Anton is under the SIL Open Font License, which does; a system or foundry font may well not.