Skip to content

Creative tools

Fonts and the brand kit

Import your own fonts, keep your colours, fonts and logo in one brand kit, and apply them when you start a project from a template.

Last updated:

You will learn#

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#

Terminal
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.

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 #RRGGBB or #RRGGBBAA: E_VALIDATION.
  • Starting a template with a brand_colors name that is not a colour of the template (brand_color_unknown) or that the kit lacks (brand_color_missing).

Next steps#