diff --git a/jobs/captions/animate.mdx b/jobs/captions/animate.mdx index 7026729..4658551 100644 --- a/jobs/captions/animate.mdx +++ b/jobs/captions/animate.mdx @@ -138,13 +138,15 @@ curl -X POST https://api.rendobar.com/jobs \ - URL of a TTF or OTF font file. Set `style.font` to that font's family name to render captions in it. See [Fonts](#fonts). + URL of your own font file (TTF, OTF, TTC, WOFF, WOFF2). Captions render in it, and it takes priority over `style.font`, so you do not need to know the family name inside your own file. See [Fonts](#fonts). ## Fonts Eleven presets ship with sensible default fonts. To pick a different one, set `style.font` to a bundled family. No upload needed. +Any [Google Fonts](https://fonts.google.com) family also works by name and is fetched at render time, and `style.font` accepts a CSS fallback stack like `"Lato, Inter, sans-serif"` that falls through in order. + | Bundled family | Pass as `style.font` | | --- | --- | | Inter | `"Inter"` | @@ -155,10 +157,8 @@ Eleven presets ship with sensible default fonts. To pick a different one, set `s | Roboto | `"Roboto"` | | Oswald | `"Oswald"` | -To use your own font, pass two values together: - -1. The font file URL as the `font` input. -2. The font's real family name as `style.font`. +To use your own font, pass its URL as the `font` input. It wins over +`style.font`, so nothing else is required: ```json { @@ -167,13 +167,13 @@ To use your own font, pass two values together: "source": "https://cdn.rendobar.com/assets/examples/sample.mp4", "font": "https://example.com/MyBrand.ttf" }, - "params": { - "preset": "gold", - "style": { "font": "My Brand" } - } + "params": { "preset": "gold" } } ``` +Naming the family embedded in the file as `style.font` still works, so an +existing integration that does both keeps rendering the same way. + `style.font` must match the family name baked into the file, not the filename or URL. If it does not match, the renderer falls back to the preset font. Like every job, this returns the standard response. See [Job output](/concepts/job#the-output) for the shape and how to read the result. diff --git a/jobs/captions/burn.mdx b/jobs/captions/burn.mdx index 1359776..535f7ef 100644 --- a/jobs/captions/burn.mdx +++ b/jobs/captions/burn.mdx @@ -97,14 +97,22 @@ Omit `subtitles` to auto-transcribe. The spoken language is detected by default URL of an SRT, VTT, or ASS subtitle file. A provided ASS file is burned as-is, preserving its own styling. Omit to auto-transcribe the audio. + + URL of your own font file (TTF, OTF, TTC, WOFF, WOFF2). Captions render in it, and it takes priority over `fontFamily`, so you do not need to know the family name inside your own file. An uploaded asset's content URL works here. + + ## Parameters Spoken language for the auto-transcribe path, as an ISO-639-1 code (e.g. `en`, `es`, `ja`) or `auto` to detect. English uses a faster model. Everything else routes to multilingual transcription. Ignored when a subtitle file is provided. - - Font family. Must resolve to a font available to the renderer. + + Font family, or a CSS fallback stack. Any [Google Fonts](https://fonts.google.com) family works by name and is fetched at render time. Seven are bundled and resolve instantly: `Inter`, `Roboto`, `Montserrat`, `Poppins`, `Oswald`, `Anton`, `Bebas Neue`. A stack falls through in order, so `"Lato, Inter, sans-serif"` tries each in turn. To render in your own file, pass its URL as the `font` **input**, which wins over this parameter. + + + + Deprecated alias for `font`. Still accepted so existing clients keep working. `font` wins when both are present. diff --git a/jobs/compose.mdx b/jobs/compose.mdx index 000b593..7a0ffe4 100644 --- a/jobs/compose.mdx +++ b/jobs/compose.mdx @@ -270,7 +270,7 @@ Effects are fields on a clip. Stack as many as you like on one clip. Each exampl ## Text and titles -A `text` asset renders a styled title. Set the `font`, `size`, `weight`, `color`, `position`, and an `animate` entrance (`fade`, `slideUp`, `slideDown`, `slideLeft`, `slideRight`). Put one text clip on its own track for a title card, another low and left for a lower-third name tag. +A `text` asset renders a styled title. Set the `font`, `size`, `weight`, `color`, `position`, and an `animate` entrance (`fade`, `slideUp`, `slideDown`, `slideLeft`, `slideRight`). Put one text clip on its own track for a title card, another low and left for a lower-third name tag. `font` takes any Google Fonts family by name, or a family from your own file. See [Fonts](#fonts). ```json "asset": { @@ -291,6 +291,106 @@ A `text` asset renders a styled title. Set the `font`, `size`, `weight`, `color`