Skip to main content

SubtitleStyles (legacy)

SubtitleStyles is the legacy style block for subtitles. It is still accepted by the renderer, 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;
backgroundRadius?: 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;
radius?: number;
};
}
PropertyDefaultFlat equivalent on SubtitleNotes
color#FFFFFFfont.colorHex with optional alpha.
backgroundnonebackground.color (+opacity)Hex with optional alpha.
backgroundPadding0background.paddingBox padding in px.
backgroundRadius0background.radiusCorner radius in pixels, 0–200.
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 documented modes; none aliases normal. See Subtitle.
slideDirectionupdirectionslide mode only.
activeWordnoneactiveWordColor/background and optional radius (0–200 pixels) of the spoken word.

Used By​