Operazioni sui font

5 operazioni di nome font.*. Ognuna si esegue in un batch con apply_ops, dry_run_ops, la CLI o l’admin.

Aggiornato il
OperationWhat it doesPermissionConfirmation
font.listList the site's font library: each face with its id, family name, weight, style, display, unicode range, source (upload, google or blueprint), licence note and file URL.site.readnone
font.recordUploadRecord a WOFF2 face the admin staged through its upload endpoint (id, storageKey, and the face's family name, weight, style, display and fallback stack) after checking its bytes again.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.deleteDelete one face of the library by fontId.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

List the site's font library: each face with its id, family name, weight, style, display, unicode range, source (upload, google or blueprint), licence note and file URL. A font.family.* token names a family by its name. Undo restores the library; its files are kept.

permission: site.readreads onlyclass: read

Esempio di input

{}

Input

L’input è un record: vedi lo schema qui sotto.

{
  "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

Provala

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

font.recordUpload

Record a WOFF2 face the admin staged through its upload endpoint (id, storageKey, and the face's family name, weight, style, display and fallback stack) after checking its bytes again. With the bytes in hand, upload with font.upload instead. Undo restores the library; its files are kept.

permission: site.editwrites: fontsclass: transactionundo: yes

Esempio di 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

Provala

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. Undo restores the library; its files are kept.

permission: site.editwrites: fontsclass: transactionundo: yes

Esempio di 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

Provala

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

Delete one face of the library by fontId. The last face of a family is refused while a font.family.* token of any theme names that family (409 font_family_in_use, with the tokens): point them at another family first. Undo restores the library; its files are kept.

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

Esempio di input

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

Input

FieldTypeRequiredNotes
fontIdstring (uuid)yes

Output

FieldTypeRequiredNotes
successtrueyes

Vuole confirmed: ["destructive"] sul batch, che la forma della CLI per una sola operazione non imposta: mettila in un file di batch ed esegui 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. Undo restores the library; its files are kept.

permission: site.editwrites: fontsclass: transactionundo: yes

Esempio di 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

Provala

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

Generato dal registro delle operazioni e dal catalogo degli strumenti MCP (sorgente 9fc016b5e395bb00).

Qualcosa non va in questa pagina? Scrivi a docs@librettocms.com.

Guida di Libretto

Colophon. Questa guida è un sito Libretto: 70 pagine in due lingue, 21 pagine della guida importate da Markdown e 42 pagine di riferimento generate dal registro delle operazioni. Composta in Softcore, il codice in IBM Plex Mono. La sua struttura:

/it/ Guida di Libretto /it/start Per iniziare /it/start/request-access Richiedere l'accesso /it/start/workspace Il tuo spazio di lavoro /it/start/first-site Il tuo primo sito /it/start/invite-a-client Invitare un cliente /it/start/connect-claude Connettere Claude a Libretto /it/build Costruire /it/build/first-page Costruire una pagina /it/build/layers-and-canvas Livelli e canvas /it/build/site-components Componenti del sito /it/design-system Design system /it/design-system/tokens Colori, spazi e temi /it/design-system/components Componenti e varianti /it/design-system/fonts Tipografia e font /it/motion Movimento /it/motion/scenes Scene e ricette /it/motion/image-sequences Sequenze di immagini /it/motion/reduced-motion Movimento ridotto /it/publish Pubblicazione /it/publish/languages Le lingue del sito /it/publish/versions Pubblicazione e versioni /it/publish/members-and-forms Iscritti e moduli /it/publish/domains Domini /it/publish/redirects Reindirizzamenti /it/handover Consegnare un sito al cliente /it/glossary Glossario /it/agents Agenti e API /it/agents/mcp Server MCP /it/agents/cli CLI /it/agents/batches Batch /it/agents/errors Errori e segnalazioni /it/agents/operations Operazioni /it/search Cerca