set_custom_font
Register a typeface Morpha does NOT ship, so text layers can use it by family name via font_family (exactly like a built-in family). Families already in the built-in catalogs (anything list_fonts returns from google/bunny/fontshare/fontsource/velvetyne) are REJECTED — they need no registration; just set font_family to them directly. src is EITHER a full URL (https://…) OR a font file already uploaded to the project's asset bucket (POST /api/upload-asset/, raw bytes + X-Filename header; .woff2/.woff/.ttf/.otf). Like add_image_layer, this does NOT verify an uploaded filename exists. Dedupes by family+weight+style, replacing a matching face. After registering, set a text layer's font_family to this family (add_text_layer / set_layer_text). NOTE: a pasted URL only loads if that host sends permissive CORS headers — uploading the font (served same-origin) is the robust path.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| src | Yes | A full font URL (https://…/font.woff2) OR an uploaded asset filename in the project's bucket. | |
| style | No | Optional face style. Defaults to normal. | |
| family | Yes | Family name text layers will reference via font_family, e.g. "Mylius Modern". | |
| weight | No | Optional specific weight (1-1000) this src provides. Omit for the 400/normal baseline. | |
| projectId | Yes | Opaque project id (a v4 UUID, from list_projects/create_project). Selects which existing project this call mutates. |