Remotion
Tegaki integrates with Remotion for programmatic video rendering. Because Remotion drives time via useCurrentFrame(), the trick is to put Tegaki in controlled progress mode and map frame / durationInFrames to a 0–1 progress value.
Installation
Section titled “Installation”Basic example
Section titled “Basic example”The unit: 'progress' option interprets value as a 0–1 ratio of the total animation duration, so you don’t need to know Tegaki’s computed timeline length — Remotion’s composition length drives the mapping directly.
Loading fonts
Section titled “Loading fonts”Tegaki’s font bundles (tegaki/fonts/caveat, tegaki/fonts/italianno, etc.) handle font loading automatically: the engine creates a FontFace and registers it with document.fonts. Remotion waits on document.fonts.ready before capturing each frame, so no loadFont call is required — just pass the bundle to TegakiRenderer.
Webpack override for Remotion Studio
Section titled “Webpack override for Remotion Studio”If you render directly with remotion render, everything works out of the box. However, Remotion Studio’s dev server serves the TTF URL incorrectly because the bundled path escapes the studio’s root (webpack emits ../../node_modules/tegaki/fonts/caveat/caveat.ttf, which the SPA catch-all intercepts and returns HTML).
The fix is to tell webpack to inline .ttf files as data URLs. Add a remotion.config.ts at the root of your Remotion project:
This works in both the studio and in render/build mode. The bundled font is ~60–250 kB depending on the family, which is negligible for a video bundle.
Controlling timing
Section titled “Controlling timing”By default, progress = frame / durationInFrames spreads the handwriting animation across the entire composition. Two common variations:
Finish drawing before the end of the composition — e.g. hold the finished text for the last second:
Start drawing after a delay:
Using your own font
Section titled “Using your own font”The pre-built bundles (tegaki/fonts/*) are convenient but you can use any font generated by the Tegaki generator. See Generating Font Data.