Some checks are pending
build-images / api (push) Waiting to run
build-images / worker-gpu (push) Waiting to run
build-images / web (push) Waiting to run
codeql / Analyze (javascript-typescript) (push) Waiting to run
codeql / Analyze (python) (push) Waiting to run
perf / API hot-path micro-smoke (budgeted) (push) Waiting to run
perf / Desktop engine crates (release build check) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Waiting to run
vision2026-ci / API phase modules (ruff + pytest) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Waiting to run
vision2026-ci / Python SDK resource tests (push) Waiting to run
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Waiting to run
vision2026-ci / Alembic upgrade + drift check (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Waiting to run
Paid, hosted product at menivor.com, now retired as a company project. Fresh squashed history of the cleaned working tree (secret-scanned, no .env, no customer data, no outreach logs). Built on MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
51 lines
1.7 KiB
Python
51 lines
1.7 KiB
Python
"""``CaptionStyle`` + preset registry (mirror of ``src/style.ts`` + ``src/presets``).
|
|
|
|
Presets are plain data; the ASS builder consumes them. Kept identical to the
|
|
TypeScript presets so previews and burned captions match.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class CaptionStyle:
|
|
font: str = "Montserrat Black"
|
|
size: int = 120
|
|
primary_hex: str = "#FFFFFF" # base fill
|
|
highlight_hex: str = "#FFD93D" # karaoke reveal / keyword colour
|
|
outline_hex: str = "#000000"
|
|
outline: int = 4
|
|
shadow: int = 2
|
|
alignment: int = 5 # ASS numpad: 5 = middle-center
|
|
margin_v: int = 0
|
|
bold: bool = True
|
|
uppercase: bool = True
|
|
words_per_group: int = 2
|
|
|
|
|
|
_PRESETS: dict[str, CaptionStyle] = {
|
|
"hormozi": CaptionStyle(), # defaults ARE Hormozi
|
|
"karaoke-classic": CaptionStyle(
|
|
font="Arial", size=90, primary_hex="#FFFFFF", highlight_hex="#35D9FF",
|
|
alignment=2, margin_v=120, uppercase=False, words_per_group=4),
|
|
"minimal-top-label": CaptionStyle(
|
|
font="Helvetica", size=64, primary_hex="#FFFFFF", highlight_hex="#FFFFFF",
|
|
outline=2, shadow=1, alignment=8, margin_v=120, bold=False,
|
|
uppercase=False, words_per_group=1),
|
|
"brainrot-popin": CaptionStyle(
|
|
font="Impact", size=140, primary_hex="#FFFFFF", highlight_hex="#39FF14",
|
|
outline=6, shadow=0, alignment=5, uppercase=True, words_per_group=2),
|
|
}
|
|
|
|
|
|
def get_preset(name: str) -> CaptionStyle:
|
|
if name not in _PRESETS:
|
|
raise KeyError(f"unknown caption preset {name!r}; one of {sorted(_PRESETS)}")
|
|
return _PRESETS[name]
|
|
|
|
|
|
def list_presets() -> list[str]:
|
|
return sorted(_PRESETS)
|