// Fontes do estilo Cartoon (carregadas pela Remotion antes do 1ยบ quadro). As cores ficam em colors.ts. import { continueRender, delayRender, staticFile } from "remotion"; import { FONT_CAPTION, FONT_LABEL } from "./colors"; export * from "./colors"; let loaded = false; /** Carrega as fontes de assets/fonts antes do primeiro quadro (o render espera). */ export function loadFonts(): void { if (loaded || typeof document === "undefined") return; loaded = true; const handle = delayRender("fontes do Cartoon"); const faces = [ new FontFace(FONT_CAPTION, `url(${staticFile("fonts/Anton-Regular.ttf")})`), new FontFace(FONT_LABEL, `url(${staticFile("fonts/BebasNeue-Regular.ttf")})`), ]; Promise.all(faces.map((f) => f.load().then((ok) => document.fonts.add(ok)))) .then(() => continueRender(handle)) .catch((error) => { console.error("fontes do Cartoon:", error); continueRender(handle); }); }