SkillsMar 29, 2026·2 min read

Remotion Rule: Fonts

Remotion skill rule: Loading Google Fonts and local fonts in Remotion. Part of the official Remotion Agent Skill for programmatic video in React.

TL;DR
Load Google Fonts or local font files correctly in Remotion programmatic videos.
§01

What it is

This Remotion skill rule covers loading Google Fonts and local fonts in Remotion projects. Remotion renders video frames as React components, which means font loading follows web patterns but with video-specific constraints. Fonts must be fully loaded before any frame renders, or you get fallback text in your output video.

This rule is part of the official Remotion Agent Skill set. It provides AI agents and developers with the correct patterns for font usage in programmatic video production, avoiding the common mistake of rendering frames before fonts are available.

§02

Why it saves time or tokens

Font loading bugs in Remotion produce videos with system fallback fonts on random frames. Debugging which frames failed is time-consuming because the issue is non-deterministic. This skill rule gives a deterministic pattern that works on the first render. When an AI agent generates a Remotion composition, following this rule eliminates font-related re-renders.

§03

How to use

  1. Choose between Google Fonts (remote) or local font files bundled in your project
  2. Use the @remotion/google-fonts package for Google Fonts or staticFile() for local fonts
  3. Ensure fonts are loaded at the composition level before any component renders text
§04

Example

// Google Fonts approach
import { loadFont } from '@remotion/google-fonts/Inter';

const { fontFamily } = loadFont();

const MyTitle = () => (
  <h1 style={{ fontFamily }}>Hello World</h1>
);

// Local font approach
import { staticFile } from 'remotion';

const localFont = new FontFace(
  'CustomFont',
  `url(${staticFile('fonts/custom.woff2')})`
);

await localFont.load();
document.fonts.add(localFont);
MethodWhen to Use
@remotion/google-fontsStandard fonts, no custom branding
staticFile + FontFaceCustom brand fonts, offline rendering
System fontsQuick prototyping only
§05

Related on TokRepo

§06

Common pitfalls

  • Importing Google Fonts via CSS @import in Remotion causes race conditions; always use the @remotion/google-fonts package
  • Local font files must be in the public/ directory and loaded via staticFile(); relative paths break during rendering
  • Not awaiting font load before render causes random frames to use fallback fonts, producing inconsistent video output

Frequently Asked Questions

Why can't I use CSS @import for fonts in Remotion?+

CSS @import loads fonts asynchronously, and Remotion renders frames on a tight schedule. If a frame renders before the font finishes downloading, it uses the fallback font. The @remotion/google-fonts package ensures the font is loaded synchronously before any frame renders, preventing this race condition.

How do I use a custom brand font in Remotion?+

Place your font file (woff2 preferred for size) in the public/ directory. Use staticFile() to get the URL, create a FontFace object, call load() on it, and add it to document.fonts. Do this at the composition level so all frames have access to the loaded font.

Does Remotion support variable fonts?+

Yes. Both Google variable fonts and local variable font files work in Remotion. Load them the same way as regular fonts. You can then use CSS font-variation-settings or font-weight with numeric values to access different weights and styles from a single font file.

What happens if a font fails to load during rendering?+

If a font fails to load, Remotion renders text with the browser default fallback font, usually Times New Roman or a system sans-serif. This produces visible inconsistency in your video. Always handle font load errors and provide a fallback font-family in your CSS to maintain visual consistency.

Can I use multiple fonts in one Remotion video?+

Yes. Load each font independently using loadFont() for Google Fonts or FontFace for local fonts. Assign different fontFamily values to different text components. All fonts must be loaded before rendering starts, so call all loadFont() functions at the composition root level.

Citations (3)
  • Remotion GitHub— Remotion renders video as React components
  • Remotion Docs— @remotion/google-fonts package for synchronous font loading
  • MDN Web Docs— FontFace API for loading custom fonts in web contexts
🙏

Source & Thanks

Created by Remotion. Licensed under MIT. remotion-dev/skills — Rule: fonts

Part of the Remotion AI Skill collection on TokRepo.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets