Skip to main content

SubtitleStyles

SubtitleStyles controls subtitle typography, placement, and display mode.

interface SubtitleStyles {
color?: string;
background?: string;
isBold?: boolean;
isItalic?: boolean;
fontSize?: number;
fontFamily?: string;
textTransform?: "uppercase" | "lowercase" | "capitalize";
outline?: {
width: number;
color: string;
};
position?:
| "top-left"
| "top-right"
| "bottom-left"
| "bottom-right"
| "center-center"
| "center-left"
| "center-right";
marginV?: number;
marginH?: number;
mode?: "normal" | "one-word" | "karaoke" | "progressive";
activeWord?: {
color: string;
};
}
PropertyDefaultNotes
color#FFFFFFHex with optional alpha, such as #FFFFFF or #FFFFFFCC.
backgroundnoneHex with optional alpha.
fontSize50Pixels.
fontFamilyPoppinsGoogle Fonts family name.
isBold, isItalicfalseTypography flags.
textTransformnoneuppercase, lowercase, or capitalize.
outlinenoneRequires width and color.
positiondefault placementAPI accepts top-left, top-right, bottom-left, bottom-right, center-center, center-left, and center-right.
marginV, marginHderived from project sizeInteger pixels.
modenormalnormal, one-word, karaoke, or progressive.
activeWord.colornoneUsed by karaoke-style modes.

Used By