Font operations

5 operations named font.*. Every one runs in a batch through apply_ops, dry_run_ops, the CLI or the admin.

Updated
OperationWhat it doesPermissionConfirmation
font.listfont.list with verified bytes and retained undo assets.site.readnone
font.recordUploadfont.recordUpload with verified bytes and retained undo assets.site.editnone
font.uploadUpload a font face from its base64 bytes: a WOFF2 file (the bytes decide, by their signature), checked like the admin upload (file size, the site's font quota, the family name) and stored with its family name, weight, style, display, fallback stack and licence note.site.editnone
font.deletefont.delete with verified bytes and retained undo assets.site.editdestructive
font.importGoogleSelf-host a Google Fonts family: fetch its latin and latin-ext woff2 faces for the weights and styles asked, check the answers, and store one face per weight, style and subset with its unicode-range and the family's Google Fonts licence page as the licence note.site.editnone

font.list

font.list with verified bytes and retained undo assets.

permission: site.readreads onlyclass: read

Example input

{}

Input

The input is a record; see the schema below.

{
  "type": "object",
  "properties": {},
  "additionalProperties": false
}

Output

FieldTypeRequiredNotes
fontsarray of objectyes
fonts[].idstring (uuid)yes
fonts[].fileNamestringyesAt least 1 character. At most 255 characters.
fonts[].mimeType"font/woff2"yes
fonts[].namestringyesAt least 1 character. At most 100 characters.
fonts[].weightintegeryesAt least 1. At most 1000.
fonts[].stylestringyesOne of "normal", "italic".
fonts[].displaystringyesOne of "swap", "block", "fallback", "optional".
fonts[].fallbackStackstring | nullyes
fonts[].siteIdstringyes
fonts[].familyKeystringyes
fonts[].fileSizeintegeryesAt least 0.
fonts[].urlstringyes
fonts[].sourcestringyesOne of "upload", "google", "blueprint".
fonts[].licencestring | nullyes
fonts[].unicodeRangestring | nullyes
fonts[].isVariableFontbooleanyes
fonts[].axesJsonrecord of array of value | nullno
fonts[].refCountintegeryesAt least 0.
fonts[].createdAtstringyes
fonts[].updatedAtstringyes
fonts[].createdBystring | nullno

Try it

yarn splash font.list '{}' --dry-run

font.recordUpload

font.recordUpload with verified bytes and retained undo assets.

permission: site.editwrites: fontsclass: transactionundo: yes

Example input

{
  "id": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d",
  "storageKey": "fonts/dm-sans-400.woff2",
  "fileName": "dm-sans-400.woff2",
  "mimeType": "font/woff2",
  "name": "DM Sans",
  "weight": 400,
  "style": "normal",
  "display": "swap",
  "fallbackStack": "system-ui, sans-serif"
}

Input

FieldTypeRequiredNotes
idstring (uuid)yes
storageKeystringyesAt least 1 character. At most 500 characters.
fileNamestringyesAt least 1 character. At most 255 characters.
mimeType"font/woff2"yes
namestringyesAt least 1 character. At most 100 characters.
weightintegeryesAt least 1. At most 1000.
stylestringyesOne of "normal", "italic".
displaystringyesOne of "swap", "block", "fallback", "optional".
fallbackStackstring | nullyes
replacebooleanno

Output

FieldTypeRequiredNotes
idstring (uuid)yes
fileNamestringyesAt least 1 character. At most 255 characters.
mimeType"font/woff2"yes
namestringyesAt least 1 character. At most 100 characters.
weightintegeryesAt least 1. At most 1000.
stylestringyesOne of "normal", "italic".
displaystringyesOne of "swap", "block", "fallback", "optional".
fallbackStackstring | nullyes
siteIdstringyes
familyKeystringyes
fileSizeintegeryesAt least 0.
urlstringyes
sourcestringyesOne of "upload", "google", "blueprint".
licencestring | nullyes
unicodeRangestring | nullyes
isVariableFontbooleanyes
axesJsonrecord of array of value | nullno
refCountintegeryesAt least 0.
createdAtstringyes
updatedAtstringyes
createdBystring | nullno

Try it

yarn splash font.recordUpload '{"id":"7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d","storageKey":"fonts/dm-sans-400.woff2","fileName":"dm-sans-400.woff2","mimeType":"font/woff2","name":"DM Sans","weight":400,"style":"normal","display":"swap","fallbackStack":"system-ui, sans-serif"}' --dry-run

font.upload

Upload a font face from its base64 bytes: a WOFF2 file (the bytes decide, by their signature), checked like the admin upload (file size, the site's font quota, the family name) and stored with its family name, weight, style, display, fallback stack and licence note. Record the licence the face is used under in licence (for example the foundry's terms or the licence file's name); the library shows it with the face. A face the library already holds is refused (409 font_face_exists) unless replace is set. The face is in the draft at once; the public site draws it after the next publish.

permission: site.editwrites: fontsclass: transactionundo: yes

Example input

{
  "fileName": "inter-400.woff2",
  "name": "Inter",
  "weight": 400,
  "style": "normal",
  "display": "swap",
  "fallbackStack": "system-ui, sans-serif",
  "licence": "SIL Open Font License 1.1",
  "data": "d09GMgABAAAAAAQ4AA0AAAAACKgAAAPhAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
}

Input

FieldTypeRequiredNotes
fileNamestringyesAt least 1 character. At most 255 characters.
namestringyesAt least 1 character. At most 100 characters.
weightintegeryesAt least 1. At most 1000.
stylestringyesOne of "normal", "italic".
displaystringnoOne of "swap", "block", "fallback", "optional". Default "swap".
fallbackStackstring | nullno
licencestring | nullno
replacebooleanno
datastringyesAt least 1 character. At most 16777216 characters.

Output

FieldTypeRequiredNotes
idstring (uuid)yes
fileNamestringyesAt least 1 character. At most 255 characters.
mimeType"font/woff2"yes
namestringyesAt least 1 character. At most 100 characters.
weightintegeryesAt least 1. At most 1000.
stylestringyesOne of "normal", "italic".
displaystringyesOne of "swap", "block", "fallback", "optional".
fallbackStackstring | nullyes
siteIdstringyes
familyKeystringyes
fileSizeintegeryesAt least 0.
urlstringyes
sourcestringyesOne of "upload", "google", "blueprint".
licencestring | nullyes
unicodeRangestring | nullyes
isVariableFontbooleanyes
axesJsonrecord of array of value | nullno
refCountintegeryesAt least 0.
createdAtstringyes
updatedAtstringyes
createdBystring | nullno

Try it

yarn splash font.upload '{"fileName":"inter-400.woff2","name":"Inter","weight":400,"style":"normal","display":"swap","fallbackStack":"system-ui, sans-serif","licence":"SIL Open Font License 1.1","data":"d09GMgABAAAAAAQ4AA0AAAAACKgAAAPhAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}' --dry-run

font.delete

font.delete with verified bytes and retained undo assets.

permission: site.editwrites: fontsclass: transactionconfirm: destructiveundo: yes

Example input

{
  "fontId": "7a8b9c0d-1e2f-4a3b-9c4d-5e6f7a8b9c0d"
}

Input

FieldTypeRequiredNotes
fontIdstring (uuid)yes

Output

FieldTypeRequiredNotes
successtrueyes

Needs confirmed: ["destructive"] on the batch, which the single-operation CLI form does not set: put it in a batch file and run yarn splash apply <file> --dry-run.

font.importGoogle

Self-host a Google Fonts family: fetch its latin and latin-ext woff2 faces for the weights and styles asked, check the answers, and store one face per weight, style and subset with its unicode-range and the family's Google Fonts licence page as the licence note. A face the library already holds is refused (409 font_face_exists) unless replace is set: that face then leaves the library, the live site keeping it until the next publish, and the new one takes its place. A failure stores nothing.

permission: site.editwrites: fontsclass: transactionundo: yes

Example input

{
  "family": "DM Sans",
  "weights": [
    400,
    700
  ],
  "styles": [
    "normal"
  ],
  "display": "swap"
}

Input

FieldTypeRequiredNotes
familystringyesAt least 1 character. At most 100 characters.
weightsarray of integeryesAt least 1 item. At most 9 items.
stylesarray of stringyesAt least 1 item. At most 2 items.
displaystringyesOne of "swap", "block", "fallback", "optional".
replacebooleanno

Output

FieldTypeRequiredNotes
fontsarray of objectyes
fonts[].idstring (uuid)yes
fonts[].fileNamestringyesAt least 1 character. At most 255 characters.
fonts[].mimeType"font/woff2"yes
fonts[].namestringyesAt least 1 character. At most 100 characters.
fonts[].weightintegeryesAt least 1. At most 1000.
fonts[].stylestringyesOne of "normal", "italic".
fonts[].displaystringyesOne of "swap", "block", "fallback", "optional".
fonts[].fallbackStackstring | nullyes
fonts[].siteIdstringyes
fonts[].familyKeystringyes
fonts[].fileSizeintegeryesAt least 0.
fonts[].urlstringyes
fonts[].sourcestringyesOne of "upload", "google", "blueprint".
fonts[].licencestring | nullyes
fonts[].unicodeRangestring | nullyes
fonts[].isVariableFontbooleanyes
fonts[].axesJsonrecord of array of value | nullno
fonts[].refCountintegeryesAt least 0.
fonts[].createdAtstringyes
fonts[].updatedAtstringyes
fonts[].createdBystring | nullno

Try it

yarn splash font.importGoogle '{"family":"DM Sans","weights":[400,700],"styles":["normal"],"display":"swap"}' --dry-run

Generated from the operation registry and the MCP tool catalogue (source 5b5854f17eed4d15).

Something wrong on this page? Write to docs@librettocms.com.

Libretto docs

Colophon. These docs are a Libretto site: 68 pages in two languages, 20 guide pages imported from Markdown and 41 reference pages generated from the operation registry. Set in Softcore, with code in IBM Plex Mono. Its outline:

/ Libretto docs /start Get started /start/request-access Request access /start/workspace Your workspace /start/first-site Your first site /start/invite-a-client Invite a client /start/connect-claude Connect Claude to Libretto /build Build /build/first-page Build a page /build/layers-and-canvas Layers and canvas /build/site-components Site components /design-system Design system /design-system/tokens Colours, space and themes /design-system/components Components and variants /design-system/fonts Typography and fonts /motion Motion /motion/scenes Scenes and recipes /motion/image-sequences Image sequences /motion/reduced-motion Reduced motion /publish Publish /publish/languages Site languages /publish/versions Publish and versions /publish/members-and-forms Members and forms /publish/domains Domains /handover Hand a site to a client /glossary Glossary /agents Agents and API /agents/mcp MCP server /agents/cli CLI /agents/batches Batches /agents/errors Errors and findings /agents/operations Operations /search Search