remotion-dev / skills
remotion-markup
Structure Remotion scenes with markup patterns for layout, typography, and reusable video UI.
Install
npx skills add https://github.com/remotion-dev/skills --skill remotion-markup- metadata
- tags: measure, text, layout, dimensions, fitText, fillTextBox
Measuring text in Remotion
Prerequisites
Install @remotion/layout-utils if it is not already installed:
Measuring text dimensions
Use measureText() to calculate the width and height of text:
Results are cached - duplicate calls return the cached result.
Fitting text to a width
Use fitText() to find the optimal font size for a container:
Checking text overflow
Use fillTextBox() to check if text exceeds a box:
Best practices
Load fonts first: Only call measurement functions after fonts are loaded.
Use validateFontIsLoaded: Catch font loading issues early:
Match font properties: Use the same properties for measurement and rendering:
Avoid padding and border: Use outline instead of border to prevent layout differences: