# renderString()

> Server/worker-friendly helper that paints a text string onto a provided canvas.

```ts
function renderString(
   canvas, 
   text, 
   options
): Promise<boolean>;
```

Server/worker-friendly helper that paints a text string onto a provided canvas.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `canvas` | `HTMLCanvasElement` | Destination canvas that should receive the rendered text. |
| `text` | `string` | Arbitrary content that needs to be painted. |
| `options` | \{ `preset`: [`StylePreset`](/docs/api/interfaces/StylePreset); \} | Rendering options that include the style preset. |
| `options.preset` | [`StylePreset`](/docs/api/interfaces/StylePreset) | - |

## Returns

`Promise`\<`boolean`\>

Resolves once the frame has been painted (always resolves to `true`).

## Remarks

Uses the same Konva pipeline as the video overlay renderer so the results
match what users see in the browser.

Source: https://captionsjs.dev/docs/api/functions/renderString
