Film kit command

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)
Changes the document
yes

Parameters

Parameters of caption.setStyle
NameTypeRequiredDescription
align"left" | "center" | "right"no
anchor"top" | "middle" | "bottom"no
backgroundbooleanno
backgroundColorstringnolike #rrggbbaa
colorstringnolike #rrggbb[aa]
fontstringno
highlightColorstringnolike #rrggbb[aa]; karaoke word
highlightScalenumberno0.25 to 4; karaoke word size
lineSpacingnumberno
marginnumberno0 to 0.45; fraction of frame height
outlinenumberno
outlineColorstringno
resetbooleanno
sizenumberno
trackstring | integernoid|"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/[email protected] and the kit itself (film_commands through @kition/[email protected], built from KitionAI/kition-film@375db59). As data: commands.jsonl.