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
| 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
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
{
"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.