Changes data

quotecloud_add_document_font

Store a font file with this document, so its text renders in that font wherever the document goes: the viewer, PDFs, the editor, and every copy, including documents made from it as a template. Copies the file from a public HTTPS URL (WOFF2, WOFF, TTF or OTF, up to 10 MB; same download guard as quotecloud_import_document_asset) into the document's fonts folder and lists it in the document's fonts. Call once per weight and style of a family, with the same name each time. Text uses the font through the returned cssVariable, written as var(--font-<slug>) in font-family (text marks, block and document typography). A font with the same name, weight and style replaces the earlier one, so retries are safe. Only add fonts whose licence allows redistribution (e.g. SIL Open Font License): a template's fonts reach everyone who uses it.

Inputs

documentRefRequired
QuoteCloud document display ID. string
urlRequired
string
nameRequired
Font family name, e.g. "Newsreader". Its slug gives the CSS variable --font-<slug>. string
weightOptional
CSS font-weight this file provides. Defaults to 400. number
italicOptional
True when this file is the italic style. boolean