---
title: "caption.setStyle: Caption Track Style — Film kit command — Kition"
description: "Sets a caption track's look: font, size, color, background, align, anchor, margin (fraction of frame height, 0–0.45), line spacing, outline, and for karaoke captions `highlightColor` and `highlightScale` (0.25–4) of the word being sung; `reset` restores defaults. Applies to every caption on the track."
canonical: "https://developer.kition.ai/docs/kits/film/commands/caption.setStyle"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/film/commands/caption.setStyle](https://developer.kition.ai/docs/kits/film/commands/caption.setStyle)

# caption.setStyle

**Caption Track Style.** Sets a caption track's look: font, size, color, background, align, anchor, margin (fraction of frame height, 0–0.45), line spacing, outline, and for karaoke captions `highlightColor` and `highlightScale` (0.25–4) of the word being sung; `reset` restores defaults. Applies to every caption on the track.

- Kit: Film 0.1.0 (.kfilm); reference: [Film kit commands](https://developer.kition.ai/docs/kits/film.md)
- Changes the document: yes

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `align` | `"left" \| "center" \| "right"` | no |  |
| `anchor` | `"top" \| "middle" \| "bottom"` | no |  |
| `background` | `boolean` | no |  |
| `backgroundColor` | `string` | no | like #rrggbbaa |
| `color` | `string` | no | like #rrggbb[aa] |
| `font` | `string` | no |  |
| `highlightColor` | `string` | no | like #rrggbb[aa]; karaoke word |
| `highlightScale` | `number` | no | 0.25 to 4; karaoke word size |
| `lineSpacing` | `number` | no |  |
| `margin` | `number` | no | 0 to 0.45; fraction of frame height |
| `outline` | `number` | no |  |
| `outlineColor` | `string` | no |  |
| `reset` | `boolean` | no |  |
| `size` | `number` | no |  |
| `track` | `string \| integer` | no | id\|"C1" |

## Call through film_run

```text
film_run {
  "path": "<file>.kfilm",
  "steps": [{ "command": "caption.setStyle" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `align`, `anchor`, `background`, `backgroundColor`, `color`, `font`, `highlightColor`, `highlightScale`, `lineSpacing`, `margin`, `outline`, `outlineColor`, `reset`, `size`, `track`. film_run answers the step’s result in `completed[i].result`.

## Result

The kit gives no result schema for this command.

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "align": {
      "enum": [
        "left",
        "center",
        "right"
      ],
      "type": "string"
    },
    "anchor": {
      "enum": [
        "top",
        "middle",
        "bottom"
      ],
      "type": "string"
    },
    "background": {
      "type": "boolean"
    },
    "backgroundColor": {
      "description": "like #rrggbbaa",
      "type": "string"
    },
    "color": {
      "description": "like #rrggbb[aa]",
      "type": "string"
    },
    "font": {
      "type": "string"
    },
    "highlightColor": {
      "description": "like #rrggbb[aa]; karaoke word",
      "type": "string"
    },
    "highlightScale": {
      "description": "0.25 to 4; karaoke word size",
      "type": "number"
    },
    "lineSpacing": {
      "type": "number"
    },
    "margin": {
      "description": "0 to 0.45; fraction of frame height",
      "type": "number"
    },
    "outline": {
      "type": "number"
    },
    "outlineColor": {
      "type": "string"
    },
    "reset": {
      "type": "boolean"
    },
    "size": {
      "type": "number"
    },
    "track": {
      "description": "id|\"C1\"",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "integer"
        }
      ]
    }
  },
  "type": "object"
}
```

Generated from the command list of @kition/film-darwin-arm64@0.1.0 and the kit itself (film_commands through @kition/cli@0.1.1, built from KitionAI/kition-film@375db59).
