---
title: "Add Text Overlays to Video | Rendley SDK Docs"
description: "Render styled text on the video canvas. Font selection, color, stroke, drop shadow, letter spacing, line height, alignment and multi-line support."
url: https://docs.rendley.com/sdk/getting-started/clips/text/
---

# Text clips

The [TextClip](https://docs.rendley.com/sdk/api-reference/classes/TextClip.html) renders text directly on the canvas. It supports font selection, color, stroke, drop shadow, letter spacing, line height, and more.

## Create a text clip

Runnable exampleShow full code

Run

```
const textClip = await layer.addClip({
  type: "text",
  text: "Hello World",
  startTime: 0,
  duration: 5,
  style: {
    fontSize: 120,
    color: "#FFFFFF",
  },
});

textClip.style.setPosition(960, 540);
```

## Change the text

```
textClip.setText("New Text");
const current = textClip.getText();
```

## Background color

The text clip supports a solid background that sits behind the text:

```
textClip.style.setBackgroundColor("#0000FF");
```

## Typography

The [TextStyle](https://docs.rendley.com/sdk/api-reference/classes/TextStyle.html) exposes additional controls for typography:

```
textClip.style.setFontFamily("Inter");
textClip.style.setFontWeight("700");
textClip.style.setLetterSpacing(2);
textClip.style.setLineHeight(1.5);
textClip.style.setStrokeColor("#000000");
textClip.style.setStrokeThickness(2);
textClip.style.setPadding(10);
```

Custom fonts must be loaded through the [FontRegistry](https://docs.rendley.com/sdk/getting-started/fonts/) before you can use them here.

## Resizing text

Text clips have two independent ways to change size:

- **`style.setFontSize(px)`**: changes the glyph size. Re-rasterizes the text, so edges stay crisp.
- **`style.setScale(scaleX, scaleY)`**: scales the rendered clip uniformly. Cheaper if you want to animate size (scale can be keyframed without re-rasterizing on every frame).

Use `setFontSize` for static sizing and final layout. Use `setScale` when you’re animating or responding to the canvas size at runtime.

Runnable exampleShow full code

Run

```
const textClip = await layer.addClip({
  type: "text",
  text: "Resize me",
  startTime: 0,
  duration: 5,
  style: { fontSize: 60, color: "#FFFFFF" },
});
textClip.style.setPosition(960, 540);

// Grow the font size and then scale further. Both stack.
textClip.style.setFontSize(200);
textClip.style.setScale(1.2, 1.2);
```

To animate the size over time, keyframe `scaleX` and `scaleY` through the [Property Animator](https://docs.rendley.com/sdk/getting-started/property-animator/), don’t animate `fontSize` per frame; it’s not an animatable property and would re-rasterize constantly.

## Drop shadow

Runnable exampleShow full code

Run

```
const textClip = await layer.addClip({
  type: "text",
  text: "Drop Shadow",
  startTime: 0,
  duration: 5,
  style: { fontSize: 160, color: "#FFFFFF" },
});
textClip.style.setPosition(960, 540);

textClip.style.setDropShadowColor("#000000");
textClip.style.setDropShadowAlpha(0.6);
textClip.style.setDropShadowBlur(8);
textClip.style.setDropShadowDistance(10);
textClip.style.setDropShadowAngle(Math.PI / 4);
```

## What to read next

- **[Styling](https://docs.rendley.com/sdk/getting-started/styling/)** positions, scales, rotates and colors a clip.
- **[Fonts](https://docs.rendley.com/sdk/getting-started/fonts/)** loads Google Fonts or your own files for text clips.
- **[HTML text clips](https://docs.rendley.com/sdk/getting-started/clips/html-text/)** render rich inline markup when plain text is not enough.
- API reference: [`TextClip`](https://docs.rendley.com/sdk/api-reference/classes/TextClip.html), [`TextStyle`](https://docs.rendley.com/sdk/api-reference/classes/TextStyle.html).

[Previous pageImage clips](https://docs.rendley.com/sdk/getting-started/clips/image/) [Next pageHTML text clips](https://docs.rendley.com/sdk/getting-started/clips/html-text/)
