Skip to main content
rule CX Codex

fonts — Claude Code rule: what it does, how to install

Guides Claude Code on loading Google Fonts and local font assets in Remotion video projects without render glitches.

no license ★ 849 updated 2026-01-24

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/fonts.md
Open on GitHub

What fonts does

This rule tells the agent how to handle typography in Remotion compositions. When working with Google Fonts, it enforces the type-safe @remotion/google-fonts package, advising specific subsets and weights in loadFont() to keep payload sizes small.

For self-hosted font assets, the guide routes files into public/ and links them via staticFile() with @remotion/fonts. Trying to render without running npx remotion add for the respective package will trigger missing module errors during video generation.

What it helps with

  • load Google Fonts inside Remotion video compositions
  • configure local woff2 font files from the public directory
  • limit font weights and character subsets to keep assets light
  • block frame rendering until typography assets finish loading

Example prompts for the agent

  • Add Google Font Montserrat to my Remotion title screen
  • Load a local woff2 font file for this video scene
  • Set up font loading with specific weights and wait for it to be ready

How to install fonts

Manually: put the files in place

.claude/rules/fonts.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about fonts

How to install fonts in Claude Code?

Save the rule contents into the file .claude/rules/fonts.md.

What does the fonts rule do?

It provides conventions for importing Google Fonts and local typography assets cleanly in Remotion code.

Which dependencies are required?

Projects need @remotion/google-fonts for Google directory fonts or @remotion/fonts for local files, installed via remotion add.

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set33

The whole set →
sequencing sequencing — a rule for managing component timing in Remotion videos. Uses Sequence for delays and Series for sequential playback, with support for nested and overlapping scenes. CX Codex +1 ★ 849repo stars images images directs the AI to embed graphics in Remotion via the Img element, staticFile helper, and dimensions calculation. CX Codex +1 ★ 849repo stars calculate-metadata The calculate-metadata rule configures Remotion composition metadata before rendering, including duration, dimensions, FPS, props, and the output filename. CX Codex +1 ★ 849repo stars measuring-text measuring-text — a rule to calculate text size, fit fonts to containers, and detect overflow. Use it when building dynamic text in Remotion and need precise dimensions to avoid clipping or wrong scaling. CX Codex +1 ★ 849repo stars videos videos — a rule for embedding video in Remotion compositions with trimming, volume control, playback speed, looping and pitch adjustment. Lets you work with video files in animations without repeating boilerplate code. CX Codex +1 ★ 849repo stars display-captions display-captions — a rule that walks through drawing captions in Remotion: grouping them into TikTok-style pages and highlighting whichever word is being spoken. CX Codex +1 ★ 849repo stars compositions Sets guidelines for structuring Remotion compositions, still frames, folders, and dynamic metadata in src/Root.tsx. CX Codex +1 ★ 849repo stars transitions This rule guides Claude Code in adding fullscreen transitions between Remotion scenes or clips. Use it when building a composition from multiple scenes. CX Codex +1 ★ 849repo stars

Project sponsors

Companies that keep this analytics open