You will learn#
- how to import a fontA set of letters, numbers and signs with one style of drawing. file and what the import returns;
- how to read and replace the brand kitYour logo, colours and fonts saved once, so every video matches.;
- how a template takes its colours and fonts from the kit.
The idea#
The editor comes with bundled font families (stuarty fonts lists them). To use another font, import the TrueType or OpenType file: it is checked and stored once by its content hash, so importing the same file twice stores one copy. The import returns the hash that font.add needs to add the font to a project.
The brand kit is one small document with three optional members: a logo (the sha256: hash of an image asset), colors (names such as accent with a #RRGGBB or #RRGGBBAA value) and fonts (families you imported, with one file per weight). There is one kit per workspace, and one per user in network mode. Replacing the kit replaces all three members at once.
A template that is started with brand_colors or brand_fonts takes values from the kit: each named colour of the template gets the kit's colour, so every style that says $accent draws the brand colour, and each named family is added to the fonts of the new project. A name the kit or the template lacks is E_VALIDATION, and nothing is created.
In the app, Brand kit is in the Assets group of the sidebar, and also a section of Settings. Choose the Logo from the images of the workspace, Add colour with a name and a value, Import font from a path on the machine of the service, and Save brand kit. The preview, How it looks in a video, uses the first two colours and the first font.
Quick start#
stuarty font:import ./Brand-Regular.ttf
cat > brand.json <<'JSON'
{"colors": {"accent": "#FF3366"},
"fonts": {"Brand Sans": {"files": [{"weight": 400, "hash": "sha256:9f2c...e41a"}]}}}
JSON
stuarty brand:set --kit brand.json
stuarty brand:show
stuarty template:new tpl_5n8b2v6c1x --name "Spring sale" --brand-color accent --brand-font "Brand Sans"--brand-color and --brand-font can be repeated or hold a comma list. --kit - reads the kit from standard input.
The font import and the brand kit have no MCP tool: they change what the whole workspace can use, so they are for the person at the terminal, the editor or the HTTP API. Starting a template with the kit (brand_colors, brand_fonts) is done with template:new or the HTTP API; the template tool does not take those members.
font:import needs the media scope and brand:set the edit scope; brand:show only reads. A key limited to one project can use none of them. The path of font:import is made absolute and read on the machine that runs the server.
Common mistakes#
- Importing a file that is not a usable TrueType or OpenType font:
E_VALIDATION. - Naming a brand family like a bundled one:
E_VALIDATION. Choose another name. - Passing a colour without the leading
#, or in a form other than#RRGGBBor#RRGGBBAA:E_VALIDATION. - Starting a template with a
brand_colorsname that is not a colour of the template (brand_color_unknown) or that the kit lacks (brand_color_missing).