Skip to main content

SubtitleStyles (legacy)

SubtitleStyles is the legacy style block for subtitles. It is still fully supported — existing projects render identically — but new projects should use the flat fields on Subtitle (animation, font, stroke, background, position, margin, …). A subtitle object cannot combine styles with the flat style fields.

interface SubtitleStyles {
color?: string;
background?: string;
backgroundPadding?: number;
isBold?: boolean;
isItalic?: boolean;
fontSize?: number;
fontFamily?: string;
textTransform?: "uppercase" | "lowercase" | "capitalize";
outline?: {
width: number;
color: string;
};
position?:
| "top-left"
| "top-center"
| "top-right"
| "bottom-left"
| "bottom-center"
| "bottom-right"
| "center-center"
| "center-left"
| "center-right";
marginV?: number;
marginH?: number;
mode?:
| "normal"
| "none"
| "one-word"
| "karaoke"
| "progressive"
| "highlight"
| "fill"
| "pop"
| "bounce"
| "fade"
| "typewriter"
| "slide";
slideDirection?: "up" | "down" | "left" | "right";
activeWord?: {
color?: string;
background?: string;
};
}
PropertyDefaultFlat equivalent on SubtitleNotes
color#FFFFFFfont.colorHex with optional alpha.
backgroundnonebackground.color (+opacity)Hex with optional alpha.
backgroundPadding0background.paddingBox padding in px.
fontSize50font.sizePixels.
fontFamilyPoppinsfont.familyGoogle Fonts family name.
isBold, isItalicfalsefont.bold, font.italicTypography flags.
textTransformnonefont.transformuppercase, lowercase, or capitalize.
outlinenonestrokeRequires width and color.
positionbottom-centerpositionFull 9-grid; flat form adds top/center/bottom.
marginV, marginH5% of project sizemargin.y, margin.xInteger pixels.
modenormalanimationAll 12 animations — see Subtitle.
slideDirectionupdirectionslide mode only.
activeWordnoneactiveWordColor and/or background of the spoken word.

Used By