# Glyphfield complete documentation Glyphfield is a free, open-source brand design studio in the browser. It turns one brand identity into motion, graphics, templates, and production files. This file contains all 65 pages of the Glyphfield documentation at https://www.glyphfield.com/docs, built from the same MDX source as the human documentation. https://www.glyphfield.com/llms.txt is the short index. Each page is also available as Markdown by adding .md to its URL. --- # Glyphfield documentation Learn how Glyphfield turns one brand identity into designs, motion and code, and find the guide for the Studio, the agent interfaces or the reference. Canonical page: https://www.glyphfield.com/docs Markdown: https://www.glyphfield.com/docs.md Glyphfield is a free, open-source brand design studio released under the MIT License. It runs in the browser and stores your work in that browser. A brand identity in Glyphfield is one record of a brand's strategy, voice, logos, colors, typography, pictures and layout rules. Every tool in the Studio reads that record, so a change to a color or a typeface appears in every design that uses it. The Studio is the visual workspace at [`/studio`](/studio). Studio tools cover brand applications, moodboards, a brand book, animation, Lottie files, layered compositions with live shaders, color and type tokens, social images, code cards, partner lockups, blog covers, slides and interface components. Each tool keeps its work as a JSON source document and exports files that the browser renders. Coding agents can operate the same tools through the Browser API (`window.glyphfield.studio`). They can also generate templates, backgrounds and briefs through an HTTP API that keeps no state between requests. ## Starting points [#starting-points] Create or duplicate a project, edit the identity, choose a tool and export a file. Layer type, marks, images, stickers, live shaders and effects on artboards, then export PNG, JPG, GIF or MP4. Sequence scenes with keyframes, text entrances, transitions, live backgrounds and audio, then export GIF or MP4. Fill the identity by hand or with a coding agent, check its health score and download the brand kit. Choose between HTTP generation, the Studio Browser API and the Markdown docs for an agent task. Pick the right format among PNG, JPG, SVG, GIF, MP4, PDF, Lottie and JSON, and check the file before you use it. See the source document, Browser API actions, HTTP routes and export formats of every Studio tool. Look up endpoints, Browser API methods, source formats, keyboard shortcuts, limits and licensing. ## Connected systems [#connected-systems] The identity holds strategy, art direction, logos, licensed assets, colors, typography, voice, applications and system defaults. Studio tools apply the identity to brand elements, moodboards, the brand book, Design Lab, Animation, Lottie, expression templates, tokens and components. Each tool exposes its exact JSON source. Design Lab and Animation also keep saved checkpoints, autosave recovery and layer history. Agents read versioned discovery routes, call deterministic HTTP generation, read processed Markdown and drive the Studio through the Browser API. ## Studio screenshots [#studio-screenshots] ## Agent interfaces [#agent-interfaces] The visual Studio and the agent interfaces read the same catalogs and validators. * `/api/agent`, `/api/catalog`, `/api/labs`, `/api/materials`, `/api/identities` and `/api/elements` publish the current capabilities. * `POST /api/generate` validates and runs template, background, element-brief and Design Lab sequence requests. `/api/brand/validate` checks an identity, and `/api/brand/kit` renders brand kit files. * `window.glyphfield.studio` operates the active Studio tool. It covers local files, exact source, Canvas, WebGL, GIF and MP4. * Every documentation page is available as processed Markdown at its URL with `.md` appended. **Copy page** at the top of each page copies that Markdown. The menu beside it offers **View as Markdown**, **Open in GitHub**, **Open in ChatGPT**, **Open in Claude**, **Open in Cursor** and **Open in Scira AI**. * `/llms.txt` is a short guide for agents. `/llms-full.txt` contains the complete documentation as one text file. An agent reads the discovery routes first and then chooses HTTP generation or the Browser API. It applies the smallest source change that does the job and checks browser-rendered work visually. It reports success only after it confirms that the returned or downloaded file is not empty. ## Local storage [#local-storage] Projects, saved designs, uploaded files, fonts and drafts stay in the current browser profile. The HTTP API processes each request in memory and cannot read or change a project stored in a browser. The API rejects remote asset URLs. ## Operations and contribution [#operations-and-contribution] Keep the identity, tool source, original assets and rendered proofs in files outside the browser. Find whether a failure comes from source, storage, Canvas, WebGL, a codec or the download, without clearing the active project. Serve the docs, discovery, generation, OpenGraph and Studio routes from your own deployment. Update the catalog, state, source, Browser API, HTTP API, docs, exports and tests in one change. * [Back up and restore a project](/docs/artifacts/backup-and-restore) * [Troubleshoot the Studio and exports](/docs/reference/troubleshooting) * [Check browser capabilities](/docs/reference/browser-support) * [Self-host Glyphfield](/docs/reference/self-hosting) * [Review version compatibility](/docs/reference/version-compatibility) * [Contribute to Glyphfield](/docs/contributing) * [Licensing](/docs/reference/licensing) ## Links [#links] * [Open the Studio](/studio) * [Read the short agent guide](/llms.txt) * [Read the complete documentation as text](/llms-full.txt) * [Inspect the agent manifest](/api/agent) * [Inspect the OpenAPI 3.1 document](/openapi.json) * [View the source on GitHub](https://github.com/Kevin-Liu-01/Glyphfield) Glyphfield's source code and original artwork are released under the [MIT License](https://github.com/Kevin-Liu-01/Glyphfield/blob/main/LICENSE). Bundled third-party marks, fonts, pictures and shader code keep their own licenses. [Licensing](/docs/reference/licensing) lists each one and how to credit it. --- # Getting started Open the Glyphfield Studio, create or copy a brand project, fill in its identity, compose a first design in Design Lab and export it as a file. Canonical page: https://www.glyphfield.com/docs/getting-started Markdown: https://www.glyphfield.com/docs/getting-started.md ## Open the Studio [#open-the-studio] The Studio is Glyphfield's visual workspace. Use the hosted Studio at [glyphfield.com/studio](https://www.glyphfield.com/studio), or run it on your own computer: ```bash pnpm install pnpm dev ``` The local Studio runs at `http://localhost:3012/studio`. The repository uses pnpm 11. [Self-hosting](/docs/reference/self-hosting) describes production builds. ## 1. Choose a project [#1-choose-a-project] A project holds one brand identity and the work of every tool. Open projects appear as tabs above the tool. The **Projects** menu sorts them into four folders: | Folder | Contents | | ---------------- | ------------------------------------------------------------------------------------------------------------------ | | **All projects** | Every project in this browser | | **Templates** | The Starter identity, original Glyphfield work to start from | | **My brands** | Projects you create, copy or import | | **Examples** | Reference identities for Basement, General Translation, Ramp, Mintlify, Tailwind CSS, Vite+, Cloudflare and Stripe | Closing a tab closes its view only. The project stays in **Projects**. You can edit a built-in project in place and later restore its shipped version. The **+** button beside the tabs (**Add brand project**) opens **New project**. A project is a brand, and every tool in it uses that brand, so the menu starts with the brand. **Start a brand** * **Set up with your agent** creates an empty brand and opens **Set up with agent** in Brand identity. Copy the prompt into a coding agent such as Claude Code, Codex or Cursor. The agent reads the brand's website, repository or design files and fills the identity for you. [Brand setup with an agent](/docs/agents/brand-setup) describes the whole run. * **Blank brand** creates an empty brand and opens its overview, where you fill in the name, logos, colors and type yourself. * **Copy a reference brand** copies one of the nine built-in identities into a new project named ` copy 1`. The number rises if that name is taken. **Start with a file** * **Blank design** and **Blank animation** create a new project with an empty brand and an empty Design Lab canvas or Animation timeline. Set up the brand later from Brand identity. * **Import project…** opens a `.glyphfield.json` project file of up to 128 MB as a new project. The browser validates the file and opens it in Design Lab or Animation. An invalid file shows an error and creates nothing. Most new brands should start with the agent. Every tool reads the identity: logo files for light and dark surfaces, colors with their roles and contrast pairs, font files, voice and strategy. By hand, that means finding each hex value, font license and logo variant yourself. The agent copies them from the sources the brand already publishes, notes where each value came from, and runs the brand health audit before you keep the result. **Project → Duplicate active project** copies the identity, the current work in every tool, assets and saved checkpoints. The copy includes edits that are still waiting to autosave. It opens in a new tab and does not share state with the original. If the copy fails, an **Error** button (**Could not duplicate project: show details**) explains the cause. The Browser API (`window.glyphfield.studio`) reaches only the controls of the active tool, so it cannot open **Add brand project**. A browser automation tool clicks **Add brand project** by its accessible label and then the menu item. For a file chooser, it provides a `File` built from bytes it is allowed to use. In Brand identity, the Browser API action `identity.project.create` creates a project directly. After a project opens, wait for the `glyphfield:studio-api-ready` event, then call `readSource()` before editing. ## 2. Set the identity [#2-set-the-identity] For a new brand, start with **Set up with agent** in **Brand identity**. Copy its prompt into Claude Code, Codex or Cursor running with a browser it can drive, such as Playwright, and point it at the brand's website, repository or design files. The agent fills the six editors below through the Browser API, adds the logo and font files, and runs the brand health audit. You then review the score and the sources it cites before you keep the identity. To fill the identity in by hand, open **Brand identity**. **Overview** shows the brand cover, the brand health score and what the identity defines. The editors are: | Editor | Contents | | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Voice & strategy** | Challenge, concept, promise, outcome, pillars, personality, voice principles and examples, audiences, products, proof, customers and sample content for templates | | **Logos & assets** | Five logo slots, the asset library with licenses and sources, and the conversion library | | **Color system** | Palette colors with their shares and the declared text pairs | | **Typography** | Font files, the Display, Body, Accent and Code roles, and the type scale | | **System defaults** | Density, corner radius, logo scale, the graphic device, the pattern and the system rules | | **Direction & references** | The art direction dossier, applications and references | **Brand health** lists missing or failing items, many with a one-click fix. **Brand kit** downloads tokens and guidelines for use in code. Every tool reads the saved identity, so a change here appears in boards, the brand book, templates, components, motion and Design Lab defaults. [Brand identity](/docs/studio/brand-settings) describes each editor. ## 3. Find a tool [#3-find-a-tool] Choose a tool in the left navigation, or press ⌘K (Ctrl+K on Windows and Linux) and search for a word such as `email`, `logo`, `dither`, `slide` or `terminal`. The navigation groups tools into Brand, Motion, Foundations, Expressions and Components. The [Studio overview](/docs/studio) lists every tool. ## 4. Compose and inspect [#4-compose-and-inspect] Most tools share one layout: | Area | Purpose | | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | | Left sidebar | Libraries, catalogs and sources | | Center canvas | The artifact. Scroll to zoom, drag empty space to pan, and use the toolbar to fit or reset the view | | Right inspector | Settings of the selected layer or of the tool | | Tool header | Saving and export | | **File → Edit source code** | The artifact's exact JSON in a drawer. **Apply code** validates and applies it, and an invalid edit leaves the artifact unchanged | **Visual customization** in the Studio header changes the theme, accent color, canvas background, corners, density, motion, tooltips and interface font of the Studio. These settings do not change brand colors in an artifact. [Visual settings](/docs/studio#visual-settings) lists every option. For a first composition, open **Design Lab**, the layered composition tool: 1. Open **Artboard setup** and choose an output size, for example Wide 1600 × 900 or OG Social 1200 × 630. 2. Add text (T), a brand mark (M) or an image (I), or choose a shader from the Shader Library in the left sidebar. 3. Select a layer to edit its geometry, appearance, opacity and material. 4. Scrub shader time to choose an exact frame, and select **Capture shader frame** to keep it. 5. Select **Save checkpoint** before you make variants. ## 5. Export [#5-export] Each tool has its own export actions. | Format | Produced by | | --------------- | ------------------------------------------------------------------------------------------------------------- | | PNG | Design Lab, Animation (poster frame), Lottie (frame), Brand elements, Moodboard and the five expression tools | | JPG | Design Lab | | GIF | Design Lab, Animation and Lottie | | MP4 | Design Lab, Animation (with its audio track) and Lottie | | PDF | Brand book (print) and Slide templates | | SVG | The five expression tools, Moodboard, and HTTP templates and backgrounds | | HTML | Brand element emails | | JSON | Identities, brand element briefs, Design Lab and Animation project files, and Lottie source | | Tokens and code | Color tokens, Typography, Component library and the brand kit | Most exports open **Review export** first. It shows the finished file with its dimensions, file size and editable file name. The download button names the format, for example **Download PNG**. Check clipping, background, text contrast and motion in that preview. After the download, open the file in its target application and confirm that it is not empty. Continue with [Download and use artifacts](/docs/artifacts/download-and-use), [Source code editing](/docs/studio/source-editing) and [Source formats](/docs/reference/source-formats). --- # Studio overview Find every Studio tool by name and ID, manage projects and tabs, search tools, change the visual settings, and learn where the Studio saves your work. Canonical page: https://www.glyphfield.com/docs/studio Markdown: https://www.glyphfield.com/docs/studio.md The Studio is Glyphfield's visual workspace at `/studio`. A project holds one brand identity and a separate draft for every tool. Every tool reads the identity of the active project. `GET /api/labs` returns the current tool list for agents. Every tool has a JSON source document, browser-rendered exports and an adapter for the Browser API (`window.glyphfield.studio`). ## Tools [#tools] | Group | Tool | ID | Purpose | | ----------- | ----------------------------------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------- | | Brand | [Brand identity](/docs/studio/brand-settings) | `identity` | Edit the shared identity, check its health, set it up with an agent and download the brand kit | | Brand | [Brand elements](/docs/studio/brand-elements) | `brand-elements` | Apply the identity to 89 templates for email, product UI, developer, social, editorial, event and physical use | | Brand | [Moodboard](/docs/studio/moodboards) | `design-board` | Compose editable tile boards in five compositions | | Brand | [Brand book](/docs/studio/brand-book) | `brand-book` | Read, edit and print a 54-page brand book | | Motion | [Animation](/docs/studio/animation) | `animation` | Sequence text, logo and image scenes with keyframes, transitions and audio | | Motion | [Lottie](/docs/studio/lottie) | `lottie` | Play, edit, recolor, trim and export Lottie files | | Foundations | [Design Lab](/docs/studio/design-lab) | `material` | Compose layers, shaders and effects on artboards | | Foundations | [Color tokens](/docs/studio/colors) | `colors` | Edit the palette, scales, semantic roles, contrast and token exports | | Foundations | [Typography](/docs/studio/typography) | `typography` | Edit type roles, the type scale, font files and type tokens | | Expressions | [OpenGraph](/docs/studio/opengraph) | `opengraph` | Make social preview images in seven formats | | Expressions | [Terminal card](/docs/studio/terminal-card) | `terminal` | Make syntax-highlighted code windows | | Expressions | [Partnership lockup](/docs/studio/partnership-lockup) | `partnership` | Lock up the brand with one or more partners | | Expressions | [Blog cover](/docs/studio/blog-cover) | `blog` | Make editorial covers | | Expressions | [Slide templates](/docs/studio/slide-templates) | `slides` | Build multi-slide decks from 14 layouts | | Components | [Component library](/docs/studio/components) | `buttons` | Preview 36 interface components and copy their React or HTML code | The five Expressions tools share one editor, described in [Expression tools](/docs/studio/templates). Design Lab, Animation, Lottie and the expression tools share one catalog of live shaders, the [Shader Library](/docs/studio/shader-library). ## Tool navigation [#tool-navigation] * Choose a tool in the left navigation. At laptop widths the navigation becomes a rail of icons with tooltips. * Press ⌘/Ctrl + K, or / when no text field has focus, to open **Search Studio tools**. Search matches the typed text against each tool's name, group, description and keywords. The arrow keys move through results, Enter opens the selected tool and Escape closes search. Each result shows a letter as a label. The Studio does not bind that letter to a key. * Open a URL of the form `/studio?tool=&project=&folder=`. The Studio updates these parameters as you navigate. The header also links to **Docs** and to **Quickstart**, which opens [Getting started](/docs/getting-started). ## Projects and tabs [#projects-and-tabs] Project tabs sit above the tool. Each tab is a view of a saved project. Closing a tab does not delete the project. | Control | Action | | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **+** (**Add brand project**) | Opens **New project**. Under **Start a brand**, **Set up with your agent** creates an empty brand and opens **Set up with agent**, **Blank brand** creates an empty brand to fill in by hand, and **Copy a reference brand** copies one of the nine built-in identities. Under **Start with a file**, **Blank design** and **Blank animation** open an empty Design Lab canvas or Animation timeline in a new project, and **Import project…** opens a `.glyphfield.json` file as a new project | | **Project** menu | **Duplicate active project**, **Close other project tabs** and, for your own projects, **Delete active project** | | **Projects** menu | The folders **All projects**, **Templates**, **My brands** and **Examples**, with counts. Reopens closed projects | | Tab menu (right-click, Shift + F10 or the ContextMenu key) | **Open project**, **Rename project** (F2), **Duplicate project**, **Move tab left** (Option/Alt + ←), **Move tab right** (Option/Alt + →), **Close tab** and **Close other tabs** | Drag a tab to reorder it. Neighboring tabs move aside to show where it will land. When tabs do not fit, they become compact, then show icons only, then scroll with scroll buttons. **Duplicate** copies the identity, the current work in every tool, assets and saved checkpoints. The copy includes edits that are still waiting to autosave. It opens in a new tab and does not share state with the original. If a canvas is still loading or an asset cannot be copied, an **Error** button explains why and no empty copy is created. **Copy a reference brand** creates ` copy 1` from a built-in identity and copies no tool work. **Delete active project** opens a confirmation that names the project. **Delete project** removes it from your projects in this browser. **Cancel**, Escape or a click outside the dialog keeps it. A deleted project cannot be restored. Built-in projects cannot be deleted. Renames and other edits to a built-in project are kept, and **Restore the shipped version** in Brand identity returns it to its shipped state. [Built-in identities](/docs/studio/brand-settings#built-in-identities) lists the nine identities that ship with Glyphfield. ## Control locations [#control-locations] | Place | Purpose | | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | | Project tabs, **Project**, **Projects** | Switch, create, duplicate and reopen projects | | Tool header | Save checkpoints, browse saved designs, open **File** and export | | **File** menu | Open and download portable project files where the tool supports them, and **Edit source code** under **Advanced** | | Canvas toolbar | Zoom, fit, reset, undo, redo and tool-specific view controls | | Left sidebar | Libraries, catalogs and sources | | Right inspector | Settings of the selected layer or of the tool | Inspector headings are disclosure buttons. A collapsed section keeps its controls and values. Color rows show a swatch and a HEX value. Opening a row shows the shared color picker with HEX, OKLCH, hue and opacity where the field supports it. Browsers with the EyeDropper API also show **Pick screen color**. ## Canvas navigation [#canvas-navigation] Most tools show their artifact in the shared canvas viewport. | Control | Action | | ------------------------------ | ------------------------------------------------------------------ | | **Zoom out**, **Zoom in** | Change zoom by 10% | | **Canvas zoom** slider | Sets zoom directly | | Percentage button | Resets zoom to 100% | | **Fit canvas** | Fits the artifact in the view | | **Reset view** | Returns to the starting view | | Scroll over the stage | Zooms | | Drag empty workspace | Pans | | ⌘/Ctrl + Z, Shift + ⌘/Ctrl + Z | Undo and redo while the canvas has focus or the pointer is over it | Zoom ranges from 40% to 200% in most tools and from 5% to 800% in Design Lab. The Studio saves zoom per project and tool. Zoom and pan do not change the artifact's geometry or export size. ## Visual settings [#visual-settings] **Visual customization** in the header opens **Visual settings**. These settings change the Studio interface only. They do not change brand colors in an artifact or its exports. | Setting | Values | | ------------- | --------------------------------------------------------------------------------------------------------------------------------------- | | Theme | Light, Dark or Auto. The landing page, the Studio and the docs share this setting | | Accent | Neutral, violet, teal, lime, or **Custom accent**, a color you choose in the shared color picker. The accent colors selection and focus | | Canvas | Dots, grid or a plain workspace background | | Corners | Rounded (default) or square controls and panels | | Studio font | Helvetica Neue (default), Be Vietnam Pro, Schibsted Grotesk or Rethink Sans | | Compact UI | Tighter navigation | | Reduce motion | Pauses decorative effects | | Tooltips | On by default. On shows the name of a control when the pointer rests on it or it receives focus. Off hides those names | Auto follows the operating system theme, including changes while the page is open. The Studio applies the theme before the first paint and respects the operating system's `prefers-reduced-motion` setting. With a custom accent, the Studio picks white or near-black text on accent-colored controls, whichever has more contrast. ## Switching and motion [#switching-and-motion] A sidebar item or project tab highlights as soon as you click it. The current tool stays on screen until the next one has loaded. The new tool then fades in over it in 160 ms. If loading takes longer than 180 ms, a thin progress line appears at the top of the workspace. The first time the Studio opens, a placeholder with the tool's layout (toolbar, side panel and canvas) shows until the tool is ready. Tools you have opened stay in memory with their renderers paused, so switching back does not reload them. After the first tool paints, the browser loads the code for the other tools in idle time. It skips this step when the browser has data saving turned on. Command search fades and lifts in. Menus, popovers and command search fade out over 120–140 ms when they close. The control itself closes at once, so focus, automation and tests see the closed state immediately. The source drawer slides in and loads its editor the first time it opens. Collapsing a sidebar changes its width in one step, and its content fades back in when it expands. Replacing a shader keeps the previous one on the canvas, paused, until the new one has painted its first frame. The previous shader then fades out over 160 ms. A Shader Library card starts loading its Shaders.com or ShaderGradient engine when the pointer rests on it or it receives focus. With **Reduce motion** on, or with `prefers-reduced-motion` set in the operating system, tool and project switches, menu and popover fades, and drawer slides happen in a single frame. The 160 ms fade after a shader replacement is instant only with the operating system setting. ## Persistence [#persistence] The browser's `localStorage` holds project identities, open tabs, the active tool and folder, visual settings and most tool drafts. IndexedDB holds Design Lab saved designs, autosaves, converted assets and captured shader frames, with a small recovery journal. The Studio uploads nothing to a server. Clearing site data removes local work. [Backup and restore](/docs/artifacts/backup-and-restore) explains how to keep copies. ## Agents in the Studio [#agents-in-the-studio] The active tool installs `window.glyphfield.studio`. An agent can list and operate the active tool's controls by accessible label, read and apply source, call tool actions and download the returned files. The project tabs and the **Project** and **Projects** menus sit outside the tool, so the Browser API does not reach them. See [Studio Browser API](/docs/reference/browser-api) and [Choose the right interface](/docs/agents/choose-interface). --- # Brand identity Edit the shared brand identity that every Studio tool reads, check its brand health score, set it up with a coding agent, and download a brand kit. Canonical page: https://www.glyphfield.com/docs/studio/brand-settings Markdown: https://www.glyphfield.com/docs/studio/brand-settings.md Brand identity (tool ID `identity`) is the Glyphfield Studio tool that edits the `BrandIdentity` of the active project. A `BrandIdentity` is the JSON record of one brand: its copy, logos, palette, fonts, graphic device, voice, strategy and image assets. The other Studio tools read it, including Brand elements, Moodboard, Brand book, Animation, Lottie, Design Lab, the expression tools, Color tokens, Typography and Component library. Brand identity also scores the identity, writes a setup prompt for a coding agent and exports a brand kit for code. ## Layout [#layout] | Region | Contents | | ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | | Tool header | The save status (**Changes pending** or **Saved locally**), **File** (**Advanced** → **Edit source code**) and **Identity JSON** | | Left sidebar, **Brand** group | **Overview**, **Set up with agent**, **Brand health** (with the score) and **Brand kit** | | Left sidebar, **Edit identity** group | **Voice & strategy**, **Logos & assets**, **Color system**, **Typography**, **System defaults** and **Direction & references** | | Main area | The selected section. Every section except **Overview** shows the brand mark and the section name at the top. | Edits stay pending until you save them. While the active project has pending edits, the Studio shows the notice **Save these brand changes?** with **Ignore** and **Save changes**. An agent saves with `identity.save`. **Identity JSON** opens the complete identity as `-brand-identity.json` in the export preview. ## Overview [#overview] | Panel | Contents | | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Brand cover | The brand name in the Display face, the tagline and the positioning on the dominant field. The cover uses the ink color when ink has a larger share of the palette than paper. For Starter and your own brands the picture is the graphic device drawn live from the palette, so palette and device changes show at once. For a reference brand it is the first match of an asset tagged `cover`, the asset with ID `identity-field`, any `background` or `texture` asset, or the palette drawn in proportion. A footnote reads "Your brand", "Starter template" or "Reference brand", followed by the website. | | **Starter kit** | Starter and your own brands only. **Directions** applies a whole direction; **Palette**, **Type**, **Device** and **Corners** change one part. See [Starter kit](#starter-kit). | | Quick actions | **Set up with your agent**, **Download brand kit** (the ZIP), **Edit source** and, for an edited built-in identity, **Restore the shipped version**. Restoring stages the shipped identity as a pending change. Save to keep it. | | Health summary | The score out of 100, the grade, the counts of errors, warnings and suggestions, and **Review findings** | | **What is defined** | Every audited section with a summary, a completeness meter and **Edit** | | System at a glance | The mark on light and dark, the palette in proportion, an "Aa" specimen in the Display face with the family names, and the graphic device drawn live with its name and first two rules | | **Identity essentials** | **Brand name**, **Short name** (up to 8 characters), **Website**, **Contact email**, **Social handle**, **Tagline**, **Positioning**, **Mission** and **Description** | | **Identity preview** | The identity applied to its own art-directed composition | ## Set up with your agent [#set-up-with-your-agent] **Set up with agent** writes a ready-to-run prompt for a coding agent such as Claude Code, Codex or Cursor. The agent operates the Studio through the Browser API (`window.glyphfield.studio`, the scripting interface that each Studio tool registers in the page). It researches the brand from its website, repository or design files, fills every section, adds logo and font files, runs the audit, saves the identity and exports the kit. * **Add brand project** → **Set up with your agent** opens a new, empty brand on this panel. The panel explains why a new brand starts with the agent: every tool reads the identity's logo files, colors, contrast pairs, font files, voice and strategy, and the agent copies them from the brand's own sources and notes each source. **Fill it in yourself** opens **Voice & strategy** instead. * **New brand** and **Improve this brand** switch the prompt. The Studio selects **New brand** for a project that is not built in when its tagline, positioning or palette still has the values a new project starts with. * **Copy prompt** copies the prompt. It has nine steps: research, brief, connect, validate, apply, files, audit, save and export, and report. * **Resources** lists four links, each with a copy button: this project's URL (`/studio?tool=identity&project=`), the workflow guide (`/docs/agents/brand-setup.md`), the identity schema (`/api/brand/validate`) and the agent skill (`skills/glyphfield-brand/SKILL.md`). * **What your agent can call** lists every `identity.*` action with its description. [Brand setup with an agent](/docs/agents/brand-setup) describes the full workflow. ## Brand health [#brand-health] Brand health scores the identity from 0 to 100 across eleven weighted sections: | Section | Weight | Checks | | ---------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Essentials | 10 | Name, tagline, positioning, mission, description and website | | Strategy | 12 | Challenge, central idea, promise, outcome, at least three pillars and at least three personality traits | | Voice | 10 | At least three principles and three examples, at least two approved phrases and two things to avoid, and a tagline, promise and phrases that do not repeat each other | | Logos | 14 | Each of the five logo slots, and each logo's surface | | Color | 14 | The `ink`, `paper` and `emphasis` colors, the contrast of every text pair, the palette proportions, and a palette that differs from the default | | Typography | 12 | A stored font file for each of the four roles, font licenses, a monospace Code face, unused fonts, the type scale and body line height | | Graphic device | 8 | The device, its rationale and at least three rules | | Imagery | 6 | Image direction, at least two non-logo images and alt text | | Products & proof | 6 | Products, one-line product summaries, audiences, proof, and customer names kept apart from proof | | Applications | 4 | At least three applications | | Naming & data | 4 | Distinct color names, the social handle format, the short name and the storage size | Each check is an error, a warning or a suggestion, worth 3, 2 and 1 points. A section's score is the points of its passing checks divided by the points of all its checks. The overall score is the weighted average of the section scores. The grade is Strong at 90 or more, Good at 75 or more, Needs work at 50 or more, and Incomplete below 50. An identity with any error is graded Needs work at best. The **Contrast pairs** panel measures every declared text pair against WCAG 2.2 AA: 4.5:1 for level `AA` and 3:1 for `AA-large`. Without declared pairs, the audit checks ink on paper, ink on muted, and ink or paper (whichever contrasts more) on the accent at `AA-large`. The semantic light and dark roles from [Color tokens](/docs/studio/colors) do not count toward the score. Findings are grouped under **Errors**, **Warnings** and **Suggestions**. Each finding shows the problem, its detail and its ID, an **Agent prompt** button that copies a self-contained instruction, and **Edit**. A finding with a deterministic fix also has a one-click fix button: | Fix ID | Change | | -------------------- | --------------------------------------------------------------------------------------------------------------------- | | `contrast::` | Moves the foreground color's OKLCH lightness until the pair reaches its required ratio. Chroma and hue stay the same. | | `proportions` | Sets paper to 60, ink to 30, emphasis to 10 and every other color to 0 | | `type-scale` | Sets a 16 px base and a 1.25 ratio | | `body-leading` | Sets the Body line height to 1.5 | | `alt-text` | Uses each asset's label as its missing alt text | | `social-handle` | Adds `@` to the start of the social handle | | `short-name` | Capitalizes the short name, or sets it in capitals when it has three characters or fewer | | `distinct-phrases` | Removes approved phrases that repeat the tagline or promise | | `prune-fonts` | Removes stored fonts that no role uses | | `separate-customers` | Moves customer names from proof to customers | | `logo-surfaces` | Sets each logo slot's surface to the surface the slot is for | | `font-bindings` | Binds each role to a stored font file of its family | **Copy prompt for all findings** copies one prompt for every error and warning. It leaves out suggestions. ## Brand kit [#brand-kit] **Brand kit** lists each file under **Files** with a **Download** button. **Preview** shows the text files under the tabs `brand.md`, `tokens/tokens.json`, `tokens/brand.css` and `tokens/tailwind.css`, with **Copy**. | File | Download name | Contents | | ------------------------ | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Brand kit (.zip)** | `-brand-kit.zip` | A `-brand-kit/` folder with `brand.md`, `tokens/tokens.json`, `tokens/brand.css`, `tokens/tailwind.css`, `identity.json`, `logos/.` for every logo asset, and `fonts/` for each font the kit may include | | **brand.md** | `brand.md` | Guidelines for coding agents: the health score, rules, voice, color with the semantic light and dark table, typography with tracking rules, logos, the graphic device, code usage, strategy, products, audiences and proof, applications, a pre-ship checklist and sources | | **Design tokens (JSON)** | `-tokens.json` | W3C Design Tokens (DTCG 2025.10): color, palette scales, semantic light and dark aliases, font, size, typography, radius and motion | | **CSS variables** | `-brand.css` | CSS custom properties: `--brand-color-*` and its scale steps, the semantic `--brand-` with dark values for `prefers-color-scheme`, `data-theme="dark"` and `.dark`, `--brand-font-*`, `--brand-text-*`, `--brand-radius`, `--brand-duration-*` and `--brand-ease-*` | | **Tailwind v4 theme** | `-tailwind.css` | A Tailwind CSS v4 `@theme` block plus `@theme inline` semantic roles, for classes such as `bg-paper`, `text-ink`, `font-display`, `bg-background` and `text-foreground` | | **Logo pack (.zip)** | `-logos.zip` | Every logo asset, named by asset ID | `` is the brand name in lowercase with hyphens. Both ZIP files are stored without compression. The kit includes a font file only when a type role uses it and the file was uploaded or its recorded license names OFL, Apache, MIT, CC0 or the Ubuntu Font License. Every other font that a role uses keeps its `@font-face` rule, preceded by a comment that asks you to add a licensed copy at the `fonts/` path. ## Editors [#editors] ### Voice & strategy [#voice--strategy] | Panel | Fields | | -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Strategy** | **Challenge**, **Central concept**, **Brand promise**, **Desired outcome**, strategic pillars and personality traits | | **Voice** | Voice principles, approved phrases, language to avoid and greetings | | **Voice examples** | For each example, the context, the line to write and the line to avoid. **Add example** adds one. | | **Audience, products and proof** | Audiences, brand values, products, product one-liners in the form `Name: what it does`, proof statements, and customers (up to 48, kept apart from proof). A one-liner without a colon is ignored. | | **Template samples** | **Sample person**, **Role**, **Event name**, **Event location**, **Event date**, **Event time**, **Install command**, **Code sample title**, **Code sample**, product actions, and a latest update (a title, then one change per line) | List fields take one entry per line. **Sources** below the panels records where the facts came from. Published plans (up to four) and a sample metric are edited in source. Brand elements, moodboards, the brand book and the expression tools print these fields as content. ### Logos & assets [#logos--assets] The **Logo family** panel has five slots. Upload or replace a file in each slot. Tools pick the variant that suits each surface and fall back to another mark when one is missing. | Slot ID | Use | Required | | ---------------- | --------------------------- | -------- | | `mark-dark` | Mark for light surfaces | Yes | | `mark-light` | Mark for dark surfaces | Yes | | `wordmark` | Wordmark for light surfaces | No | | `wordmark-light` | Wordmark for dark surfaces | No | | `mark-mono` | One-color mark | No | The **Asset library** stores images with a type (logo, background, texture, image, icon, product, proof, motion or reference), a label, usage, alt text, tags, the source owner, the source URL, a license and a redistribution status (**Bundled**, **Original**, **Research only** or **URL only**). Choose the type in **Asset type**, then select **Add asset**. An image can be PNG, JPG, GIF, WebP, BMP, AVIF or SVG up to 4 MB. Glyphfield reads the format from the file bytes. Assets of type proof are stored in `proofAssets`. The **Conversion library** sanitizes SVG files and converts PNG, JPG, WebP, GIF, AVIF and BMP files into transparent PNG working copies that Design Lab shaders can use. ### Color system [#color-system] Each palette color has a name, a usage, a HEX value and a share of the layout. Tools read the color IDs `ink` (text), `paper` (background), `muted` (quiet surface) and `emphasis` (accent). These four cannot be removed. The IDs `success`, `warning`, `progress` and `error` are optional. **Text pairs** declares the foreground and background pairs the brand uses for text, each at **AA text** or **AA large**, with the measured ratio and a pass or fail mark. **Palette presets** replaces the eight role colors with a [starter kit](#starter-kit) palette. Colors you added stay, and declared text pairs switch to the pairs the palette is tested for. Tint scales and the semantic light and dark roles are edited in [Color tokens](/docs/studio/colors). ### Typography [#typography] **Font files** stores TTF, OTF, WOFF or WOFF2 files with the identity. **Upload font file** accepts files up to 2.5 MB, and each stored file has a license field. **Add a bundled font** stores any font Glyphfield ships with the identity, including every Katagami member, its italic and the Katagami CJK companions. The last font file cannot be removed. **Typography roles** assigns a font to the **Display**, **Body**, **Accent** and **Code** roles, each with **Usage**, **Weight**, **Line height** (0.7–2) and **Tracking** (−8 to 12 px). **Weight** runs from the font's lowest weight to its highest, capped at 550, in steps of 50. **Type pairings** sets all four roles to a [starter kit](#starter-kit) pairing and stores its font files; usage notes and uploaded fonts stay. **Type scale** sets **Base size** (12–24 px) and **Scale ratio**, one of six ratios from 1.2 to 1.618. The scale step each role uses (`typeScale.roleSteps`) is set in [Typography](/docs/studio/typography). ### System defaults [#system-defaults] | Panel | Fields | | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Visual defaults** | **Interface density** (Compact, Comfortable, Spacious), **Image treatment** (Natural, Monochrome, Duotone), **Construction field** (None, Dots, Lines), **Corner radius** (0–32 px) and **Default logo scale** (40–160%) | | **Graphic system** | **Recognizable device**, **Device drawing** (a live thumbnail of each starter kit device in the brand's palette, plus a reference brand's own device while it is in use), **Device rationale**, **Composition behavior**, **Image direction** and system rules | ### Direction & references [#direction--references] The section opens with an editorial header of the tagline, the premise and the personality. **System diagram** draws how the brand turns inputs into outcomes. **Brand dossier** holds the art direction: **Brand premise**, **Personality**, **Logo system**, **Typography direction**, **Color direction**, **Image selection and treatment**, **Layout and composition**, **Graphic device**, **Motion principles**, **Provenance and licensing**, application recipes, a rendering recipe and do-not rules. **Applications** lists the places the identity must work, each with a name, category, format and intent. **Reference contact sheet** records each research reference with its source URL, owner and status (**Planned**, **Captured** or **Reviewed**). A reference stays research-only until its redistribution status permits bundling. ## Starter kit [#starter-kit] The starter kit holds tested parts that any brand can combine. Applying a part changes the visual system and keeps the brand's name and copy. Generated placeholder marks are redrawn in the new ink, paper and accent. | Part | Options | | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Palettes | Eight eight-role palettes. Light first: Signal (signal blue on white), Harbor (navy and coral), Ember (ember on cream), Clay (terracotta on sand) and Mono (black and white with one red). Dark first: Forest (deep forest and mint), Ultraviolet (ultraviolet and mint) and Citrus (ink and citrus). Each palette's text pairs pass WCAG AA, or AA large for labels on the accent. | | Type pairings | Swiss (Switzer, Instrument Serif accent, Geist Mono), Neutral (Inter and Geist Mono), Editorial (Instrument Serif display, Inter text), Technical (Geist Mono display, Inter text) and Katagami (Katagami Sans display, Katagami Text, Katagami Serif accent, Katagami Mono), all from bundled fonts | | Devices | Signal window, Construction grid, Orbit, Gradient band, Light beam, Current, Dither wall, Light arch and Network horizon. Each comes with its device copy and rules. | | Corners | Square (0 px), Soft (6 px), Round (12 px) and Pill (20 px) | | Directions | Signal, Harbor, Ember, Forest, Ultraviolet and Citrus, each a palette, a pairing, a device, corners and a density | Choosing a device replaces the device name, rationale, composition and rules only while they are still placeholder or starter kit copy; a brand's own device copy stays. A new brand starts from the Harbor direction with placeholder copy. Starter uses the Signal direction. ## Built-in identities [#built-in-identities] Glyphfield ships nine built-in identities. Starter (kind `template`) is the identity that `identity.project.create` copies when `from` is omitted. Its artwork and copy are original Glyphfield work under the MIT license, and its fonts keep their own licenses. The other eight (kind `example`) are reference studies of real brands. Their marks, media and webfonts remain their owners' property and are not covered by Glyphfield's MIT license. [Licensing](/docs/reference/licensing) lists the terms. | ID | Name | Kind | Graphic device | | ------------ | ------------------- | -------- | --------------------------- | | `starter` | Starter | template | Signal window | | `basement` | Basement | example | The engineered interruption | | `gt` | General Translation | example | The glyph globe | | `ramp` | Ramp | example | The savings ledger | | `mintlify` | Mintlify | example | The knowledge beam | | `tailwind` | Tailwind CSS | example | The utility wave | | `viteplus` | Vite+ | example | The convergence field | | `cloudflare` | Cloudflare | example | The network horizon | | `stripe` | Stripe | example | The programmable field | The General Translation (GT) identity is built from GT's brand canon. Its color direction names four absolute colors (ink `#070707`, raised ink `#101010`, titanium `#8A8F98` and paper `#FFFFFF`) and one accent. The accent is signal blue `#2F5CE0`, lifted to `#86A8FF` on ink and used on one element per composition. The stored palette holds Ink, Paper, Mist `#F4F4F4`, Signal blue and four neutral status colors (Cloud, Titanium, Graphite and Charcoal). The graphic device is the glyph globe: the earth drawn in characters from twenty writing systems. The cover asset is the glyph globe on ink. GT sets Display, Body and Accent in Rasmus Inter and Code in Geist Mono. Rasmus Inter is Rasmus Andersson's Inter Variable 4.1 (font version 4.001) with its optical-size and weight axes, bundled as `public/fonts/inter-variable.ttf`. Both faces are licensed under the SIL Open Font License 1.1. The picture library holds nine pieces of GT artwork (the glyph globes, the globe and mark, the glyph and horizon fields, the speed marks, the How GT works still and the signal gem smoke). It also holds ten artifact pictures, such as the Rosetta Stone and the Blue Marble, printed through an 8 × 8 Bayer dither. Each picture records its credit and license. GT's marks and artwork are © General Translation, Inc., included with permission for this identity only. Seven artifact pictures are public domain, and the Rosetta Stone, Devanagari manuscript and Louisbourg lighthouse screens are CC BY-SA 4.0 adaptations. `THIRD_PARTY_NOTICES.md` and `public/brands/ASSET-NOTICE.md` in the repository list every credit. Each built-in identity records a fingerprint of the version it shipped with (`presetFingerprint`). When a Glyphfield release ships a newer version, an untouched built-in identity is replaced by it. An edited built-in identity keeps every edit and gains the fields and assets it did not have. It also drops links to bundled files that a release removed. Files you uploaded stay. **Restore the shipped version** replaces the edits with the current shipped identity. ## Source format [#source-format] **File** → **Edit source code** shows the complete `BrandIdentity`. **Apply code** validates it against the BrandIdentity JSON Schema and replaces the identity. `GET /api/brand/validate` serves that schema. The fields `id`, `kind`, `revision`, `builtIn` and `presetFingerprint` keep their project values. Unknown fields are kept. An error names every invalid path, for example `colors[1].hex must be a six-digit HEX color such as "#1A2B3C"; received "#FFF".` The top-level fields are `applications`, `artDirection`, `assets`, `audiences`, `colorPairings`, `colorSystem`, `colors`, `contactEmail`, `customers`, `description`, `dossier`, `fonts`, `greetings`, `graphicSystem`, `mission`, `motion`, `name`, `positioning`, `productDetails`, `products`, `proof`, `proofAssets`, `references`, `samples`, `shortName`, `socialHandle`, `sourceNotes`, `strategy`, `style`, `tagline`, `typeScale`, `typography`, `values`, `voice` and `website`, plus the project fields above. Asset and font paths must be `data:` URLs or root-relative paths on the Glyphfield origin. [Identity fields](https://github.com/Kevin-Liu-01/Glyphfield/blob/main/skills/glyphfield-brand/references/identity-fields.md) describes each field. ## Browser API [#browser-api] An export artifact is an object with a non-empty `blob` and a `fileName`. `studio.download(artifact)` saves it. | Action | Input | Output | | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | | `identity.read` | None | A copy of the `BrandIdentity` object | | `identity.validate` | `{ identity, mode?: 'patch' \| 'full' }` (default `patch`) | `{ ok, issues: [{ code, message, path, severity }] }` | | `identity.apply` | `{ identity, mode?: 'merge' \| 'replace', replace?, remove?, save? }` | `{ identity, warnings, saved, health: { score, grade, counts } }`. Throws a `TypeError` that lists every issue. | | `identity.asset.add` | `{ file: File, slot?, id?, type?, label?, surface?, usage?, alt?, license?, sourceUrl?, sourceOwner?, redistribution?, tags?, save? }` | `{ asset }` | | `identity.font.add` | `{ file: File, roles?, family?, label?, weight?, weightMin?, weightMax?, style?, license?, sourceUrl?, id?, save? }` | `{ font }` | | `identity.audit` | None | The brand health report | | `identity.fix` | `{ fixId, save? }` | The report after the fix | | `identity.save` | None | `{ saved: true }` | | `identity.export.json` | None | An export artifact with the identity JSON | | `identity.export.kit` | `{ format?: 'zip' \| 'dtcg' \| 'css' \| 'tailwind' \| 'markdown' \| 'logos', download? }` | An export artifact | | `identity.setup.prompt` | `{ mode?: 'new' \| 'improve' }` | `{ mode, prompt }` | | `identity.project.create` | `{ from?: 'starter' \| 'scratch' \| , name? }` | `{ id, name, kind: 'custom', from, url }` | A logo `slot` replaces that slot in place. `identity.font.add` treats a file whose name contains "variable" or "\[wght" as a 100–900 weight range. After `identity.project.create` resolves, read `window.glyphfield.studio` again, because the new project owns the API. [Brand setup with an agent](/docs/agents/brand-setup#merge-rules) describes the merge rules, `replace` and `remove`. ## HTTP [#http] | Route | Use | | ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | | `GET /api/brand/validate` | The BrandIdentity JSON Schema, the merge-patch schema, the merge rules and the logo slots | | `POST /api/brand/validate` | `{ identity, mode?: 'full' \| 'patch' }` (default `full`). Returns `{ ok, issues, identity, health, schemaVersion }`. | | `GET /api/brand/kit`, `POST /api/brand/kit` | The kit contract. `{ identity, format: 'dtcg' \| 'css' \| 'tailwind' \| 'markdown' }` returns that file. | | `GET /api/identities` | The nine built-in identities | These routes store nothing. The ZIP files and font files come only from `identity.export.kit` in the browser. See [Endpoint reference](/docs/reference/endpoints#brand-identity). ## Limits [#limits] | Item | Limit | | ----------------- | --------------------------------------------------------------------- | | Image asset | 4 MB; PNG, JPG, GIF, WebP, BMP, AVIF or SVG | | Font file | 2,500,000 bytes; TTF, OTF, WOFF or WOFF2 | | Short name | 8 characters | | Customers | 48 | | Published plans | 4 | | Storage | The audit warns when the identity JSON exceeds 3.5 million characters | | HTTP request body | 5,250,000 bytes | | Font weight | Studio tools display weights up to 550. The schema accepts 100–900. | --- # Brand elements Apply the brand identity to 89 templates for email, product, developer, social, editorial, event and print use, and export PNG, HTML email or JSON. Canonical page: https://www.glyphfield.com/docs/studio/brand-elements Markdown: https://www.glyphfield.com/docs/studio/brand-elements.md Brand elements (tool ID `brand-elements`) is the Glyphfield Studio tool that applies the active brand identity to a catalog of 89 templates. Each element renders on an artboard at its own pixel size with the identity's fonts, colors, corner radius, logos and graphic device, then scales to fit the canvas. Select an element, edit its copy on the artboard or in the inspector, adjust the composition, and export a PNG, an HTML email or a JSON brief. Every template takes its content from the identity: products and their one-line summaries, proof, customers, published plans, the code sample and install command, and the sample person and event (see [Brand identity](/docs/studio/brand-settings#voice--strategy)). A template does not fall back to Glyphfield's own product copy. ## Layout [#layout] | Region | Contents | | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Tool header | **File** (**Export PNG at 2×**, **Export HTML email**, **Download element brief** and **Advanced** → **Edit source code**) and **Export PNG** | | Left sidebar | A search field that matches name, category, description, size, format and keywords, the **Brand element category** select (**All elements** or one of seven categories), and the catalog grouped by category | | Canvas | The element at its pixel size, the hint "Click any text on the artboard to edit it in place.", and chips with the catalog size and format. On narrow screens the **Active brand element** select replaces the sidebar. | | Right sidebar | The **Element editor** | ## Catalog [#catalog] `GET /api/elements` returns the catalog with each element's `id`, `name`, `category`, `dimensions`, `format`, `symbol`, `keywords` and `preview` family. The catalog size (`dimensions`) is the intended production size. When it is a pixel size with the same proportions as the artboard and larger than it, the PNG export renders at the catalog size. The 3000 × 3000 podcast cover is one example. Component sizes such as the 420 × 560 pricing card and print sizes in millimeters or inches describe the subject, so those elements export at their artboard size. The tables list the PNG size at 1×. ### Digital (35) [#digital-35] The 26 emails render 640 px wide at their content height and export as HTML. Their catalog size is "640 px / responsive". The three enterprise emails are plain-text emails. | Email | ID | | -------------------------- | --------------------------------------- | | Welcome email | `welcome-email` | | Start setup | `onboarding-day3-no-api-key-email` | | Translate | `onboarding-day3-api-key-email` | | Translation live | `onboarding-day3-live-email` | | Setup reminder | `onboarding-day5-no-api-key-email` | | First translation | `onboarding-day6-api-key-email` | | Activated guidance | `onboarding-day6-live-email` | | Payment confirmation | `onboarding-payment-confirmation-email` | | Magic link | `auth-magic-link-email` | | Organization invitation | `membership-invitation-email` | | Enterprise introduction | `enterprise-intro-email` | | Enterprise follow-up | `enterprise-day3-follow-up-email` | | Enterprise final follow-up | `enterprise-day7-follow-up-email` | | Credit balance warning | `balance-soft-limit-email` | | Credit balance depleted | `balance-hard-limit-email` | | Free credit warning | `free-credit-soft-limit-email` | | Free credits exhausted | `free-credit-hard-limit-email` | | Usage limit warning | `usage-soft-limit-email` | | Usage limit reached | `usage-hard-limit-email` | | Payment failed | `billing-payment-failed-email` | | Plan canceled | `billing-plan-canceled-email` | | Plan activated | `upgrade-confirmation-email` | | Locadex setup complete | `locadex-setup-complete-email` | | Locadex PR reminder | `locadex-pr-reminder-email` | | Newsletter | `newsletter-email` | | Event invitation | `event-invitation-email` | | Element | ID | Catalog size | PNG at 1× | | ------------------ | -------------------- | ---------------------------- | --------------------- | | Email system sheet | `email-system-sheet` | Multi-template contact sheet | 1440 × content height | | Email signature | `email-signature` | 480 × 160 | 640 × 220 | | Web card | `web-card` | 720 × 480 | 720 × 480 | | Logo on background | `logo-background` | 1600 × 1000 | 1600 × 1000 | | OpenGraph image | `opengraph` | 1200 × 630 | 1200 × 630 | | 404 page | `error-page` | Responsive | 1440 × 900 | | Favicon set | `favicon-set` | 16–512 px | 1200 × 720 | | App icon | `app-icon` | 1024 × 1024 | 1200 × 720 | | App store gallery | `app-store-gallery` | 1290 × 2796 | 1600 × 1400 | ### Product (20) [#product-20] | Element | ID | Catalog size | PNG at 1× | | --------------------- | ---------------------- | ------------------- | ---------- | | Navigation bar | `navigation-bar` | Responsive | 1440 × 520 | | Hero section | `hero-section` | 1440 × 760 | 1440 × 760 | | Feature grid | `feature-grid` | 3–6 cards | 1440 × 800 | | Pricing card | `pricing-card` | 420 × 560 | 1200 × 760 | | Testimonial card | `testimonial-card` | 640 × 400 | 1100 × 720 | | Form controls | `form-controls` | Responsive | 1280 × 800 | | Command menu | `command-menu` | 640 × 480 | 1100 × 720 | | Modal dialog | `modal-dialog` | 560 × 360 | 1280 × 800 | | Toast notification | `toast-notification` | 420 × auto | 1000 × 600 | | Data table | `data-table` | Responsive | 1280 × 800 | | Dashboard widget | `dashboard-widget` | 480 × 320 | 1000 × 720 | | Empty state | `empty-state` | Responsive | 1280 × 800 | | Checkout card | `checkout-card` | 480 × 600 | 1000 × 800 | | Settings panel | `settings-panel` | Responsive | 1280 × 800 | | Authentication screen | `auth-screen` | Responsive | 1280 × 800 | | Sidebar navigation | `sidebar-navigation` | 240 px / responsive | 1280 × 800 | | Search surface | `search-surface` | 720 × 560 | 1280 × 800 | | Onboarding checklist | `onboarding-checklist` | 640 × 560 | 1280 × 800 | | File uploader | `file-uploader` | 640 × 360 | 1280 × 800 | | Status page | `status-page` | Responsive | 1280 × 800 | ### Developer (9) [#developer-9] | Element | ID | Catalog size | PNG at 1× | | -------------------- | -------------------- | -------------- | ---------- | | CLI brand | `cli-banner` | 80 columns | 960 × 620 | | ASCII mark | `ascii-mark` | Monospace grid | 1280 × 640 | | Terminal theme | `terminal-theme` | Responsive | 1280 × 640 | | GitHub README hero | `github-readme` | 1280 × 640 | 1280 × 640 | | Documentation header | `docs-header` | 1440 × 480 | 1440 × 480 | | Package card | `package-card` | 512 × 320 | 512 × 320 | | API reference hero | `api-reference-hero` | 1440 × 720 | 1440 × 720 | | Code playground | `code-playground` | 960 × 640 | 960 × 640 | | Release notes | `release-notes` | 1200 × 630 | 1200 × 630 | ### Social (8) [#social-8] | Element | ID | Catalog size | PNG at 1× | | ------------------- | ----------------- | ------------ | ----------- | | X / Twitter post | `x-post` | 1600 × 900 | 1600 × 900 | | LinkedIn post | `linkedin-post` | 1200 × 1200 | 1200 × 1200 | | Community card | `community-card` | 1200 × 675 | 1200 × 675 | | Social avatar | `social-avatar` | 400 × 400 | 1200 × 720 | | Product launch card | `launch-card` | 1600 × 900 | 1600 × 900 | | Video thumbnail | `video-thumbnail` | 1280 × 720 | 1280 × 720 | | Podcast cover | `podcast-cover` | 3000 × 3000 | 3000 × 3000 | | Social carousel | `social-carousel` | 1080 × 1350 | 1080 × 1350 | ### Editorial (7) [#editorial-7] | Element | ID | Catalog size | PNG at 1× | | ---------------- | ------------------ | -------------- | ----------- | | Slide deck title | `slide-title` | 16:9 | 1600 × 900 | | Slide section | `slide-section` | 16:9 | 1600 × 900 | | Blog cover | `blog-cover` | 1200 × 630 | 1200 × 630 | | Report cover | `report-cover` | A4 / US Letter | 1000 × 1414 | | Press kit | `press-kit` | Multi-format | 1600 × 900 | | Case study cover | `case-study-cover` | 1200 × 630 | 1200 × 630 | | Whitepaper cover | `whitepaper-cover` | A4 / US Letter | 1000 × 1414 | ### Event (5) [#event-5] | Element | ID | Catalog size | PNG at 1× | | ------------------ | -------------------- | ------------------- | ----------- | | Lanyard pass | `lanyard` | 90 × 140 mm | 1000 × 1400 | | Event badge | `event-badge` | 105 × 148 mm | 1000 × 1400 | | Event backdrop | `event-backdrop` | 16:9 / large format | 1600 × 900 | | Partnership lockup | `partnership-lockup` | Flexible lockup | 1600 × 900 | | Booth wall | `booth-wall` | 10 × 8 ft | 1500 × 1000 | ### Physical (5) [#physical-5] | Element | ID | Catalog size | PNG at 1× | | --------------- | ----------------- | -------------- | ----------- | | Business card | `business-card` | 3.5 × 2 in | 1400 × 900 | | Sticker sheet | `sticker-sheet` | A5 sheet | 1500 × 1060 | | Packaging label | `packaging-label` | 4 × 6 in | 1000 × 1500 | | Letterhead | `letterhead` | A4 / US Letter | 1000 × 1414 | | Notebook cover | `notebook-cover` | A5 | 1000 × 1414 | ## Controls [#controls] Click a headline, supporting copy, action, name, role or partner name on the artboard to edit it in place. The accessible labels are **Edit headline in place**, **Edit supporting copy in place** and so on. In-place edits stay in sync with the inspector, the source and the brief. The **Element editor** shows only the controls an element supports: | Section | Controls | | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Content** | **Reset element**, **Headline**, **Supporting copy** and **Action**. Person elements have **Name** and **Role**. The partnership lockup has **Partner name**. | | **Composition** | **Layout** (Split, Stacked, Centered), **Type scale** (Compact, Balanced, Bold), **Pattern** (None, Dots, Grid, Dither) and **Pattern opacity** (0–100%) | | **Typography** | **Font role** (any identity role) and **Weight** (100–550) for the display type | | **Shared asset** | **Library asset** (an identity or proof asset, or **No shared asset**), **Placement** (Background, Header, Banner, Card) and **Asset opacity** (0–100%) | | **Artwork** | **Horizontal** and **Vertical** offset (−120 to 120 px) and **Scale** (40–200%) | | **Color** | **Background**, **Text** and **Accent** | | **Brand details** | **Show logo** with the logo appearance controls (invert, dither, outline and shadow), and **Show website** | Settings are stored per project and per element. **Reset element** removes the element's settings and returns it to the identity defaults. ## Export [#export] The export preview is the dialog that shows an export with its file name and a download button. | Action | Result | | ------------------------------------- | -------------------------------------------------------------------------------------- | | **Export PNG** | Renders the element with every edit at its PNG size and opens it in the export preview | | **File** → **Export PNG at 2×** | Renders at twice the PNG size and downloads it | | **File** → **Export HTML email** | Downloads a send-ready HTML email. Enabled for email elements only. | | **File** → **Download element brief** | Opens the JSON brief in the export preview | PNG files embed the brand fonts and are named `-.png` or `-@2x.png`. HTML files are named `-.html`. The HTML email is a 600 px table layout with inlined styles, an Outlook (MSO) wrapper, a hidden preheader of up to 140 characters, a table-based button that renders in Outlook, and absolute image URLs. Its footer links to **Unsubscribe** at `/account` on the identity's website. The content differs by element: | Email | Content | | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Lifecycle emails | A wordmark header, header art, a greeting with the sample person's first name, the body, an action button and the template's supporting cards. The Welcome email lists up to three products when its template has no cards. | | Enterprise emails | Plain text with a greeting and a signature from the sample person. No header or art. | | Newsletter | Up to three items from the identity's latest update and up to three products | | Event invitation | The date, time and place of the sample event above the headline | | Email signature | A standalone signature block instead of the 600 px layout | | Email system sheet | No HTML export | The wordmark header and header art appear while **Show logo** is on. General Translation's lifecycle emails use GT's animated GIF header art, linked by absolute URL. Every other email uses a 1200 × 380 PNG of the brand's graphic device, embedded as a data URL. Host that PNG and replace its `src` before you send through a client that blocks data URLs, such as Gmail. ## Source format [#source-format] **File** → **Edit source code** shows the selected element as `glyphfield.brand-element` version 2: ```json { "schema": "glyphfield.brand-element", "version": 2, "elementId": "welcome-email", "headline": "Welcome to Stripe", "body": "…", "cta": "Open workspace", "layout": "stacked", "accentColor": "#533AFD" } ``` Applying source selects `elementId` when it is present. It stores only the values that differ from the identity defaults, so untouched copy keeps following identity edits. Omitted settings keep their current values, so `{ "elementId": "x-post" }` only selects an element. Colors are six-digit HEX, and enum values must match the editor options. Numbers are clamped: artwork offsets to ±120, artwork scale to 40–200, opacities to 0–100 and font weight to 100–900 (displayed at most 550). Text is limited to 400 characters for the headline, 2000 for the body, 200 for the action and the role, and 120 for the name and the partner name. Unknown keys are ignored. A version 1 document has no `elementId` and applies to the selected element. ## Browser API [#browser-api] The Browser API (`window.glyphfield.studio`) exposes these actions while Brand elements is the active tool. An export artifact is an object with a non-empty `blob` and a `fileName`. | Action | Input | Output | | ---------------------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `brand-element.export.png` | `{ elementId?, scale?: 1 \| 2, download? }` | An export artifact. `width` and `height` are the PNG size. Selects `elementId` first. | | `brand-element.export.html` | `{ elementId?, assetOrigin?, download? }` | An export artifact. `previewText` holds the HTML. `assetOrigin` sets the origin of image URLs (default: the Studio origin). It renders `elementId` without selecting it. | | `brand-element.export.brief` | None | An export artifact with the brief JSON | The browser brief is `{ element, settings, identity: { colors, id, name, shortName, tagline, typography, voice, website }, schemaVersion: 2 }`. ## HTTP [#http] `GET /api/elements` returns `{ categories, count, elements, generation, schemaVersion: 1 }`. `POST /api/generate` with `kind: "element-brief"` and an `elementId` returns `{ element, generation: { previewFamily, source }, identity, schemaVersion: 1 }`. The HTTP brief resolves the element against an identity but has no editor settings. See [Generation API](/docs/agents/generate#element-brief). A document from the source drawer is not an HTTP request body. ## Limits [#limits] * PNG export at 1× or 2× of the PNG size, which is the catalog pixel size when it matches the artboard's proportions and the artboard size otherwise. * HTML export for email elements only. * Font weights display up to 550. --- # Moodboard Compose the brand identity as an editable board of tiles in five compositions, edit each tile's layout and copy, and export it as PNG, SVG or JSON. Canonical page: https://www.glyphfield.com/docs/studio/moodboards Markdown: https://www.glyphfield.com/docs/studio/moodboards.md Moodboard (tool ID `design-board`) is the Glyphfield Studio tool that composes the active brand identity as a presentation board of tiles on a 12-column grid. Every tile is built from the identity: its graphic device, logos, type, palette, voice, products, proof and library images. You can reorder, hide, resize, recolor and rewrite tiles. ## Compositions [#compositions] **Board style** selects one of five boards. Each board keeps its own tile edits. | Board | ID | Ratio | Layout size | Default tiles | | -------- | ---------- | ----- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Showcase | `showcase` | 16:9 | 1600 × 900 | Key visual, poster, type, color, imagery, social post, voice and business card | | Campaign | `campaign` | 16:9 | 1600 × 900 | Key visual, billboard, poster, social post, email, event badge, website and proof | | System | `system` | 4:5 | 1600 × 2000 | Logo, statement, type scale, color proportion, device construction, imagery, voice, motion, proof, business card and website | | Specimen | `specimen` | 4:5 | 1600 × 2000 | Display face, type pairing, type scale, character set, phrases, color proportion, contrast pairs and tints | | Catalog | `catalog` | 2:3 | 1600 × 2400 | Twelve tiles (key visual, logo, type, color, device, imagery, voice, proof, poster, social post, business card and motion), then every eligible source image in 6 columns and every identity application in 3 columns | Showcase and Campaign follow the identity's art direction (`artDirection.moodboard`), so their tile mix and proportions differ between identities. ## Layout [#layout] | Region | Contents | | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Tool header | **File** (**Export SVG**, **Download identity JSON** and **Advanced** → **Edit source code**) and **Export PNG** | | Left sidebar | The identity name and mark, **Board** (**Reset board**, **Board style**, **Board title** and **Board surface**), **Tiles**, the selected tile's settings, **Export**, **Generated applications**, and **Central idea and sources** | | Canvas | The board in the shared canvas viewport. Each tile is a button labeled `Select tile`. | **Board surface** is Light or Dark. **Generated applications** lists the identity's applications, and **Central idea and sources** shows the central concept, the graphic device and the source notes. ## Tiles [#tiles] Select a tile on the board or in the **Tiles** list. Drag a tile onto another tile on the board to reorder. Escape clears the selection. The list shows each tile's name, layout and width, with these accessible controls: * `Hide tile ` or `Show tile ` toggles the tile. The remaining tiles reflow. * `Select tile in list` selects it. * `Move tile earlier` and `Move tile later` reorder it. The selected tile's settings have **Reset tile** and these fields: | Field | Values | | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | | **Layout** | The tile kind's layouts (see the table below) | | **Size** | Quarter (3 columns), Third (4), Half (6), Two thirds (8) or Full width (12). Rows are justified to the full width. | | **Surface** | Paper, Muted, Ink, Deep or Accent. The text color follows for contrast. | | **Image** | **Graphic device** or a library image. Shown for image tiles only. | | **Headline**, **Body** and **Caption** | Up to 600 characters each | With a tile selected, click its text on the board to edit it in place. The accessible labels are `Edit headline`, `Edit body` and `Edit caption`. | Tile | Kind ID | Layouts (source IDs) | | -------------- | ----------- | ------------------------------------------------- | | Key visual | `cover` | `device`, `image`, `type` | | Poster | `poster` | `device`, `image`, `type` | | Billboard | `billboard` | `device`, `image` | | Graphic device | `device` | `field`, `construction`, `crops` | | Logo | `logo` | `pair`, `single`, `clearspace` | | Typography | `type` | `glyph`, `scale`, `phrases`, `pairing`, `charset` | | Colour | `palette` | `proportion`, `swatches`, `pairs`, `tints` | | Imagery | `imagery` | `single`, `pair`, `triptych` | | Statement | `statement` | `concept`, `promise` | | Voice | `voice` | `quote`, `dodont` | | Proof | `proof` | `figures`, `list` | | Motion | `motion` | `curve`, `frames` | | Social post | `social` | `post`, `story` | | Email | `email` | `message`, `inbox` | | Website | `web` | `hero`, `product` | | Event badge | `badge` | `lanyard`, `card` | | Business card | `card` | `pair`, `front` | The image tiles are Key visual, Poster, Billboard, Imagery, Social post and Website. Their images come from the identity's curated library images. An identity without curated images uses any of its non-logo images. ## Export [#export] | Action | Result | | ------------------------------------- | -------------------------------------------------------------------------------------------------------------- | | **Export PNG** | Renders the board as PNG at the size chosen in **Export** and opens it in the export preview | | **File** → **Export SVG** | Opens a standalone SVG of the 1600 px wide layout, with brand fonts and images embedded, in the export preview | | **File** → **Download identity JSON** | Opens the complete active `BrandIdentity` in the export preview | **Output size** offers Standard, Retina (the default), High resolution, Ultra and Custom. A preset sets the PNG width, and the height follows the board ratio. Custom takes **Custom width** from 800 to 4800 px. The board is vector artwork, so it renders at the chosen size directly. | Preset | 16:9 boards | 4:5 boards | Catalog | | --------------- | ----------- | ----------- | ----------- | | Standard | 1600 × 900 | 1600 × 2000 | 1600 × 2400 | | Retina | 2400 × 1350 | 2400 × 3000 | 2400 × 3600 | | High resolution | 3200 × 1800 | 3200 × 4000 | 3200 × 4800 | | Ultra | 4800 × 2700 | 4800 × 6000 | 4800 × 7200 | The **Export** section shows the exact pixel size before export. PNG and SVG both embed every brand font and library image, so the output matches the preview. PNG files are named `-moodboard-x.png`. ## Source format [#source-format] **File** → **Edit source code** shows `glyphfield.moodboard` version 2: ```json { "schema": "glyphfield.moodboard", "version": 2, "composition": "showcase", "exportPresetId": "retina", "customWidth": 2400, "boards": { "showcase": { "title": "Brand showcase", "surface": "light", "tiles": [ { "id": "cover", "kind": "cover", "label": "Key visual", "variants": ["device", "image", "type"], "hidden": false, "variant": "device", "span": 8, "tone": "deep", "assetId": "", "copy": { "headline": "Financial infrastructure for the internet.", "body": "…", "caption": "stripe.com" } } ] } } } ``` * `composition` is `showcase`, `campaign`, `system`, `specimen` or `catalog`. Every key in `boards` must be one of these. * `exportPresetId` is `standard`, `retina`, `high`, `ultra` or `custom`. `customWidth` is clamped to 800–4800. * Tile order follows `tiles`. A partial list moves the listed tiles first, and omitted tiles keep their settings. Tile IDs must be unique. * `variant` must be one of the tile's `variants`. `span` is 3, 4, 6, 8 or 12. `tone` is `paper`, `muted`, `ink`, `deep` or `accent`. `assetId` is an eligible library image, or empty for the graphic device. * `title` holds up to 120 characters and each copy field up to 600. Values equal to the identity defaults are not stored, so untouched copy keeps following later identity edits. * A version 1 document (`composition`, `exportPresetId` and `customWidth` only) still applies and keeps the current tile edits. Board source configures presentation only. Content, assets, fonts and art direction come from [Brand identity](/docs/studio/brand-settings). ## Browser API [#browser-api] The Browser API (`window.glyphfield.studio`) exposes these actions while Moodboard is the active tool. Each returns an export artifact, an object with a non-empty `blob` and a `fileName`. | Action | Input | Output | | --------------------------- | ----- | ----------------------------------------- | | `moodboard.export.png` | None | An export artifact with the PNG | | `moodboard.export.svg` | None | An export artifact with the SVG | | `moodboard.export.identity` | None | An export artifact with the identity JSON | Tile controls use the accessible labels above. The Specimen board has several Typography tiles and several Colour tiles, so `Select Typography tile` matches more than one tile. Use the list labels, which include the tile ID. ## Limits [#limits] * PNG width up to 4800 px. The long edge reaches 6000 px on 4:5 boards and 7200 px on the Catalog board at Ultra. * SVG export always uses the 1600 px wide layout. * Board title 120 characters. Tile copy 600 characters per field. --- # Brand book Turn the brand identity into a 54-page standards book, reorder and hide its sections, edit each page's layout and copy, and print it to PDF. Canonical page: https://www.glyphfield.com/docs/studio/brand-book Markdown: https://www.glyphfield.com/docs/studio/brand-book.md Brand book (tool ID `brand-book`) is the Glyphfield Studio tool that turns the active brand identity into a 54-page editorial standards document. Every page is built from the same strategy, logo files, typography, colors, graphic device, image library, voice, applications and motion that the other Studio tools use. ## Book structure [#book-structure] Pages are 16:10 on a 12-column grid. A footer on each page shows the identity name, the section number and name, the page title and the folio (the page number). The cover, the section openers, the device hero page and the closing page have no footer. Each of the nine middle sections starts with a full-bleed opener page. | Section | Pages | Content | | -------------- | ----- | ------------------------------------------------------------------------------------------------------------------- | | Introduction | 3 | Cover, contents, and how to use the book | | Strategy | 1 + 5 | Brand idea; challenge, promise and outcome; mission and position; audience and personality; pillars and values | | Logo | 1 + 6 | Primary mark, logo family, clear space, minimum size, colorways and misuse | | Colour | 1 + 4 | The palette with HEX, RGB and OKLCH values, proportion, every text pairing with its WCAG contrast, and tonal ranges | | Typography | 1 + 5 | Display typeface, text typeface, pairing, type scale and the role of each face | | Graphic device | 1 + 5 | The device, its construction, variations, the icon system and device rules | | Imagery | 1 + 3 | Image direction, the approved library and image treatment | | Voice | 1 + 4 | Voice principles, do and don't with real lines, the messaging hierarchy and a sample email | | Applications | 1 + 6 | Layout grid, stationery, digital, social, events and a contact sheet of the applications | | Motion | 1 + 3 | Motion principles with easing curves, motion tokens and the device in motion | | Closing | 1 | The tagline | "1 +" counts the section opener. You can reorder and hide the nine middle sections. The introduction and the closing page stay in place. ## Overview and reading modes [#overview-and-reading-modes] **Overview** shows every page as a contact sheet. Click a thumbnail to open that page in **Read**, which shows one page at a time with a page counter and the page inspector. In Read, the Left and Right arrow keys turn pages, and Escape returns to Overview. Read includes hidden pages. The section index on the left works in both views. **Page thumbnail size** (200–420 px, default 272) changes the contact sheet only. It does not change the page dimensions, the typography or the PDF. ## Edit the book [#edit-the-book] | Scope | Controls | | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Text | In Read, click any text on the page to edit it in place. The **Copy** section of the inspector lists the same fields as `Page copy` text areas of up to 1200 characters each. | | Page | **Show page**, **Layout** (the page's layouts), **Surface** (Paper, Muted, Ink, Deep or Accent) and, on pages that show an image, **Image**. **Reset page** returns the page to the identity defaults. | | Section | The left index has `Hide
section` (or `Show
section`), `Move
section earlier` and `Move
section later`. The inspector has **Show section**, **Earlier** and **Later** for the current section. | Hidden pages and sections stay visible but dimmed in Overview, so you can restore them. They are left out of the folios, the contents page and the PDF. Edits are saved per project. Keep foundational changes in [Brand identity](/docs/studio/brand-settings). Use book edits for presentation and wording that belong to this document only. ## Source format [#source-format] **File** → **Edit source code** reads and applies the book as JSON: ```json { "schema": "glyphfield.brand-book", "version": 1, "sections": [ { "id": "strategy", "name": "Strategy", "hidden": false, "pages": [ { "id": "strategy-premise", "title": "Brand idea", "hidden": false, "variant": "statement", "variants": ["statement", "centered"], "tone": "paper", "assetId": "", "imageSlot": false, "copy": { "statement": "…", "aside": "…" } } ] } ] } ``` * When present, `schema` must be `glyphfield.brand-book` and `version` must be 1. * Section IDs are `intro`, `strategy`, `logo`, `colour`, `typography`, `device`, `imagery`, `voice`, `applications`, `motion` and `closing`. The order of the nine middle sections follows `sections`. `intro` and `closing` may be listed but do not move. * A page may appear only under its own section. `variant` must be one of the page's `variants`, and `tone` one of the five surfaces. `assetId` is an identity image ID, or empty for the graphic device, and applies only to pages with `imageSlot: true`. * `copy` keys must be the page's editable slots, and each value holds up to 1200 characters. Values equal to the identity defaults are not stored. * Sections and pages that a document omits keep their current settings. ## Browser API [#browser-api] The Browser API (`window.glyphfield.studio`) exposes one action while Brand book is the active tool: | Action | Input | Output | | ------------------ | ----- | ------------------------------------------------------------- | | `brand-book.print` | None | `null`. Opens the browser print dialog for the visible pages. | `readSource()` and `applySource()` read and apply the book document above. ## Export PDF [#export-pdf] **Export PDF** (`brand-book.print`) opens the browser print dialog with one page per sheet at 16 × 10 in and no margins. In the dialog, choose the "Save as PDF" destination to get a PDF file. Only visible pages print, in the edited order. The browser's own print command prints the same pages. Before exporting: * Resolve missing logo or font assets. * Check the use of the light and dark marks. * Review long strategy text for overflow. * Confirm that reference assets are redistributable when they appear in the output. The PDF is a snapshot. Export again after you edit the identity or the book. --- # Motion overview Choose between Animation, Lottie, and Design Lab for motion work by comparing their inputs, timing models, frame rates, and export formats. Canonical page: https://www.glyphfield.com/docs/studio/motion Markdown: https://www.glyphfield.com/docs/studio/motion.md Glyphfield Studio has three tools that produce motion: Animation, Lottie, and Design Lab (the layered composition tool). All three take live materials from the [Shader Library](/docs/studio/shader-library) with its palettes and material time model. All three encode GIF with the same library and encode MP4 in the browser with the same encoder. | Need | Tool | | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------- | | A sequence of text, logo, and image scenes with transitions, keyframes, text entrances, captions, and audio | [Animation](/docs/studio/animation) | | Playback, editing, recoloring, and trimming of a Lottie JSON or `.lottie` file | [Lottie](/docs/studio/lottie) | | A layered poster whose shaders move, or a clip that cuts through several shaders | [Design Lab](/docs/studio/design-lab) | | Choosing and tuning a live material | [Shader Library](/docs/studio/shader-library) | ## Tool comparison [#tool-comparison] | | Animation | Lottie | Design Lab | | ----------- | ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- | -------------------------------------------------------------- | | Input | Text frames, the brand mark, local images, audio files | Built-in studies, local `.lottie` or JSON files | Layers on artboards | | Timing | A hold and an outgoing transition per scene on a storyboard, and layer keyframes | The Lottie file's frames, in and out points, markers, speed, and direction | Shader time, and an optional shader sequence of 8–12 materials | | Background | Solid, gradient, or a Shader Library material behind every scene, with per-scene overrides | Transparent, a solid color, or a live material | Any number of shader layers | | Exports | GIF, MP4 with audio, PNG poster frame, project file | PNG frame, GIF, MP4, edited JSON or the original `.lottie` | PNG, JPG, GIF, MP4, shader-sequence GIF and MP4, project file | | Frame rates | 10, 15, 20, 24, 30 FPS | GIF 25 FPS, MP4 30 FPS | 12, 15, 24, 30, 60 FPS | | Audio | Yes, in MP4 only | No | No | | Browser API | `animation.*` | `lottie.*` | `design.*` | ## Shared rules [#shared-rules] * Each tool runs one export at a time. * GIF has no audio channel. * MP4 needs a browser video encoder. Glyphfield tries H.264 first and reports a missing encoder as an error. It does not produce a GIF in place of the MP4. * Stateful materials, such as Fluid Energy and the interactive Shaders.com materials, cannot be reproduced from a time value. Animation and Lottie refuse to export motion over a stateful background. Design Lab exports exact stills of them and refuses motion that samples them by timestamp. * A continuous animation clock does not make a seamless loop. Inspect several frames and the seam of every looping file. * Studio follows the `prefers-reduced-motion` setting, and **Reduce motion** in Visual settings pauses decorative effects. Exports still contain the full requested motion. --- # Animation Sequence text, logo, and image scenes with keyframes, text entrances, and transitions, add audio, and export GIF, MP4, a PNG poster, or a project file. Canonical page: https://www.glyphfield.com/docs/studio/animation Markdown: https://www.glyphfield.com/docs/studio/animation.md Animation (tool ID `animation`) is a sequence editor for brand motion. Each scene holds one layer (text, the brand mark, or an image) over a background. Each scene has its own hold duration, outgoing transition, pose and keyframes, and an optional text entrance and caption. Scenes share the base background unless a scene has its own. ## Layout [#layout] | Region | Contents | | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Tool header | **Save checkpoint**, **Saved animations**, the save status, **File** (**Edit source code**, **Open project file**, **Download project file**, **Export poster frame**), **GIF**, and **Export MP4** | | Left sidebar | 01 **Scenes and layers**, 02 **Sequence defaults**, 03 **Output**, 04 **Brand starters** | | Center | The artboard bar, the canvas with size handles, the transport and storyboard, and the audio track | | Right inspector | The selected scene, transition, or background, or "Nothing selected" | ## Brand starters [#brand-starters] A first visit opens on the identity's **Brand intro**. **Brand starters** offers three sequences for every identity. Each is composed in that identity's art direction on a 1280 × 720 artboard: | Starter | ID | Scenes | | ------------ | -------------- | --------------------------------------- | | Brand intro | `brand-intro` | The mark, then up to six greetings | | Product reel | `product-reel` | Up to four products, then the mark | | Proof points | `proof-points` | Up to three proof points, then the mark | Each identity keeps its own field, type, accent, cadence, and captions. The General Translation intro holds each scene for 1.25 seconds, morphs between centered words on black, and names each language in the corner. Display weight and tracking come from the identity's Display role, and captions use its Code face. Applying a starter replaces the active artboard, clears imported images, and resizes the artboard to 1280 × 720. **Undo** restores the previous sequence. Loading a starter does not replace saved drafts. ## Scenes and layers [#scenes-and-layers] **Add animation layer** has **Text**, **Image** (one or more local image files), **Base** (the base background), and **Transition**. The **Brand mark** checkbox includes or removes the mark scene. Each scene row has `Move up`, `Move down`, and `Remove `. Rows labelled `Transition NN · ` sit between scenes. Source order, timeline order, preview, and export stay in sync. New text scenes start black in light mode and white in dark mode, including scenes added through the Browser API. The color is saved on the scene, so changing the Studio theme does not recolor existing scenes, images, or backgrounds. ## Sequence defaults and output [#sequence-defaults-and-output] | Control | Range or values | | ------------------------------------------ | ------------------------------------------------------------------------------------------------ | | **Frame duration** | 100–3000 ms, with buttons for 0.75, 1.0, 1.25, 1.5, and 1.75 s | | **Default transition** | One of the 12 transition packages. Type / delete is hidden while the sequence has an image scene | | **Default background blend** | Crossfade, Directional wipe, Radial reveal | | **Transition duration** | 40–1200 ms | | **Horizontal anchor**, **Vertical anchor** | −1 to 1 | | **Scale** | 0.2–1.5 | | **Morph blur** | 0–32 px | | **Text size** | 16–240 px | | **Default foreground** | Color | | **Frame rate** (Output) | 10, 15, 20, 24, or 30 FPS | | **Palette** (Output) | 32, 64, 128, or 256 GIF colors | | **Loop forever** (Output) | The GIF loop flag | Scenes without their own values follow these defaults. ## Edit a scene [#edit-a-scene] Select a scene on the storyboard or in the scene list. Selecting a scene pauses playback and moves the playhead to the point where the scene looks finished, after its entrance and last keyframe. The inspector shows: | Section | Controls | | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Content | Text, or **Image fit** (Contain or Cover) for images. **Reset selected frame** and **Remove selected layer** | | Pose | **Horizontal** and **Vertical** −1 to 1, **Scale** 0.1–2.5, **Rotation** −180° to 180°, **Opacity** 0–100% | | Align | **Align layer left**, **Align layer to horizontal center**, **Align layer right**, **Align layer top**, **Align layer to vertical middle**, **Align layer bottom** (to the safe area, 8% of the shorter side), and **Show layout guides** | | Type | **Anchor** (Centre or Leading edge), **Text size**, **Weight** 100–550, **Text color** | | Caption | Text scenes: up to 120 characters at the top-left, top-right, bottom-left, or bottom-right | | Timing | **Scene duration** 100–10,000 ms | | Text entrance | Text scenes: a preset, **Entrance duration** 100–3000 ms, **Stagger** 0–300 ms (0 is Auto, shown for Word rise and Glyph stagger), and **Entrance easing** (hidden for Type on) | | Keyframes | **Motion presets**, **Add keyframe at playhead**, **Clear keyframes**, and one row per keyframe with its time, easing, **Go to keyframe N**, and **Remove keyframe N** | | Effects | **Text effects** for text scenes, or **Artwork effects** for image and mark scenes | On the canvas: * Drag to move. Moves snap to the canvas edges and center lines. Arrow keys nudge 1 px, or 10 px with Shift. * Drag the round handle above the layer to rotate. Shift snaps to 15°. With the handle focused, ← and → rotate by 1°, or 15° with Shift. * **Show layout guides** shows the thirds and the safe area. Guides do not appear in exports. * **Anchor** sets whether text hangs from its center or its leading edge. A leading-edge anchor keeps a left-aligned headline on its margin when the words change. * A caption is one small line of scene metadata, such as an index, a language name, or a command. It is set in the Code face at a corner of the safe area. Captions stay in place and exchange by opacity during transitions. Dragging, scaling, and rotating on the canvas update the same scene data as the inspector. The layer follows a drag live and commits once on release. ### Keyframes [#keyframes] Keyframes animate the layer's horizontal and vertical position, scale, rotation, and opacity across the hold. Each keyframe stores a full pose and the easing of the segment that leaves it: Material, Ease out, Ease in-out, Overshoot, or Linear. 1. Select the scene and choose **Add keyframe at playhead**. 2. Move the playhead within the scene, then move, scale, or rotate the layer. Once a layer has keyframes, an edit updates the keyframe at the playhead or inserts one there. 3. Set each keyframe's easing in the keyframe list. Keyframes appear as diamonds on the storyboard. Drag a diamond to retime it. A focused diamond moves one frame with ← or →, or ten frames with Shift, and Delete or Backspace removes it. Removing the last keyframe keeps its pose as the static pose. Before the first keyframe and after the last, the nearest pose holds. During a transition the outgoing scene leaves from its last pose and the incoming scene enters from its first. **Motion presets** replace the keyframes with a preset built around the settled pose: | Preset | Motion | | ------------ | ---------------------------------- | | **Push in** | Scales up by 1.06× across the hold | | **Rise in** | Starts 0.14 lower and transparent | | **Slide in** | Starts 0.22 to the left | | **Pop in** | Grows from 82% scale within 520 ms | | **Float** | Drifts slightly at mid-hold | ### Text entrances [#text-entrances] | Entrance | Behavior | | ------------- | ------------------------------------------------ | | Type on | Graphemes appear one at a time, without a cursor | | Word rise | Words fade and rise one after another | | Line reveal | The line rises out of a baseline mask | | Glyph stagger | Each glyph settles from below in sequence | | Tracking in | Wide letterspacing closes to the set width | Entrances use the scene's display face and metrics. The default is 640 ms with ease out. Entrances and keyframes render the same in the preview, the GIF, the MP4, and the poster frame. ## Transitions [#transitions] Select a transition on the storyboard to edit the cut out of a scene: * **Background blend**: Crossfade, Directional wipe, or Radial reveal. * **Cut duration**: 0–2000 ms. **Use sequence duration** removes the override. * A package from the gallery: Morph fade, Type / delete (text only), Crossfade, Scale fade, Slide fade, Rise fade, Zoom through, Blur swipe, Flip fade, Spring pop, Rotate fade, Drift fade. * Easing: material, snappy, soft, or dramatic, or a cubic Bézier curve with X1, Y1, X2, and Y2 fields (X 0–1, Y −1 to 2). * **Use sequence transition** removes the override. These settings are stored on that scene's outgoing transition. Type / delete reveals and removes real characters without a cursor. Morph fade uses blur, opacity, and scale, and works between text and image scenes in any combination. Selecting a transition moves the playhead to its midpoint. ## Storyboard [#storyboard] | Control | Action | | --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Play preview** or **Pause preview**, **Restart preview** | Transport | | **Previous frame**, **Next frame** | Step one output frame | | **Timeline playhead** | Scrub. With the storyboard playhead focused: Home, End, ← and → (one frame), Shift + ← and → (1 second) | | **Zoom timeline out**, **Zoom timeline in**, **Fit timeline to view** | 40–800 px per second, 1.25× per step, or ⌘/Ctrl + scroll | | **Playback rate** | 0.1×, 0.25×, 0.5×, 1×, 2×, 4× | | `Scene N duration` handle | Drag the end of a hold to trim it. By default the next scene absorbs the change (roll), and Alt shifts the later scenes (ripple). The last scene always ripples. ← and → move the handle one frame, or ten frames with Shift. Trims snap to output frames, and the minimum hold is 100 ms | Right-click the storyboard for **Edit frame**, **Jump to frame start**, **Play from here**, **Preview transition**, **Play transition**, and **Edit next frame**. During playback the scene list and inspector follow the current scene. Pause or scrub to a hold to edit that scene, or into a transition to edit the transition. The storyboard scrolls with playback, and manual scrolling pauses that for 1.5 seconds. Storyboard zoom is a view setting and does not change timing. ## Backgrounds [#backgrounds] The **Base background** row ("Behind every scene") sets the background behind every scene: **Solid color**, **Gradient** (two colors and **Gradient angle**), or **Live shader**. A live shader comes from a compact [Shader Library](/docs/studio/shader-library) browser. **Shader framing** sets **Shader zoom**, **Horizontal position**, and **Vertical position**. **Motion and texture** sets **Shader speed** 0–1.5, **Frequency** 0.2–12, **Detail** 0.5–8, **Intensity** 0–1, **Grain** 0–100%, and **Rotation** −180° to 180°. Each scene row has a **Background** button that shows **Inherits base** or **Custom for this scene**. Select it and edit the background to give that scene its own: Solid, Gradient, or Live shader with the full live material controls, plus **Background effects**. **Use base background** in the inspector, or the row's `Use base background for ` button, removes that scene's override. Shader time follows the animation playhead, so scrubbing shows the material frame that export captures. Pausing the sequence pauses the material. Shader zoom uses the same 0.1×–10× logarithmic scale as Design Lab. ## Audio [#audio] **Add audio** imports audio files the browser can decode, and files can also be dropped on the track. Clips sit on the audio track below the storyboard. Each clip has **Timeline**, **In**, and **Out** positions in seconds, **Split** (at the playhead), a clip level, and **Delete selected audio clip**. Drag a clip to move it, or drag its edges to trim it. **Mute audio** and **Master audio volume** apply to the whole track. Clips must be at least 100 ms long. The waveform is decoded locally. MP4 export mixes overlapping clips unless the track is muted. GIF has no audio. ## Artboards [#artboards] The artboard bar has the active artboard picker, the size button that opens **Artboard setup** (the artboard name, the Design Lab presets, and custom sizes from 120 to 4096 px), **Add animation artboard**, **Duplicate animation artboard**, and **Delete animation artboard**. Right-click the bar, or press Shift + F10, for **Duplicate artboard**, **New artboard**, and **Delete artboard**. The stage's edge and corner handles resize the output from 120 × 120 up to 3200 × 2400 in 10 px steps. Zoom changes only the view. ## Saving [#saving] Working drafts autosave. **Save checkpoint** creates a named checkpoint, and **Save changes** updates it. **Saved animations** lists checkpoints and marks the **Current** one. It offers **New blank animation**, **Save as independent copy** (Clone), **Save as linked copy** (Fork), **Rename**, and **Delete** with confirmation. Undo and Redo cover sequence edits, scene settings, images, and artboards. Checkpoints stay in this browser. Use a [project file](/docs/studio/project-files) to share or back them up. ## Export [#export] | Format | Details | | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | GIF | Frames at the Output frame rate. Delays are rounded to 10 ms, so 24 FPS plays as 40 ms frames. One global palette is sampled from up to 8 frames, with up to 16 text colors protected. Still holds collapse to one frame unless a keyframe or entrance moves, and every hold is sampled when any scene has a shader background. **Loop forever** sets the loop flag. Loops are not blended | | MP4 | Encoded in the browser with H.264 first, then any other MP4 codec. A keyframe every 2 seconds. Includes the mixed audio track unless it is muted. Fails with an error when no encoder is available | | PNG poster | **File → Export poster frame**: the frame at the playhead at full output size | | Project file | **File → Download project file**: a `.glyphfield.json` file with artboards, scenes, timing, backgrounds, and embedded image, audio, and font bytes | Files are named `studio-.gif`, `studio-.mp4`, and `studio--ms.png`. Export is refused when the background is a stateful material, such as Fluid Energy, because its frames cannot be reproduced from a time value. Larger sizes, more frames, and live materials make exports take longer. ## Source format [#source-format] The source is a CanvasDocument schema 2 with `metadata.tool: "animation-studio"`. `metadata.animation` holds `mode`, `textFrames`, `includeBrandLogo`, `sequenceOrder`, `settings`, `frameSettings`, `sequenceBackground`, `backgroundOverrides`, `playbackRate` (greater than 0, at most 4), `audio`, `artboards`, `activeArtboardId`, and an optional `identity` typography snapshot. Each `frameSettings` entry holds one scene's `holdMs`, `transitionMs`, `transition`, `keyframes`, `textAnimation`, `caption`, `textAnchor`, `tracking`, pose, and background override. Validation rejects malformed motion fields with their path, for example `frameSettings.text-0.keyframes[1].atMs must be a finite number.` ## Browser API [#browser-api] The Browser API (`window.glyphfield.studio`) has these Animation actions: | Action | Input | Output | | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | | `animation.describe` | None | `{ durationMs, fps, width, height, playheadMs, scenes: [{ id, index, kind, label, startMs, holdMs, transitionMs, keyframes, textAnimation }], starters }` | | `animation.seek` | `{ timeMs }` | The `animation.describe` result. Pauses first | | `animation.scene.update` | `{ sceneId, holdMs?, transitionMs?, textAnimation?, pose? }`. `null` resets `holdMs` or `transitionMs` to the sequence default and removes `textAnimation` | The `animation.describe` result | | `animation.keyframe.set` | `{ sceneId, atMs, pose?, easing?: [x1, y1, x2, y2] }` | The `animation.describe` result | | `animation.keyframe.remove` | `{ sceneId, keyframeId }` | The `animation.describe` result | | `animation.motion.preset` | `{ sceneId, preset: 'push-in' \| 'rise-in' \| 'slide-in' \| 'pop-in' \| 'float' }` | The `animation.describe` result | | `animation.starter.apply` | `{ starterId: 'brand-intro' \| 'product-reel' \| 'proof-points' }` | The `animation.describe` result | | `animation.export` | `{ format: 'gif' \| 'mp4' \| 'png', download? }` | An export artifact | | `animation.export.gif`, `.mp4`, `.png`, `.project` | None | An export artifact | `textAnimation.preset` is `none`, `type-on`, `word-rise`, `line-reveal`, `glyph-stagger`, or `tracking-in`. Pose fields are `alignX`, `alignY`, `scale`, `rotation`, and `opacity`. Each must be a finite number and is clamped to the range that saved keyframes use: `alignX` and `alignY` −1.5 to 1.5 (±1 is the canvas edge), `scale` 0.05 to 8, `rotation` −720° to 720°, and `opacity` 0 to 1. When a scene already has keyframes, `animation.scene.update` with a `pose` writes the keyframe at the playhead or inserts one there. ```js const studio = window.glyphfield.studio; let animation = await studio.invoke('animation.starter.apply', { starterId: 'product-reel' }); const [first] = animation.scenes.filter((scene) => scene.kind === 'text'); await studio.invoke('animation.scene.update', { sceneId: first.id, holdMs: 1800, textAnimation: { preset: 'word-rise', durationMs: 640 }, }); await studio.invoke('animation.motion.preset', { sceneId: first.id, preset: 'push-in' }); await studio.invoke('animation.keyframe.set', { sceneId: first.id, atMs: 900, pose: { alignY: -0.05 } }); animation = await studio.invoke('animation.seek', { timeMs: first.startMs + 1200 }); const poster = await studio.invoke('animation.export.png'); ``` The labels **Scale** and **Text size** exist both in Sequence defaults and in the scene inspector. `studio.set('Scale', value)` changes the first match, which is the sequence default. Use `animation.scene.update` to change a scene's pose. ## HTTP [#http] Animation has no HTTP generation route. Identity colors and fonts come from the active project. ## Limits [#limits] | Item | Limit | | ------------ | ------------------------------------------------------------------------------- | | Keyframes | 32 per scene | | Scene hold | 100 ms–10 s in the inspector, and up to 60 s in source | | Caption | 120 characters | | Artboard | 120–4096 px per side in **Artboard setup**. The stage handles reach 3200 × 2400 | | Frame rate | 10, 15, 20, 24, 30 FPS | | Audio clip | At least 100 ms | | Project file | 128 MiB | --- # Lottie Import Lottie JSON or .lottie files, then edit, recolor, and trim them over a transparent, solid, or live background and export frames, GIF, MP4, or source. Canonical page: https://www.glyphfield.com/docs/studio/lottie Markdown: https://www.glyphfield.com/docs/studio/lottie.md Lottie (tool ID `lottie`) plays and edits vector animations. It accepts Lottie JSON and `.lottie` bundles and plays them in the browser with `@lottiefiles/dotlottie-web`. Each frame is composited over a transparent canvas, a solid color, or a live material from the [Shader Library](/docs/studio/shader-library). ## Layout [#layout] | Region | Contents | | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Tool header | **Save checkpoint**, **Saved designs**, the save status, **File** (**Edit source code**, and **Reset Lottie editor** under Workspace), **Export frame**, **GIF** (**Export Lottie GIF**), **MP4** (**Export Lottie MP4**), and **Export JSON** or **Export .lottie** | | Left sidebar | **Lottie sources**: **Import .lottie or JSON**, the seven built-in studies, and **Browse LottieFiles** | | Canvas | The animation in the shared canvas viewport, with **Pause animation** or **Play animation**, the **Animation frame** slider with marker ticks, the canvas size, and the frame count, duration, and speed | | Right inspector | 02 **Playback**, 03 **Markers**, 04 **Layers**, 05 **Appearance**, and 06 **Live material** when the background is a live material | ## Built-in studies [#built-in-studies] Seven studies ship with Glyphfield. Each is 960 × 720 at 60 FPS and 300 frames (five seconds), with the markers Build (frames 0–48), Hold (48–278), and Resolve (278–300). | Study | ID | | ----------------- | ------------------- | | Signal relay | `signal-relay` | | Decision router | `decision-router` | | Source merge | `source-merge` | | Layer assembly | `layer-assembly` | | Quality scan | `quality-scan` | | Network orbit | `network-orbit` | | Endpoint delivery | `endpoint-delivery` | A first visit starts from the identity's colors: its paper field, ink artwork, a quiet secondary, and its accent. Choosing a study loads its current design. Saved compositions keep their source until you choose a study again. ## Import [#import] | Input | Editable | Downloaded as | | ---------------- | ------------------------------------------------ | -------------------- | | Lottie JSON | Layers, text, colors, markers, and appearance | Edited JSON | | `.lottie` bundle | Playback, trim, canvas size, fit, and background | The original archive | Import accepts `.lottie`, `.json`, `application/json`, and `application/zip+dotlottie`. A file is treated as a `.lottie` archive only when its name ends in `.lottie`. JSON must contain a numeric `fr` and a `layers` array. Glyphfield sets no file size limit. The browser player decides which Lottie features render. An unsupported file shows "Choose a .lottie file or Lottie JSON document.", and invalid data shows "The selected file is not valid Lottie data." ## Playback [#playback] | Control | Values | | --------------------------------- | ------------------------------------------------------ | | Play or **Pause**, **Restart** | Transport | | **Speed** | 0.1×–3× | | **Playback direction** | Forward, Reverse, Bounce, Reverse bounce | | **Loop**, **Frame interpolation** | Toggles | | **In**, **Out** | Trim the segment | | **Animation frame** | Seeks within the In to Out segment and pauses playback | With reduced motion on, playback starts paused at the middle of the segment. ## Markers [#markers] Markers name segments of the timeline. `Play marker ` sets the in and out frames to that segment and plays it. **Add marker** creates "Segment N" from the current frame to the out point. Each marker has a name field (up to 64 characters) and `Remove marker `. An animation keeps at most 64 markers. **Add marker** is unavailable at 64, and editing the markers of an imported file with more keeps its first 64. JSON markers are written into the exported document's `markers`. Markers in a `.lottie` bundle are read from the bundle and play the same way. ## Layers and text [#layers-and-text] **Layers** lists the document's top-level layers with their type. `Hide layer ` removes a layer from playback and every export without deleting it, and `Show layer ` restores it. Layers hidden in the source cannot be shown. Text layers have `Text for layer ` (up to 500 characters) and `Restore original text for `. These edits apply to JSON documents only. They are non-destructive: the source is kept, and the preview, frame PNG, GIF, MP4, and JSON export carry the edited result. Each layer's key is its `ind`, or `#` when it has none. ## Appearance [#appearance] | Control | Values | | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Canvas size** | Landscape 1200 × 750, Portrait 750 × 1200, Square 960 × 960 | | **Animation fit** | Contain, Cover, Fill, Fit width, Fit height | | **Transparent background** | Toggle | | **Canvas background type** | **Solid color** or **Live material** | | **Canvas background** | Color | | Palette buttons | **Studio** (warm paper, ink, and terracotta, with its background), **Mono** (light artwork on `#161816`), **Brand** (the identity's ink, emphasis, and paper colors for the artwork only) | | **Primary**, **Secondary**, **Accent artwork color** | Color, with `Use for ` buttons for each identity color | | **Corner radius** | 0–48 px | | **Stroke width** | 1–16 px | | **Palette recolours every paint** | The primary slot recolors every unnamed paint, which is how older projects behaved | | **Show brand logo** | Adds the identity's mark, tinted with the Primary color, as a "Brand logo" layer in the top-left corner. On for the built-in studies and off for imported files | For a `.lottie` bundle, **Appearance** shows only the canvas size and fit. **Show brand logo** appears only for JSON documents and only when the identity has a logo. **Corner radius** and **Stroke width** appear while **Palette recolours every paint** is on. They then apply to every static rectangle radius and every static stroke width in a JSON document. A radius is limited to half the rectangle's shorter side. In the built-in studies, strokes named with `weight=N` keep their relative weights. In other documents every static stroke takes the **Stroke width** value. With the switch off, imported JSON keeps its authored radii and stroke widths. The built-in studies recolor through the three palette slots. When **Palette recolours every paint** is off, imported JSON keeps its authored colors and **Document colours** lists the 16 most used static fill, stroke, gradient stop, and text colors. Replace a color with the picker or a brand token. **Brand tokens** maps every document color at once, and **Authored** restores the originals. Brand mapping sends colors with an OKLCH chroma of at least 0.06 to the brand's accents in order of chroma, and sends neutrals to the brand neutral nearest in lightness. **Live material** appears when the background type is **Live material** and the canvas is not transparent. It has **Quick look**, **Material**, **Color system**, **Form**, **Light and texture**, **Orientation**, **Center**, and **Motion**. During export, material time follows the output clock. ## Export [#export] | Action | Result | | ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | | **Export frame** | A PNG of the current frame and background at the canvas size, named `-frame-.png` | | **GIF** | The trimmed segment at 25 FPS with a 256-color global palette that protects the three artwork colors, named `.gif` | | **MP4** | The trimmed segment at 30 FPS, named `.mp4` | | **Export JSON** or **Export .lottie** | The edited JSON, which keeps the source file name, or the original `.lottie` archive | GIF and MP4 follow the speed and direction. Bounce modes play forward and back, so they last twice as long. GIF and MP4 have no alpha channel, so a transparent canvas is flattened onto the canvas color. Only one GIF or MP4 export runs at a time. Export needs WebGL. The GIF and MP4 player stops after 10 seconds if the animation does not load, and the frame PNG player stops after 8 seconds. The JSON export includes the palette-slot colors, the corner radius, the stroke width, the brand font, and the layer, text, color, and marker edits. When **Show brand logo** is on, it also includes a "Brand logo" layer. The brand font replaces the font families listed in the document's `fonts.list`. ## Source format [#source-format] **File → Edit source code** shows a CanvasDocument schema 2. `metadata.studio` is `{ sourceVersion: 1, toolId: "lottie", state }`, where `state` holds `appearance` (including `recolor` and `brandLogo`), `background` (`color`, `materialId`, `materialSettings`, `style`, `transparent`), `canvasPreset`, `edits` (`colorMap`, `hiddenLayers`, `markers`, `textOverrides`), `playback` (`fit`, `interpolate`, `loop`, `mode`, `segmentStart`, `segmentEnd`, `speed`), and `source` with the raw animation in `source.data`. A `.lottie` archive is stored as an asset of the `lottie-animation` element. Raw Lottie JSON can also be pasted into the drawer. Applying it replaces the animation, clears all edits, sets `recolor` to `source`, and sets `brandLogo` to `false`. A saved document without `brandLogo` shows the logo for a Glyphfield study and hides it for an import. ## Browser API [#browser-api] The Browser API (`window.glyphfield.studio`) has these Lottie actions: | Action | Input | Output | | ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | | `lottie.describe` | None | `{ format, source, totalFrames, frameRate, segment, layers, textLayers, colors, markers, edits, recolor, brandLogo }` | | `lottie.edit` | `{ hiddenLayers?, colorMap?, textOverrides?, markers?: [{ name, frame, duration }], recolor?: 'palette' \| 'source', brandLogo?: boolean }`. Each listed field replaces the stored one | The `lottie.describe` result | | `lottie.colors.brand` | None | The `lottie.describe` result | | `lottie.segment.set` | `{ marker }` or `{ start, end }` | The `lottie.describe` result | | `lottie.export` | `{ format: 'png' \| 'source' \| 'gif' \| 'mp4', download? }` | An export artifact | | `lottie.export.frame.png`, `.gif`, `.mp4`, `.source` | None | An export artifact | `lottie.edit` and `lottie.colors.brand` work on JSON documents and reject `.lottie` archives. `lottie.edit` rejects unknown layer keys, malformed colors, and malformed markers. Color and marker errors name the field path. `lottie.segment.set` with a marker name fails when the document has no marker of that name. To get the edited JSON, call `lottie.export.source`. `readSource()` returns the CanvasDocument envelope. ```js const studio = window.glyphfield.studio; const file = new File([lottieJson], 'animation.json', { type: 'application/json' }); studio.set('Import .lottie or JSON', file); // Wait for the import, then: const lottie = await studio.invoke('lottie.describe'); const title = lottie.textLayers[0]; await studio.invoke('lottie.edit', { hiddenLayers: [lottie.layers.at(-1).key], textOverrides: { [title.key]: 'Edge by default.' }, recolor: 'source', }); await studio.invoke('lottie.colors.brand'); const [marker] = lottie.markers; if (marker) await studio.invoke('lottie.segment.set', { marker: marker.name }); const gif = await studio.invoke('lottie.export.gif'); ``` ## HTTP [#http] Lottie has no HTTP generation route. ## Limits [#limits] * Markers: 64 per document through the Browser API and saved sources. Marker names: 64 characters. Text overrides: 500 characters. * Layer, text, and color edits need a JSON document. * Export needs WebGL, and MP4 also needs a browser video encoder. * **Browse LottieFiles** opens the LottieFiles site. Glyphfield does not mirror that library, so check each animation's license before use. --- # Design Lab Compose layered brand graphics from text, marks, images, and live shaders on an open canvas with artboards, then export images, video, or a project file. Canonical page: https://www.glyphfield.com/docs/studio/design-lab Markdown: https://www.glyphfield.com/docs/studio/design-lab.md Design Lab is Glyphfield's layered composition tool. Its public tool ID is `material`. It combines the shared [Shader Library](/docs/studio/shader-library) with a portable layer document (CanvasDocument schema 2 with Design Lab metadata source version 4), direct canvas editing, saved checkpoints, still export, and GIF and MP4 export encoded in the browser. Use it for posters, social images, key visuals, stickers, and short shader clips. [Animation](/docs/studio/animation) is the tool for sequences of scenes on a timeline. The [expression tools](/docs/studio/templates) produce fixed-format social images and slides. Every layer kind and editing tool is described in [Layers and editing](/docs/studio/design-lab/layers). Converters and image effects are in [Effect layers](/docs/studio/design-lab/effects). Shader layers, preview quality, shader time, and shader sequences are in [Shaders and time](/docs/studio/design-lab/shaders). The export settings, saved designs, project files, and the source document are in [Export, saving, and source](/docs/studio/design-lab/export). ## Layout [#layout] | Region | Contents | | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Tool header | **Save checkpoint**, the **Saved designs** picker, the save status, **File**, **Export size preset**, and **Export** | | Artboard bar | The active artboard picker, **Artboard setup** (name and size), **Add**, **Duplicate active artboard**, **Delete active artboard**, **Frame selection** (when loose layers are selected), **Canvas**, and **Artboard tutorial** | | Canvas toolbar | Zoom out, the zoom slider, the zoom percentage (**Reset to 100%**), zoom in, **Reset view**, **Fit canvas**, **Live shader preview quality**, **Keyboard shortcuts**, Undo, Redo, and **Action history** | | Left sidebar | The Shader Library: random pick, search, look buttons with counts, the source filter, the kind filter, and material cards | | Canvas | Artboards, loose layers, selection handles, the **Artboard map**, and the shader time strip below the canvas | | Right inspector | With nothing selected: **Composition**, **Artboards**, **Layers**, and **Developer handoff**. With a layer selected: that layer's controls | | Layer dock | Add buttons (Text, Shader, Effect, Mark, Sticker, Image) and one card per layer, front to back | Both sidebars collapse from their edge handles and resize when their edge is dragged. A focused resize handle also accepts the arrow keys. Widths and the collapsed state are stored in this browser. On narrow screens the panels stack. The collapse buttons are labelled **Collapse Shader library** and **Collapse Design Lab controls**, and they become **Expand Shader library** and **Expand Design Lab controls** when collapsed. The save status shows one of Opening, Saving, Saving name, Unsaved changes, Saved, Autosave failed, Loading autosave, Preparing assets, Autosaved, Autosaving, or Save failed. **File** contains **Open project file**, **Download project file**, and **Edit source code**. A failed file or export action shows an **Error** button that opens the full message. ## Canvas and artboards [#canvas-and-artboards] The canvas is an open workspace. It holds loose layers anywhere, including at negative coordinates, and has no output size. An artboard is a named, sized output surface on the canvas. Exports contain only the layers inside the selected artboard. * Choose **Canvas** in the artboard bar, or click empty canvas, to add loose layers. Loose layers have the same controls as artboard layers. * Drag a layer out of an artboard to make it loose. Drop a layer with its center inside an artboard to move it into that artboard. The layer menu also offers **Move to canvas** and a destination for each named artboard. * Select loose layers and choose **Frame selection** to create an artboard around them. The new artboard keeps the layers' size on the canvas and adds 48 px of padding. * Effect layers belong to an artboard. They cannot be added to the loose canvas. * Saved designs and project files keep the loose canvas and every artboard. **Artboard setup** offers these presets and a custom size from 120 to 4096 px on each side: | Preset | Size (px) | | --------- | ----------- | | Wide | 1600 × 900 | | Square | 1080 × 1080 | | OG Social | 1200 × 630 | | Banner | 1000 × 300 | | Portrait | 1080 × 1350 | | Story | 1080 × 1920 | | 3:4 | 1080 × 1440 | | 2:3 | 1080 × 1620 | | 1:2 | 1080 × 2160 | **Add** creates an empty artboard with the size and background color of the active artboard. **Duplicate active artboard** also copies its layers. The loose canvas has a fixed reference size of 1600 × 900, and its layers can extend past it. ### Navigate the canvas [#navigate-the-canvas] * Scroll to zoom around the pointer. Zoom ranges from 5% to 800% and opens at 40%. * Drag empty canvas to pan. Hold Space and drag, or drag with the middle mouse button, to pan over content. * Click an inactive artboard to select it, or drag its surface to move it. Double-click a layer on an inactive artboard to enter that artboard with the layer selected. Any artboard can be dragged by its name label, and a focused label moves with the arrow keys. * **Fit canvas** fits every artboard and loose layer. **Reset view** returns to the starting view. The percentage button resets the zoom to 100%. * Inactive artboards and loose-layer previews that are off screen release their shader renderers. Selection, editing, and export keep the active renderers. The **Artboard map** is a minimap in a bottom corner of the canvas. Click or drag inside it to pan. Its action row has **Fit all**, **Center** (centers the selected artboard at the current zoom), and **Tidy** (arranges the artboards in a grid and fits them). Drag the map's header to move it, and it docks in the nearest bottom corner on release. With the header focused, the left and right arrow keys dock it, and Escape cancels a drag. **Hide artboard map** collapses it. ## Keyboard shortcuts [#keyboard-shortcuts] Press **?** or choose **Keyboard shortcuts** in the canvas toolbar to open the shortcut sheet. Escape or **Close keyboard shortcuts** closes it. The sheet and the key handler read the same list in `src/lib/designLabShortcuts.ts`. | Keys | Action | | ------------------------------------------------ | --------------------------------------------------------------------------- | | T, S, M, I, K, E | Add a text layer, shader layer, brand mark, image, sticker, or Effect layer | | ⌘/Ctrl + Z, Shift + ⌘/Ctrl + Z | Undo, redo | | ⌘/Ctrl + C, ⌘/Ctrl + X, ⌘/Ctrl + V | Copy, cut, and paste layers | | ⌘/Ctrl + A | Select every unlocked layer on the active surface | | Option/Alt + ⌘/Ctrl + C, Option/Alt + ⌘/Ctrl + V | Copy style, paste style | | ⌘/Ctrl + D | Duplicate the selection | | Delete or Backspace | Delete the selection | | ⌘/Ctrl + G, Shift + ⌘/Ctrl + G | Group, ungroup | | Shift + ⌘/Ctrl + L | Lock or unlock | | Shift + F10 | Open the layer or canvas menu | | Arrow keys | Nudge 1 px, or 10 px with Shift | | ⌘/Ctrl + ], ⌘/Ctrl + \[ | Bring forward, send backward | | Shift + ⌘/Ctrl + ], Shift + ⌘/Ctrl + \[ | Bring to front, send to back | | Option/Alt + A, H, D | Align left, horizontal center, right | | Option/Alt + W, V, S | Align top, vertical center, bottom | | Option/Alt + Shift + H, V | Distribute horizontally, vertically | | Space + drag | Pan | | Scroll | Zoom around the pointer | | F | Fit canvas | | + or =, − | Zoom in, zoom out by 10 percentage points | | ? | Show or hide the shortcut sheet | | ⌘/Ctrl + B, I, U | Bold, italic, underline while editing text | | Escape | Finish editing text | Layer and edit shortcuts work while Design Lab has focus or the pointer is over it. Undo, redo, F, + and − work while the canvas has focus or the pointer is over it. No shortcut runs while a text field, menu, dialog, or list box has focus. Option/Alt shortcuts and the ⌘/Ctrl chords read the physical key, so they work on keyboard layouts where Option or Shift produces another character. Duplicate, delete, cut, and the order chords act on the canvas selection. When no canvas layer is selected, they act on the layer chosen in the layer list. Delete and cut skip a locked layer. ⌘/Ctrl + X with no layer selected does nothing, and ⌘/Ctrl + C with no layer selected copies the artboard. I and K open the image picker. E on the loose canvas shows a message and adds no Effect layer. Align shortcuts need two or more layers, and distribute shortcuts need three. ## Browser API [#browser-api] The Browser API (`window.glyphfield.studio`) exposes these Design Lab actions while Design Lab is the active tool, in addition to the standard source and control actions. `describe()` returns the current action list and contracts. | Group | Actions | | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Workspace | `design.workspace.describe`, `design.workspace.activate`, `design.workspace.move`, `design.workspace.frameSelection` | | Layers | `design.layers.arrange`, `design.layers.lock`, `design.layers.rotate`, `design.layers.copyStyle`, `design.layers.pasteStyle`, `design.text.format` | | Effect layers | `design.effects.describe`, `design.effects.add`, `design.effects.configure` | | Shader time | `design.frame.pause`, `design.frame.play`, `design.frame.seek`, `design.frame.capture`, `design.motion.describe` | | Shader sequence | `design.sequence.describe`, `design.sequence.configure`, `design.sequence.preview`, `design.sequence.stop` | | Export | `design.export`, `design.export.png`, `design.export.jpg`, `design.export.gif`, `design.export.mp4`, `design.export.shader-sequence.gif`, `design.export.shader-sequence.mp4`, `design.export.project` | Each Design Lab page lists the inputs and outputs of its actions. The [Studio Browser API reference](/docs/reference/browser-api) describes the lifecycle, controls, and errors. ## HTTP [#http] `POST /api/generate` with `kind: "design-sequence"` returns a response-schema-1 envelope. Its `document` is a version-3 compatibility source for Design Lab, with a resolved shader timeline and browser commands. Apply `response.document` with `applySource`, then read the normalized CanvasDocument again before further edits. The server does not render Design Lab pixels. See [Generation API](/docs/agents/generate). ## Limits and requirements [#limits-and-requirements] | Item | Limit | | --------------------- | --------------------------------------------------------------------------------------------------- | | Artboard size | 120–4096 px per side | | Export width | 320–3840 px, even numbers. The height follows the artboard ratio | | Motion export | 1.2, 1.6, 2.4, or 4 seconds at 12, 15, 24, 30, or 60 FPS | | Imported image | 4,000,000 bytes. PNG, JPG, WebP, AVIF, GIF, BMP, or SVG | | Captured shader frame | A PNG smaller than 25 MB | | Project file | 128 MiB (134,217,728 bytes) | | Text size | 1–2048 px | | Live shaders | WebGL2 for Paper, Glyphfield, Fluid, and ShaderGradient materials. WebGPU for Shaders.com materials | | Image effects | WebGPU. Exports stop with an error when it is unavailable | | MP4 | A browser video encoder. H.264 is preferred | Text, mark, image, sticker, and shader layers rotate about their centers, and the angle is stored in the range −180° to 180°. Effect layers cover the artboard and do not rotate. While a layer is dragged, it snaps within 6 screen pixels to the artboard's edges, center, and rule-of-thirds lines, and to the edges and centers of other layers. --- # Layers and editing Add and edit every kind of Design Lab layer, format parts of a text box, crop images, and rotate, align, lock, or copy the style of selected layers. Canonical page: https://www.glyphfield.com/docs/studio/design-lab/layers Markdown: https://www.glyphfield.com/docs/studio/design-lab/layers.md Every element in Design Lab, the layered composition tool, is a layer in one ordered stack. The layer dock and the **Layers** section of the inspector list layers front to back. In source, `page.elementIds` stores the same order back to front. ## Layer kinds [#layer-kinds] | Kind | Add with | Default box | Inspector controls | | ------- | -------------------------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | Text | **Text** or T | 72% × 25% of the artboard | Copy, font, size, weight, styles, color, alignment, wrapping, line height, tracking, text effect, outline, shadow, opacity | | Shader | **Shader**, S, or a library card | The full artboard | Colors, palette, material settings, zoom, frame position and size, opacity, blend mode ([Shaders and time](/docs/studio/design-lab/shaders)) | | Effect | **Effect** or E | The full artboard | Converter type or image effect, effect settings, opacity ([Effect layers](/docs/studio/design-lab/effects)) | | Mark | **Mark** or M | 42% × 32% | Mark asset, color, appearance, opacity | | Sticker | **Sticker** or K | 34% × 38% | Image, crop, surface finish, finish settings, appearance, opacity | | Image | **Image** or I | 34% × 38% | Image, crop, focus, zoom, appearance, opacity | I and K open the image import dialog, which adds the chosen files as images or stickers. New text, text stickers, and recolorable marks start black in light mode and white in dark mode. Text outlines start with the opposite color. These colors are stored on the layer when it is created. Changing the Studio theme, duplicating a layer, or reopening a project does not recolor existing layers. Imported images and shader palettes keep their own colors. A new layer is selected when it is added. ## Select, move, and resize [#select-move-and-resize] * Click a layer on the canvas or its card in the dock to select it. Shift-click or ⌘/Ctrl-click a layer on the canvas to add it to the selection. * Drag to move. While dragging, the layer snaps within 6 screen pixels to the artboard's edges, center, and rule-of-thirds lines, and to the edges and centers of other layers. A rotated layer snaps by the area it covers. On the open canvas, layers snap to edges and centers only. * Drag a selection handle to resize. Shader layers can also be sized with **Frame width** and **Frame height** (2% to 300% of the artboard) and placed with **Horizontal position** and **Vertical position**. * Press the arrow keys to nudge by 1 px, or by 10 px with Shift. Text and image boxes do not resize to fit their contents. Text that overflows a narrow box stays visible in the preview and in the export. ### Edit several layers at once [#edit-several-layers-at-once] With more than one layer selected, the inspector shows the last layer you selected and its meta reads the number of layers. A change in the inspector applies to every selected layer that has that setting: * Layers of the same kind take every change: font, color, size, weight, styles, line height, tracking, text effect, outline, shadow, appearance, sticker finish and box width. * Text, marks and images all take **Layer opacity**, and marks and images share appearance. * **Layer rotation** turns each selected layer about its own center. * Shader settings, palettes, **Reset shader**, a material picked from the library and **Remove shader from layer** reach every selected shader layer and every selected layer with a material. A layer without a material only gains one when you pick a material. * On shader layers, **Frame width** and **Frame height** apply to each selected shader layer, and the position fields move the selection together. Text content, image crop, a mark's source and each layer's position stay per layer. A font size is set on each text box from its own box, so boxes keep their positions. When part of a text box is selected for formatting, changes apply only to those characters. ## Rotate layers [#rotate-layers] Text, mark, image, sticker, and shader layers rotate about their centers. * Drag the round handle below a selected layer to rotate it. Hold Shift to rotate in 15° steps. * **Layer rotation** in the inspector sets the angle in degrees, clockwise. Angles are stored in the range −180° to 180°, so 270 is stored as −90. * A rotated layer resizes along its own sides. * **Reset mark position**, **Reset image position**, **Reset text box**, and **Fit shader to canvas** also reset the rotation. * Align, distribute, and **Frame selection** use the area a rotated layer covers. * Copy, paste, and duplicate keep the rotation. Copy style does not copy it. * The **Rotation** slider in a shader's **Advanced** section turns the material inside the layer. **Layer rotation** turns the layer itself. Effect layers cover the whole artboard and do not rotate. `design.layers.rotate` takes `{ layerIds: string[], rotation: number }`. Each listed unlocked layer turns to `rotation` degrees clockwise about its own center. Locked layers are skipped, and the action fails when every listed layer is locked. `0` removes the rotation. The action returns `null` after the change commits. ## Layer dock and menus [#layer-dock-and-menus] Each dock card shows a live thumbnail, the layer name, its position in the stack, and its kind. The card buttons are **Duplicate**, **Move forward**, **Move backward**, **Hide layer** or **Show layer**, **Lock layer** or **Unlock layer**, and **Delete**. Effect layer cards have no lock button. Converter thumbnails draw the converter's real algorithm on a sample, and image effect thumbnails show the effect's library preview. Right-click a layer on the canvas, or press Shift + F10, for the selection menu: * **Move to canvas** and the named artboards, or **Frame selection** for loose layers * **Crop image** (or **Finish cropping**) and **Reset crop** for images and stickers * **Cut**, **Copy**, **Paste**, **Duplicate**, **Select all layers** * **Copy style**, **Paste style** * **Group selection**, **Ungroup selection** * **Bring forward**, **Bring to front**, **Send backward**, **Send to back** * **Align selection** (two or more layers) and **Align to artboard** * **Lock selection**, **Selection visible** or **Selection hidden**, **Delete selection** Right-click a dock card or a row in the inspector's **Layers** list for the layer menu. It has **Copy layer**, **Cut layer**, **Paste**, **Duplicate layer**, **Copy style**, **Paste style**, **Layer visible** or **Layer hidden**, **Lock layer** or **Unlock layer**, the four order commands, and **Delete layer**. Effect layers have no style or lock items. Multi-selection and groups move related layers as one unit. ⌘/Ctrl + G groups the selection, and Shift + ⌘/Ctrl + G ungroups it. Each layer in a group keeps its own settings. **Undo** and **Redo** sit in the canvas toolbar, and **Action history** lists recent edits. ⌘/Ctrl + Z and Shift + ⌘/Ctrl + Z work while the canvas has focus or the pointer is over it. Fields in the inspector keep their own text undo. Named checkpoints in **Saved designs** are separate from the edit history. The full shortcut list is on the [Design Lab](/docs/studio/design-lab#keyboard-shortcuts) page. ## Clipboard, paste, and drop [#clipboard-paste-and-drop] ⌘/Ctrl + C and ⌘/Ctrl + V copy and paste layers or a whole artboard, including their assets and captured shader frames. ⌘/Ctrl + X copies the selected layers and deletes them. Pasting image files from the system clipboard, or dropping image files onto an artboard or the canvas, opens the image import for those files. The accepted image types are PNG, JPG, WebP, AVIF, GIF, BMP, and SVG, up to 4,000,000 bytes each. ## Text [#text] Text is a canvas layer with its own box. New text starts at 48 px. | Control | Range or values | | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Text content | Any text. Edit it in the inspector, or click the text on the canvas and type | | Font | A brand role (Display, Body, Accent, Code), which follows the identity, or one font: the brand's font files and every font Glyphfield ships, Katagami included | | **Text size in pixels** and **Text size** | 1–2048 artboard pixels in the number field. The slider reaches 512 | | **Font weight** | The supported range of the selected font | | Bold, Italic, Underline, Strikethrough | Toggles. Underline and strikethrough combine | | Alignment | Left, center, right | | Wrapping | **Wrap** or **Single line** | | Text box width | 0.25–3 × the default box | | Line height | 0.7–1.8 | | Tracking | −0.12 to 0.2 em | | Text effect | Solid, Bayer sweep, Halftone, Scan lines, Gradient ink, with **Effect strength**, **Pattern scale**, and **Effect angle** | | Outline | Color and width 0.5–12 px | | Shadow | Color, blur 0–64 px, X and Y offset ±48 px, opacity | | Layer opacity | 0–100% | Setting a pixel size keeps the box position and dimensions and resets the separate layer scale to 1. Older designs without a pixel size keep their height-relative size until the size is edited. ### Format part of a text box [#format-part-of-a-text-box] Select words or lines on the canvas or in the inspector text field. The inspector shows **Selected text · N characters**. Font, size, weight, color, italic, underline, strikethrough, and tracking then apply only to those characters. **Whole text box** returns to formatting the whole box. A selection that spans different styles shows **Mixed formatting**. Alignment, wrapping, line height, opacity, outline, shadow, text effect, and shader fill always apply to the whole box. While editing with a range of text selected, ⌘/Ctrl + B, ⌘/Ctrl + I, and ⌘/Ctrl + U toggle bold, italic, and underline. Formatting follows the characters as text is inserted or deleted. Plain-text paste takes the formatting at the insertion point. Pasted HTML is not imported. In source, a text element stores its plain `value` and optional ordered `runs`: `{ start, end, style }` with UTF-16 offsets and an exclusive end. Unset style fields inherit from the layer. Run `fontSize` is in authored pixels before layer scale. A `fontId` on the layer or a run names one font file and wins over `fontRole`. Setting either one replaces the other. `design.text.format` applies run styling through the Browser API (`window.glyphfield.studio`): ```js await window.glyphfield.studio.invoke('design.text.format', { layerId: 'text-1', start: 0, end: 5, style: { color: '#2F5CE0', weight: 600 }, }); ``` `style` accepts `color`, `fontRole` (`Display`, `Body`, `Accent`, `Code`), `fontId` (a brand font id or a shipped one such as `katagami-sans-variable`), `fontSize`, `weight`, `fontStyle` (`normal`, `italic`), `underline`, `strikethrough`, and `tracking`. The range must be non-empty and inside the text. The action returns `null`. Read `element.data.runs` from `readSource()` to confirm the change. ### Text rendering options [#text-rendering-options] * A solid identity color * A live shader clipped to the glyphs (choose a material while the text layer is selected) * A text effect preset * A converter or image effect from an Effect layer above it * A sticker with a cut border and a finish * An outline and a shadow ## Images and crop [#images-and-crop] Images come from local files or the identity asset library. Double-click an image or sticker, or choose **Crop image** from its menu, to enter crop mode. The frame stays in place, and the parts of the source outside it are dimmed. * Drag the source to reposition it. Hold Shift to lock the drag to one axis. * Drag an edge or corner of the frame to change the crop area. * Press the arrow keys to move the source. * Double-click again, press Enter or Escape, or choose **Done** to finish. The image inspector has **Crop to frame**. With it on, the inspector adds **Edit crop on canvas**, **Fill frame**, **Fit image**, **Original ratio**, **Crop aspect** (Freeform, Square · 1:1, Landscape · 4:3, Widescreen · 16:9, Portrait · 3:4, Story · 9:16), **Crop zoom**, **Horizontal focus**, **Vertical focus**, and **Reset crop**. Cropping is non-destructive. Duplicate, undo, autosave, saved designs, project files, source, and export all keep the crop. The image and sticker pickers list saved brand assets. Each asset has a delete action that asks for confirmation and removes only the library copy. Layers already placed keep their embedded image. If browser storage is full, delete unused library assets and import again. ## Stickers [#stickers] A sticker is an image layer with a cut border and a physical finish. **Surface finish** has 13 presets: Holo vinyl, Prismatic, Mirror chrome, Brushed metal, Pearl laminate, Glitter flake, Retroreflective, Clear frost, Soft touch, Spot gloss, Epoxy dome, Embossed foil, and Precision metal inset. **Shine**, **Texture**, **Relief**, **Glint angle**, and **Depth** adjust the finish. **Die-cut outline** sets the border's color and width (up to 24 px). An inner separation edge keeps white artwork visible on a white border. A sticker needs no background. Export it over the artboard color or combine it with a shader layer. ## Marks [#marks] A mark layer places a logo from the active identity: the dark or light mark, the wordmark, or another logo asset. Its inspector has **Mark color**, opacity, the appearance controls, **SVG conversion & mark library**, and **Reset mark position**. **SVG conversion & mark library** adds local SVG, PNG, JPG, WebP, GIF, AVIF, or BMP files smaller than 25 MB as marks. It sanitizes SVG input, converts each file to a transparent PNG at 1024, 2048, or 4096 px (**Converted asset size**), and keeps the original and the PNG in IndexedDB in this browser. Nothing is uploaded. ## Appearance [#appearance] Marks, images, and stickers share these controls: | Control | Mark label | Image and sticker label | Settings | | ------- | --------------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------ | | Invert | **Invert logo color** | **Invert image colors** | On or off | | Dither | **Dither logo** | **Dither image** | **Dither amount** 0–100%, **Cell size** 2–18 px, **Dither direction** 0°–360° | | Outline | **Outline** | **Outline**, or **Die-cut outline** on stickers | Color with opacity, **Outline width** 0.5–12 px (24 px on stickers) | | Shadow | **Logo shadow** | **Image shadow** or **Sticker shadow** | Color with opacity, **Blur** 0–64 px, **Horizontal offset** and **Vertical offset** ±48 px | The outline follows the alpha shape of the SVG or transparent image. ## Align and distribute [#align-and-distribute] Select two or more layers and open the selection menu. **Align selection** aligns the layers to the bounds of the whole selection: **Align left edges**, **Align horizontal centers**, **Align right edges**, **Align top edges**, **Align vertical centers**, and **Align bottom edges**. **Distribute horizontally** and **Distribute vertically** need three or more units. The outermost units stay in place, and every neighboring pair gets the same gap. **Align to artboard** aligns the selection to the artboard's edges and centers with **Align left**, **Center horizontally**, **Align right**, **Align top**, **Center vertically**, and **Align bottom**. A fully selected group moves as one unit. Locked layers are skipped. Effect layers are not arranged. `design.layers.arrange` runs the same operations: | Input | Values | | ------------- | ------------------------------------------------------------------------------------------------------------------------ | | `arrangement` | `left`, `horizontal-center`, `right`, `top`, `vertical-center`, `bottom`, `distribute-horizontal`, `distribute-vertical` | | `layerIds` | Optional. Omit it, or pass an empty array, to use the current selection | Alignment needs two units and distribution needs three. The action returns `null` after the change commits. ## Lock layers [#lock-layers] Lock a layer from its dock card, the **Layers** list in the inspector, either menu, or Shift + ⌘/Ctrl + L. Shift + ⌘/Ctrl + L locks the targets if any of them is unlocked, and unlocks them otherwise. A locked layer stays visible and exports normally. It ignores canvas clicks, drags, resize handles, on-canvas text editing, and nudges, and it is left out of the canvas selection and **Select all layers**. Its inspector controls stay available. Locks are saved as `element.locked` in source, autosave, saved designs, and project files. Effect layers cannot be locked. `design.layers.lock` takes `{ layerIds: string[], locked: boolean }` and returns `null`. ## Copy and paste style [#copy-and-paste-style] **Copy style** (Option/Alt + ⌘/Ctrl + C) takes the selected layer's appearance. **Paste style** (Option/Alt + ⌘/Ctrl + V) applies it to the selected unlocked layers. Content, position, size, rotation, name, visibility, and lock state stay unchanged. | Source layer | Style that is copied | | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Text | Font role, size, weight, italic, underline, strikethrough, tracking, line height, alignment, wrapping, color, outline, shadow, text effect, opacity. Pasting clears inline run overrides for those properties | | Mark | Appearance, color, opacity | | Image | Appearance, opacity | | Sticker | Appearance, opacity, finish | | Shader, or a layer with a material fill | The material, which fills content targets | `design.layers.copyStyle` takes `{ layerId }`. `design.layers.pasteStyle` takes `{ layerIds }` and skips locked layers. It fails with "Copy a style first, then paste it onto unlocked layers." when no style was copied or every target is locked. Both actions return `null`. Effect layers cannot be style sources or targets. ## Opacity and blending [#opacity-and-blending] Every layer has its own opacity. Shader layers also have a blend mode: Normal, Screen, Overlay, or Multiply. A material applied to a text, mark, or image layer has its own opacity and blend mode in addition to the layer opacity. **Remove shader from layer** takes the material off a content layer. --- # Effect layers Process every layer beneath a Design Lab Effect layer with a built-in converter or a Shaders.com image effect, and export the result as a still or motion file. Canonical page: https://www.glyphfield.com/docs/studio/design-lab/effects Markdown: https://www.glyphfield.com/docs/studio/design-lab/effects.md An Effect layer in Design Lab, the layered composition tool, processes the composited image of every visible layer beneath it in the same artboard. It has no content of its own. It runs one of four built-in converters or one of the Shaders.com image effects. `/api/materials` lists the image effects under `imageEffects`, and there are 97 in seven groups. ## Add an Effect layer [#add-an-effect-layer] Choose **Effect** in the layer dock, press E, or call `design.effects.add`. The new layer is placed in front of every other layer of the active artboard and covers the full artboard. An Effect layer processes only the layers behind it, so move it down the stack to process fewer layers. Effect layers belong to an artboard. On the loose canvas the **Effect** button is disabled and E shows the message "Frame your selection to apply composition-wide effects". Effect layers cannot be locked, aligned, distributed, rotated, or used to copy and paste style. Choosing a converter type or an image effect renames the layer after that converter or effect. ## Built-in converters [#built-in-converters] Select an Effect layer and choose a **Converter type**: | Converter | Result | | --------- | ------------------------------------ | | Bayer | Stable 8×8 ordered print texture | | ASCII | Luminance rebuilt from glyph density | | Halftone | Editorial dot-screen conversion | | Posterize | Pixelated limited-tone color field | | Control | Range | | ------------------------------ | -------------------------------------------- | | **Cell size** | 1–28 px. ASCII starts at 7 and Halftone at 4 | | **Contrast** | 0.4–2.4 | | **Brightness** | 0–1 (the luminance threshold) | | **Tone count** | 2–8 (Posterize only) | | **Foreground**, **Background** | Colors | | **Invert luminance** | On or off | | **Layer opacity** | 0–100% | The foreground and background colors are explicit, so a converted field does not become transparent. Converter previews render at up to 640 px wide. When a preview frame takes longer than 14 ms on average, the preview first narrows toward 360 px and then drops to 30 frames per second. It returns to full rate and width when frames are fast again. ## Image effects [#image-effects] With an Effect layer selected, the **Image effects** section of the inspector lists the Shaders.com image effects with static thumbnails. **Search image effects** matches every typed word against each effect's name, description, and group. The groups appear in this order: | Group | Count | Examples | | ------------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Stylize | 30 | Engraving, Halftone, Ascii, Dither, Gradient Map, Chalkboard, CRTScreen, Watercolor, Light Leak, Particle Field, VHS, Glitch, Paper, Film Grain, Vignette, Drop Shadow | | Blurs | 9 | Bokeh Blur, Progressive Blur, Tilt Shift, Zoom Blur, Angular Blur | | Distortions | 22 | Fluted Glass, Glass Tiles, Kaleidoscope, Spherize, Twirl, Wave Distortion, Polar Coordinates, Mirror, Perspective | | Adjustments | 14 | Film Stock, Duotone, Tritone, Posterize, Solarize, Grayscale, Hue Shift, Exposure, Sharpness | | Transitions | 13 | Page Peel, Ripple Wipe, Noise Dissolve, Iris Wipe, Venetian Blinds, Barn Doors | | Interactive | 6 | Shatter, Pixel Sort, Cursor Ripples, Grid Distortion, Liquify, Pixel Throw | | Shape Effects | 3 | Glass, Crystal, Emboss | Choosing an effect replaces the layer's converter output with that effect. **Effect settings** then shows the effect's own controls: colors, numeric ranges, positions, switches, and choices. Effect colors start from the identity's material palette (ink, accent, and highlight), which are the same three colors a new shader layer starts with. A color set in **Effect settings** replaces the palette color and is saved in `effectProps`. Colors that were not set follow the identity. **Reset effect settings** returns every setting to its default. **Converter type** switches the layer back to a built-in converter. ### Preview [#preview] The canvas preview composites the layers beneath the effect at preview size, at most 640 px wide, and runs the effect on that image. While anything beneath the effect moves, the preview updates at up to 10 frames per second, and converters in the same stack follow that rate. When the canvas is paused, the preview redraws only when something changes. ### Export [#export] An export composites the layers beneath each image effect at the full output size, runs the effect, then composites the result with the layers above it. A PNG or JPG passes the current shader time to the effect. GIF and MP4 run the effect for every frame and pass each frame's time, so effects that change over time move with the clip. If an effect fails during export, the export stops with an error that names the layer and suggests hiding it. ### WebGPU requirement [#webgpu-requirement] Image effects run on WebGPU. When the browser has no WebGPU: * The canvas shows the layers beneath the effect unchanged. * A notice on the artboard reads "Image effect needs WebGPU", and the inspector explains that exports need WebGPU too. * Still and motion exports stop with an error that names the layer. Hide the layer to export without it. When an effect fails to render for another reason, the artboard notice reads "Image effect could not render". `design.effects.describe` reports each image effect layer's status as `loading`, `ready`, `unsupported`, or `error`. ## Source format [#source-format] An Effect layer is a CanvasDocument element of kind `effect`. Its bounds are the artboard's width and height in pixels. Its `settings` keeps the converter fields: `kind`, cell size, contrast, threshold, levels, the foreground and background colors, and inversion. The layer's opacity is stored on the element. An image effect adds `effectId` and `effectProps`. `effectProps` holds the values that were set explicitly and follows the effect's `nativeControls` from `/api/materials`. `sourceImage` is not accepted, because the layers beneath are the source. Older documents that used an image effect as a shader layer still load and render. ## Browser API [#browser-api] The Browser API (`window.glyphfield.studio`) has three Effect layer actions: | Action | Input | Output | | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `design.effects.describe` | None | `{ builtIn, imageEffects: { categories, effects, controls }, layers }`. `layers` lists the active artboard's Effect layers back to front with `id`, `name`, `opacity`, `visible`, and either `kind` or `effectId` and `effectProps`. An image effect adds `status` once it has rendered or failed | | `design.effects.add` | `{ kind?: 'bayer' \| 'ascii' \| 'halftone' \| 'posterize', effectId?, effectProps?, opacity?: 0..1 }` | `{ layerId }` | | `design.effects.configure` | `{ layerId, kind?, effectId?, effectProps?, opacity? }`. `kind` and `effectId` cannot be combined, and `effectProps: {}` resets the settings | `{ layerId }` | `effectProps` is validated against the effect's `nativeControls`. `design.effects.add` fails on the loose canvas. Setting `kind` resets the converter settings to that converter's defaults. ```js const studio = window.glyphfield.studio; const { layerId } = await studio.invoke('design.effects.add', { effectId: 'shader-effects-engraving', effectProps: { inkColor: '#070707', paperColor: '#F4F4F2' }, }); const { layers } = await studio.invoke('design.effects.describe'); const layer = layers.find((entry) => entry.id === layerId); if (layer?.status === 'unsupported') throw new Error('This browser has no WebGPU.'); ``` ## Limits and requirements [#limits-and-requirements] * Image effects need WebGPU in the preview and in every export. * The image effect preview runs at up to 10 frames per second and at most 640 px wide. Exports run at the full output size. * Effect layers cannot be placed on the loose canvas. --- # Shaders and time Tune Design Lab shader layers and the live preview quality, pick and capture exact shader frames, and build sequences that cut between several shaders. Canonical page: https://www.glyphfield.com/docs/studio/design-lab/shaders Markdown: https://www.glyphfield.com/docs/studio/design-lab/shaders.md A shader layer in Design Lab, the layered composition tool, renders one material from the shared [Shader Library](/docs/studio/shader-library). A material can also fill a text, mark, image, or sticker layer, clipped to that layer's shape. The Shader Library page describes the catalog, engines, filters, and native controls. ## Add or replace a shader [#add-or-replace-a-shader] Click a library card to add a shader layer, or to replace the material of the selected shader layer. With a text, mark, image, or sticker layer selected, a card applies the material as that layer's fill. A material picked from the library takes the identity palette and keeps the layer's opacity, blend mode, and zoom. New Design Lab compositions start with Gem Smoke (`paper-gem-smoke`). When a material is replaced, the previous material stays on screen in a paused state until the new one has drawn its first frame. The old material then fades out over 160 ms. If the new material is not ready within 8 seconds, the old one fades out anyway. A card starts loading the engine code for Shaders.com and ShaderGradient materials when the pointer enters it or it receives focus, so those materials open faster when clicked. ## Shader inspector [#shader-inspector] | Section | Controls | | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | **Shader color** | **Base color**, **Mid color**, and **Light color**. Palette buttons apply the identity palette or one of seven presets (Monochrome chrome, Mercury, Ultraviolet, Signal lime, Copper heat, Arctic, Vermilion ink). **Reset shader** restores the material's starting settings and zoom. A link opens the material's source when it has one | | **Effect settings** | Shaders.com materials only: the material's [native controls](/docs/studio/shader-library#native-shaderscom-controls) | | **Shader settings** | **Shader zoom** 0.1×–10× on a logarithmic slider, **Layer opacity**, a blend mode (Normal, Screen, Overlay, or Multiply), **Center X** and **Center Y** (Paper materials), **Shader speed** 0–1.5, **Frequency** 0.5–12, **Warp** 0–1.5, **Detail** 0.5–9, **Texture** (grain) 0–100, and **Light** (brightness) 0.35–1.6 | | **Shader frame** | **Horizontal position** and **Vertical position** in pixels, **Frame width** and **Frame height** (2% to 300% of the artboard), **Layer rotation**, and **Fit shader to canvas** | | **Advanced** | **Amplitude** 0–10, **Density** 0.1–2, and **Rotation** −180° to 180°. This rotation turns the material inside the layer. **Layer rotation** turns the layer itself | Shaders.com materials show **Shader speed** and their native controls. Frequency, Warp, Detail, Texture, Light, and the **Advanced** section do not apply to them, so Design Lab hides them. Each native control uses the range, step, and choices that its `nativeControls` entry in `/api/materials` declares. **Shader zoom** below 1× shows more of the field, and zoom above 1× moves into its detail. Equal slider travel gives equal visual zoom. The value field next to the slider accepts an exact zoom. ## Preview quality [#preview-quality] **Live shader preview quality** in the canvas toolbar cycles through **Auto**, **High**, and **Draft**. It changes only the resolution of live shader previews. Exports always render at the output size. | Mode | Pixels per shader | Pixels for all shaders | | ----- | ------------------------------------------------------------------------------------------------------ | ------------------------- | | High | 240,000–2,400,000 | 4,800,000 | | Draft | 48,000–120,000 | 300,000 | | Auto | Starts at High, switches to Draft after sustained slow frames, and returns to High when frames recover | Follows the current level | Auto measures frames only while Design Lab is active, the composition is playing and has motion, the page is visible, and reduced motion is off. After a 2-second warm-up it sorts frames into 2.5-second windows. A frame is late when it takes more than 1.35 times a 60 Hz frame. A window is slow when the average frame takes more than 1.15 times a 60 Hz frame and at least 20% of frames are late. A window is smooth when the average frame takes at most 1.05 times a 60 Hz frame and at most 5% of frames are late. * Two slow windows in a row switch Auto to Draft. * Four smooth windows in a row (10 seconds) switch Auto back to High. * After the first return to High, each new drop doubles the number of smooth windows that the next return needs, up to 24 windows (one minute). * Every switch restarts the warm-up. The button's tooltip says when Auto has lowered the resolution. The chosen mode is stored in this browser. Captured shader frames, saved designs, and project files copy the pixels of the live preview canvas. Choose **High** before **Capture shader frame** when the saved frame must stay sharp at large sizes. ## Shader time [#shader-time] The strip below the canvas controls the time of the selected shader layer: | Control | Action | | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | | **Freeze current shader frame** and **Resume live shader motion** | Pause or play. Stateful materials show **Start new fluid motion** in place of resume | | **Shader time** | Shows Live or Paused and the time in seconds | | **Explore shader time** | A slider over a 30-second range in steps of 1/60 second | | **Previous shader frame (1/60 second)** and **Next shader frame (1/60 second)** | Step one frame | | **Extend shader exploration by 30 seconds** | Lengthen the slider's range by 30 seconds | | **Capture shader frame** | Save the visible pixels as a lossless PNG checkpoint | | **Shader sequence** | Open the shader sequence panel | Pausing, playing, and scrubbing are editing operations. They do not encode a PNG or write captured-frame assets. Live shaders target 60 FPS whatever the export settings are, and hidden or paused renderers stop drawing. Playback does not lengthen the slider's range. ### Capture a frame [#capture-a-frame] **Capture shader frame** stores two things together: a lossless PNG of the pixels on screen, and the editable material recipe with its native engine frame. Saved and duplicated captures display the PNG, so reopening a design does not depend on rendering the same GPU pixels on another device. The PNG is stored once in IndexedDB, keyed by its SHA-256 hash, and portable source embeds it in `CanvasDocument.assets`. A captured PNG must be smaller than 25 MB. If a saved PNG cannot be loaded, its preview stays marked as unavailable. Design Lab does not start a different live shader in its place. ### Seekable, stateful, and static materials [#seekable-stateful-and-static-materials] * **Seekable** materials render any requested time. These are the animated Paper materials, the Glyphfield originals, Prismatic sphere, and every Shaders.com material that is not stateful. * **Stateful** materials depend on earlier frames or on pointer input. These are Fluid Energy, the Interactive Shaders.com materials (Smoke, Ink Flow, Boids, Reaction Diffusion, and others), Particles, and Smoke Fill. They can be paused and captured, but a time value cannot reproduce them. Playing from a saved PNG starts a new simulation. * **Static** materials have no time range. These are the Paper Dot Grid, Fluted Glass, Halftone CMYK, Halftone Dots, Image Dithering, and Paper Texture families. `design.motion.describe` reports each shader layer's provider, motion model, PNG capture support, editable seek support, and loop behavior. A continuous animation is not a seamless loop of finite length. Prismatic sphere exposes a configured loop duration, and no material promises a pixel-exact loop. ## Shader sequences [#shader-sequences] A shader sequence turns one shader layer into a timeline of 8 to 12 materials. The first materials are intro cuts taken from a fixed list of 12 candidates, and the last is the layer's own material, which holds at the end. Cuts either accelerate from 1050 ms down to 280 ms or stay even at 620 ms each. The default is 10 materials, accelerating, with a 5-second final hold. | Control | Values | | ------------------------------------- | ------------------------------------------- | | **Background layer** | The shader layer the sequence replaces | | **Cuts** | 8 to 12 shaders | | **Final hold** | 3, 4, 5, or 6 seconds | | Pacing | **Accelerating** or **Even** | | **New cuts** | Rotates to another set of intro materials | | **Preview cuts** and **Stop preview** | Play the sequence on the canvas, or stop it | | **Export MP4** | Exports the sequence as MP4 | The timeline records the material IDs, the start and end time of each segment, the target shader layer, the sequence offset, and the paused frame. Preview, GIF, and MP4 use the same timeline. Stop the preview before saving, copying, exploring time, or exporting. The preview swaps materials temporarily and is not the saved composition. The panel's **Export MP4** exports the sequence as MP4. The Browser API exports it as GIF or MP4 with `design.export.shader-sequence.gif` and `design.export.shader-sequence.mp4`. ## Browser API [#browser-api] The Browser API is `window.glyphfield.studio`. These actions control shader time and sequences: | Action | Input | Output | | --------------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | | `design.frame.pause` | None | `null`. Pauses at once without writing assets | | `design.frame.play` | None | `null` | | `design.frame.seek` | `{ timeMs }`, a non-negative finite number | `null`. Rejected for stateful materials | | `design.frame.capture` | None | A portable CanvasDocument JSON string with the captured PNG assets | | `design.motion.describe` | None | `{ timeMs, paused, layers: [{ layerId, materialId, provider, motionModel, supportsPngSnapshot, supportsEditableSeek, loop }] }` | | `design.sequence.describe` | None | `{ durationMs, materials, settings }` | | `design.sequence.configure` | Partial settings: `cutCount` 8–12, `finalHoldMs` 3000–6000, `pace` (`accelerating` or `even`) | `null` | | `design.sequence.preview` | None | `null` | | `design.sequence.stop` | None | `null` | ```js const studio = window.glyphfield.studio; const motion = await studio.invoke('design.motion.describe'); const layer = motion.layers[0]; if (layer?.supportsEditableSeek) await studio.invoke('design.frame.seek', { timeMs: 1250 }); const source = await studio.invoke('design.frame.capture'); // Keep `source` with its CanvasDocument.assets outside the browser. ``` `design.frame.capture` rejects when storage, the renderer, or PNG encoding fails. It does not return a partial save. --- # UI captures Set a product screenshot at 16:9 on a shader ground as a new artboard, from a preset or any material, then export it like any other artboard. Canonical page: https://www.glyphfield.com/docs/studio/design-lab/captures Markdown: https://www.glyphfield.com/docs/studio/design-lab/captures.md A UI capture is a Design Lab artboard with two layers: a full-bleed shader ground and the screenshot centered on it. The screenshot's corners are rounded in its own pixels, so its shadow and border follow the corners. Both layers stay editable: change the ground in the Shader Library, or move, resize and restyle the screenshot like any image layer. ## Add a capture [#add-a-capture] Click **Capture** in the artboard bar and choose a PNG, JPEG or WebP screenshot. Design Lab adds a 1600 × 900 artboard named after the file, with the **Brand grain** ground, an inset of 10% of the height on every side, a 20 px corner radius and a soft shadow. On a dark ground the capture also gets a faint light edge, because a shadow cannot separate it there. The capture fits inside the inset at its own aspect ratio, and the artboard keeps at most twice the pixels it shows, so a 2x export stays sharp. Export it from the tool header like any artboard. [Export, saving, and source](/docs/studio/design-lab/export) covers formats and sizes. ## Presets [#presets] A preset names the ground: a material, a palette and settings. Brand presets build the ground around the active identity's accent color: the accent, a tint toward its highlight and a shade toward its ink. They read the identity when the capture is made. | Preset | Material | Palette | | ----------------------- | -------------------- | ----------------------------------------------------------------- | | `purple-grain` | Paper Grain Gradient | Fixed purple, matching the grain capy uses for its product stills | | `brand-grain` (default) | Paper Grain Gradient | Brand | | `brand-mesh` | Paper Mesh Gradient | Brand | | `brand-warp` | Paper Warp | Brand | | `brand-dither` | Paper Dithering | Brand | Any material from [`/api/materials`](/api/materials) can be a ground through the Browser API. ## Browser API [#browser-api] `design.capture` builds the artboard and makes it active, so `design.export` renders it next. `design.capture.presets` lists the presets, defaults and limits. ```js const studio = window.glyphfield.studio; await studio.selectTool('material'); const { artboardId, width, height } = await studio.invoke('design.capture', { image: screenshotBlob, // or 'data:image/png;base64,...' preset: 'purple-grain', width: 1920, }); const artifact = await studio.invoke('design.export', { format: 'png', download: false }); ``` | Field | Values | | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `image` | Required. A PNG, JPEG or WebP `Blob`, or a base64 data URL of one, under 24 MB | | `preset` | A preset id. Defaults to `brand-grain` unless `materialId` is set | | `materialId` | Any material id from `/api/materials`. Overrides the preset's material | | `palette` | `'brand'` or three `#RRGGBB` colors. The first is the ground's base. Overrides the preset's palette | | `settings` | Numeric ground settings: `amplitude`, `brightness`, `centerX`, `centerY`, `density`, `detail`, `frequency`, `grain`, `rotationX`, `rotationY`, `rotationZ`, `speed`, `strength`. Merged over the preset's | | `width` | 960–3840, rounded to a multiple of 16. Defaults to 1600. The height is always width × 9 / 16. It also sets the export width, so the next export is this size | | `padding` | 0–0.3 of the height on every side. Defaults to 0.1 | | `radius` | 0–96 artboard pixels. Defaults to 20 | | `shadow` | Defaults to `true` | | `name` | The artboard and layer name. Defaults to "UI capture" | The action rejects unknown fields, a `height`, an unknown preset or material, and malformed colors. It resolves `{ artboardId, width, height, materialId, preset }` once the artboard is shown. The ground renders live, so wait for the shader to be ready before a final export, as with any shader artboard. Design Lab cannot open a URL itself. To frame a live page, capture it with a browser you control (for example Playwright's `page.screenshot()`), then pass the bytes as `image`. --- # Export, saving, and source Export a Design Lab artboard as PNG, JPG, GIF, or MP4, save named checkpoints, share a project file, and edit the CanvasDocument source by hand. Canonical page: https://www.glyphfield.com/docs/studio/design-lab/export Markdown: https://www.glyphfield.com/docs/studio/design-lab/export.md Design Lab, the layered composition tool, exports the selected artboard. Loose canvas layers are not exported. Exporting while the loose canvas is active shows the message "Select an artboard to export. Loose canvas layers are saved in your project." The library, inspector, zoom controls, selection handles, and layer dock do not appear in an export. ## Export settings [#export-settings] The first click on **Export** in the tool header renders a PNG and opens the export review, which shows the file and the export settings. After that, **Export** reopens the review. The review shows the output size, and for motion it shows the frame count, duration, and frame rate. | Setting | Values | | --------------------------------------------- | -------------------------------------------------------------------------------------------------- | | Format | PNG (Transparent image), JPG (Smaller image), GIF (Looping motion), MP4 (Video) | | Size preset | Compact 640, Standard 960, Large 1280, or Full 1920 px wide. The height follows the artboard ratio | | **Custom width** (**Export width in pixels**) | 320–3840, in steps of 2 | | Quality | **Fast** (Quick preview), **Balanced** (Everyday export), **Best** (Most detail) | | **Duration** (GIF, MP4) | 1.2, 1.6, 2.4, or 4 seconds | | **Frame rate** (GIF, MP4) | 12, 15, 24, 30, or 60 FPS | | **GIF loop** | **Blended loop** or **Raw motion** | **Export size preset** in the tool header sets the width without opening the review, and it shows **Custom** for a width that matches no preset. Width and height are rounded to even numbers. The defaults are 960 px, Balanced, 1.6 seconds, 30 FPS, and Blended loop. Quality maps to these encoder settings: | Quality | JPG | GIF | MP4 | | -------- | ------------ | ---------------------------------------------------- | ----------------- | | Fast | Quality 0.82 | 64 colors, RGB444 palette, one palette for the clip | Medium bitrate | | Balanced | Quality 0.9 | 128 colors, RGB565 palette, one palette for the clip | High bitrate | | Best | Quality 0.96 | 256 colors, RGB565 palette, one palette per frame | Very high bitrate | MP4 uses H.264 when the browser can encode it and another MP4 codec otherwise. If no MP4 encoder is available, the export reports an error and does not produce a GIF in its place. Files are named `-design-lab-x.`. Shader sequence exports are named `-design-lab-shader-sequence-x.`, and their length comes from the sequence. ### What each format captures [#what-each-format-captures] * **PNG and JPG** freeze the frame that is visible when the export starts, then render the full composition at the output size. JPG composites transparency over the artboard's background color. * **GIF and MP4** sample motion forward from the current frame and restore the paused pose afterward. * Exports do not add captured-frame assets to IndexedDB and do not resume playback. * **Blended loop** records extra frames, crossfades the tail into the head, and checks that the last frame closes onto the first. It edits the end of the clip and does not find a native repeat period in the shader. **Raw motion** keeps the clip unmodified and can show a seam when it repeats. * Stateful materials such as Fluid Energy support exact still export. Motion export that samples them by timestamp is refused. * [Effect layers](/docs/studio/design-lab/effects) with image effects run at the full output size for every frame and need WebGPU. ### Resolution and readiness [#resolution-and-readiness] During an export, shader layers render at up to 8 times the device pixel ratio. The render is limited to an 8192 px edge, and each shader to the larger of 120,000 pixels and the export's pixel count. A shader that covers the artboard therefore renders at about the export resolution, and a smaller shader layer renders above its size on the artboard. The live preview quality setting does not affect exports. Export waits for materials, fonts, and images to be ready. Prismatic sphere waits for its environment lighting. If a resource does not load, the export reports a readiness timeout and does not export a placeholder. Text being edited on the canvas is committed before the export starts. A variable font with an optical size axis, such as Inter, draws its default optical size on the canvas and in exports, so zoom and export width never change the glyph shapes or line breaks. ## Saved designs and autosave [#saved-designs-and-autosave] The working draft autosaves while you edit. Named checkpoints are separate: * **Save checkpoint** creates a named checkpoint, or updates the selected one with **Save changes**. * **Saved designs** lists checkpoints and marks the **Current** one. Clicking the current row closes the picker and keeps your edits. * **Save as independent copy** (Clone) and **Save as linked copy** (Fork) create new checkpoints from the current edits and leave the original unchanged. A fork records its parent. * Each row has **Rename**, **Clone**, and **Delete**. Delete asks "Delete this checkpoint?" with **Cancel** and **Delete**. Rename with Enter or **Save name**, and discard a rename with Escape or **Cancel rename**. **Unsaved changes** means the working draft differs from the selected checkpoint. The draft itself can still be autosaved. A checkpoint stores the complete CanvasDocument: artboards and loose layers, dimensions and background, every layer's ID, kind, name, geometry, visibility, lock, opacity, and blend mode, text and typography, assets, order and groups, materials on content layers, shader settings, captured PNG references, native frame state, the shader sequence and timeline, and the export settings. Checkpoints and autosave are kept in IndexedDB in this browser. If loading fails, saving pauses while recovery retries, so an empty canvas cannot overwrite the previous design. A small recovery journal keeps work while IndexedDB is briefly unavailable. Clearing site data removes local work. Download a project file for an independent backup. ## Project files [#project-files] **File → Download project file** saves a `.glyphfield.json` file with every artboard, the loose canvas, embedded images, fonts, and captured shader frames. **File → Open project file** replaces the current workspace with a project file. **+ → Import project…** in the Studio project menu opens a project file as a new project. See [Project files](/docs/studio/project-files). ## Source format [#source-format] **File → Edit source code** shows the Design Lab source: a CanvasDocument with `schemaVersion: 2` and Design Lab metadata `sourceVersion: 4`. Start from `readSource()` instead of writing a document from memory. ```json { "schemaVersion": 2, "brandId": "gt", "capabilities": ["animation", "assets", "constraints", "guides", "history", "layers", "pages", "text"], "pageIds": [""], "pages": { "": { "width": 1600, "height": 900, "background": "#070707", "elementIds": ["shader-canvas-1", "logo-brand"] } }, "elements": {}, "assets": {}, "metadata": { "tool": "design-lab", "designLab": { "sourceVersion": 4, "ratio": "wide", "exportSettings": {}, "groups": [], "layerShaders": {}, "shaderSequence": {}, "timeline": {}, "workspace": { "activeArtboardId": "artboard-main", "activeSurfaceId": "artboard-main", "artboards": [], "canvas": {} } } } } ``` * `page.elementIds` is the layer order, back to front. * Element `kind` is `shader`, `effect`, `text`, `logo`, or `image`. Element `data` holds the layer settings and its `layerType`. * Layer IDs start with `shader-`, `effect-`, `text-`, `logo-`, or `asset-`. Group IDs start with `group-` and artboard IDs with `artboard-`. * Element bounds `x` and `y` are positions. For most layers, `width` and `height` are scale factors of the layer's default box. Effect layers always cover the artboard, and their bounds are the artboard's size in pixels. A rotated layer stores its angle in `bounds.rotation`. * Asset IDs are `brand-asset:` for identity assets and `resource:` for embedded files. Captured frames use `shader-frame:`. * `element.locked` records a lock. Effect layers store converter fields and, for an image effect, `effectId` and `effectProps`. * `metadata.designLab.workspace` stores the artboards and, in `canvas`, the loose-layer snapshot. `activeSurfaceId: "canvas"` means the loose canvas is being edited. An optional artboard `displayScale` keeps the on-canvas size of a framed selection and does not change the export size. * `metadata.designLab.identity` holds the typography snapshot of an imported project. * Shader elements may carry `frameState` (the editable native time recipe) and `frameSnapshot` (`{ version: 1, assetId, width, height }`, a lossless PNG in `assets`). A generated `design-sequence` document has `version: 3`. Applying it normalizes the active source to this format. See [Source formats](/docs/reference/source-formats). ## Browser API [#browser-api] The Browser API (`window.glyphfield.studio`) has these export and workspace actions: | Action | Input | Output | | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | | `design.export` | `{ format: 'png' \| 'jpg' \| 'gif' \| 'mp4', mode?: 'standard' \| 'shader-sequence', download?: boolean }` | `ExportPreviewAsset` with `blob`, `fileName`, dimensions, and format | | `design.export.png`, `.jpg`, `.gif`, `.mp4` | None | `ExportPreviewAsset` | | `design.export.shader-sequence.gif`, `.mp4` | None | `ExportPreviewAsset` | | `design.export.project` | None | `ExportPreviewAsset` with an `application/json` Blob, a `.glyphfield.json` file name, `format: 'JSON'`, and `previewKind: 'file'` | | `design.workspace.describe` | None | `{ activeSurface, canvas: { layerIds }, artboards: [{ id, name, x, y, width, height, layerIds }] }` | | `design.workspace.activate` | `{ target: 'canvas' \| artboardId }` | `null` | | `design.workspace.move` | `{ target: 'canvas' \| artboardId, layerIds, placement?: 'preserve' \| 'beside' }` | `null` | | `design.workspace.frameSelection` | None. Select loose layers first | `null` | `mode: 'shader-sequence'` is valid for GIF and MP4. Without `download: true` the action returns the Blob without saving it, and `studio.download(artifact)` saves it later. Run exports one at a time. ```js const studio = window.glyphfield.studio; if (studio.activeTool() !== 'material') throw new Error('Open Design Lab first.'); const artifact = await studio.invoke('design.export', { format: 'mp4', mode: 'shader-sequence' }); if (!(artifact.blob instanceof Blob) || artifact.blob.size === 0) throw new Error('The export is empty.'); studio.download(artifact); ``` `design.workspace.move` keeps world-space boxes, text layout, and appearance. IDs change only when the destination already has a layer with the same ID. `beside` places layers next to their source artboard when moving them to the canvas. Read the source again after a move. --- # Shader Library Browse, search, and filter the shared catalog of live materials, check each engine and its license, and tune the settings that Studio tools save. Canonical page: https://www.glyphfield.com/docs/studio/shader-library Markdown: https://www.glyphfield.com/docs/studio/shader-library.md The Shader Library is Glyphfield's shared catalog of live materials (animated shaders). Design Lab (the layered composition tool), Animation, Lottie, and the expression tools take their materials from it. Each tool stores a material by its ID and settings. This release lists 197 materials. `GET /api/materials` returns the current list, count, engines, controls, and defaults, so agents read the count from the endpoint. ## Where it appears [#where-it-appears] | Tool | Library form | Result of choosing a material | | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | | Design Lab | The full left sidebar | Adds a shader layer, replaces the material of the selected shader layer, or fills the selected text, mark, or image layer | | Animation | A compact browser for the base background (30 cards at a time), and a **Material** select for one scene's background | Sets the sequence background, or that scene's background | | Lottie | A **Material** select in the **Live material** section | Sets the canvas background behind the animation | | OpenGraph, Terminal card, Partnership lockup, Blog cover, Slide templates | A compact browser in the shader layer inspector (12 cards at a time) | Places the material's still thumbnail, with a **Tint** of **Original colors** or **Brand duotone** | Compact browsers have search, the look buttons, and the source and kind filters. **Show more shaders** adds another batch of cards. ## Browse and filter [#browse-and-filter] The Design Lab library header shows **Shader library** and the number of materials shown out of the total, for example `197 of 197 materials`. | Control | Behavior | | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | **Choose a random shader** | Picks a material from the filtered list | | **Search shaders** | Splits the query into words. Every word must appear in the material's name, description, engine name, look, or kind | | Look buttons | All, Fluid, Light, Metal, Gradient, Graphic. Each button shows its count for the current source and kind | | **Shader source filter** | All sources, or one engine: HoloCloth, Shaders.com studies, Design studies, WebGL Fluid, Glyphfield, Paper, ShaderGradient, Shaders.com WebGPU | | **Shader kind filter** | All kinds, Backgrounds (materials that fill an artboard), or Interactive (simulations that respond to the pointer) | | Cards | A static WebP thumbnail, the source badge, and the name. The selected card is marked | | **Load more shaders** | The list starts with 12 cards and adds 24 more each time the button scrolls into view or is clicked | Search matches substrings, so `interactive smoke` and `metal chrome` both work. Shaders.com descriptions end with their upstream category, so `Textures` and `Shape Effects` also work as search terms. ### Order [#order] The order is fixed: 1. Fourteen curated materials: Gem Smoke, Architectural Chrome, Electric Lines, Liquid Metal, Chrome Glares, God Rays, Warp, Dither gradient, Mesh gradient, Spectral Bloom, Radiant Void, Galactic Rings, Fluid Energy, and Holo Cloth. 2. The richer materials, highest quality score first. Prismatic sphere and Glyph field sit directly after Water · Abstract. 3. Simple patterns and the Paper filters that process a sample picture, highest quality score first. Examples are stripes, grids, spirals, dot grids, the halftones, and image dithering. Within the second and third groups, two presets of one Paper family do not appear next to each other when another material can go between them. ### Materials the library leaves out [#materials-the-library-leaves-out] * Shape primitives, plain fills, and raw noise. These are the Shaders.com shapes (Circle, Star, Polygon, Heart, and the others), Solid Color, Linear Gradient, Radial Gradient, Diamond Gradient, Thin Film, Studio Background, Image Texture, Text, the Perlin, Simplex, Wavelet, and Gabor noises, and the Paper Perlin Noise, Simplex Noise, and Waves families. * The Paper Static Mesh and Static Radial families. * The Shaders.com image effects. They transform the pixels beneath them, so Design Lab runs them on [Effect layers](/docs/studio/design-lab/effects#image-effects). `/api/materials` lists them under `imageEffects`. * The Shaders.com Group, VideoTexture, WebcamTexture, and HTMLInCanvas components. Browsing the library does not request camera access. A saved document that uses a material the library leaves out still loads and renders it. HTTP `design-sequence` requests accept only listed materials. ## Engines [#engines] | Source filter | Engine | License | Requirement | Listed materials | | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | Paper | [`@paper-design/shaders-react`](https://github.com/paper-design/shaders) 0.0.78 | Apache-2.0 | WebGL2 | 100 presets from the Paper families | | Shaders.com WebGPU | [`shaders`](https://github.com/shader-effects-inc/shaders) 4.0.1 | MIT | WebGPU | 70 materials: 40 Textures, 19 Shape Effects, 10 Interactive, and Lens Flare. IDs start with `shader-effects-` | | Glyphfield | Original GLSL and Canvas 2D | Glyphfield (MIT) | WebGL2. Glyph field uses Canvas 2D | Glyph field, Dither gradient, Mesh gradient, Grain gradient, Liquid Glass, Caustics, Iridescent Foil, Nebula, Silk Ribbons | | Shaders.com studies | Original GLSL | Glyphfield (MIT) | WebGL2 | Pixel Beams, Soft Register, Spectral Bloom, Pistons, Architectural Chrome, Chroma Flow, Drift, Mosaic, Circuit. IDs start with `shaders-` | | Design studies | Original GLSL | Glyphfield (MIT) | WebGL2 | Electric Lines, Chrome Glares, Relief Gradient, Orbit Gradient, Radiant Void, Galactic Rings | | HoloCloth | Original GLSL adapted from [HoloCloth](https://github.com/dmitrykurash/holocloth) | MIT | WebGL2 | Holo Cloth | | WebGL Fluid | A stable-fluids solver adapted from Pavel Dobryakov's [WebGL Fluid Simulation](https://github.com/PavelDoGreat/WebGL-Fluid-Simulation) | MIT | WebGL2 with half-float render targets | Fluid Energy | | ShaderGradient | [`@shadergradient/react`](https://www.npmjs.com/package/@shadergradient/react) 2.4.20 | MIT | WebGL2 | Prismatic sphere | The Shaders.com studies are original implementations of public Shaders.com techniques. The design studies are original implementations informed by the visual directions of Evil Rabbit Shaders, GRADIENTOOL, and Grainient. Glyphfield's original materials are 24 GLSL programs: the eight Glyphfield GLSL materials, the nine Shaders.com studies, the six design studies, and Holo Cloth. They blend palette colors in linear light, interpolate color ramps in OKLab, dither every frame before 8-bit output, and size patterns relative to the frame. A preview and a 4K export therefore show the same composition. Fluid Energy solves velocity on a coarse grid. The grid's short side grows with **Detail** from 96 to 224 cells, scaled by render quality. Each step runs 20 pressure iterations, and the simulation runs 150 steps before the first frame. Three moving emitters and the pointer add dye. ### Shaders.com WebGPU behavior [#shaderscom-webgpu-behavior] * Each material's code loads when the material is first used. All Shaders.com materials on a page share one GPU device. Rendering is capped at 30 FPS and at a device pixel ratio of 2. * Stateful materials (the Interactive group, Particles, and Smoke Fill) simulate 3 seconds before they first appear, so they open already developed. * Interactive materials follow a slow automatic cursor while the real pointer is elsewhere. Moving the pointer over the canvas takes control. The real pointer keeps control for 1.5 seconds after it stops moving. * Without WebGPU, the material shows its still thumbnail with the message "WebGPU is unavailable here. Showing a still preview." Still and motion exports refuse the material and do not export the thumbnail. ### Loading and replacing [#loading-and-replacing] Shaders.com and ShaderGradient materials load their engine code on demand. A library card starts that download when the pointer enters it or the card receives focus, so the material paints sooner when it is chosen. Paper and Glyphfield materials ship with the canvas and need no preload. When a live canvas switches to another material, the previous material stays on screen in a paused state until the new one has drawn its first frame. The old material then fades out over 160 ms. If the new material is not ready after 8 seconds, the old one fades out anyway. ### WebGL2 availability [#webgl2-availability] Paper, Glyphfield GLSL, Fluid Energy, and Prismatic sphere need WebGL2. Studio requests the WebGL2 context with `failIfMajorPerformanceCaveat`, so software rendering counts as unavailable. Without WebGL2, the canvas shows a placeholder named "Shader preview unavailable" and checks again every 2.5 seconds. A lost WebGL context is remounted after 350 ms, up to five times. After a 2.5-second cooldown the cycle can start again. Studio controls, source editing, and exports that do not need WebGL keep working. ## Shared controls [#shared-controls] Design Lab's shader inspector and the **Live material** controls map one set of settings onto every engine, and each engine interprets a setting in its own way. The **Live material** controls appear in Lottie and in an Animation scene's background. The Animation base background has its own shorter set, described on the [Animation](/docs/studio/animation) page. | Setting | Design Lab inspector | Live material controls | | ---------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | | Colors | **Base color**, **Mid color**, **Light color** | **Base color**, **Mid color**, **Light color** | | Palettes | The identity palette and 7 presets | The identity palette and 15 presets | | Quick look | None | 9 presets: Holo cloth, Quiet mesh, Polished chrome, Soft grain, Graphic dither, Spectral focus, Electric fluid, Deep glyph field, Kinetic signal | | Speed | **Shader speed** 0–1.5 | **Shader speed** 0–1.5 | | Frequency | 0.5–12 | 0.2–10 | | Strength | **Warp** 0–1.5 | **Strength** 0–2 | | Detail | 0.5–9 | 0.5–8 | | Grain | **Texture** 0–100 | **Grain** 0–100% | | Brightness | **Light** 0.35–1.6 | **Brightness** 0.1–2 | | Amplitude | 0–10 (under **Advanced**) | 0–8 | | Density | 0.1–2 (under **Advanced**) | 0.1–2 | | Rotation | **Rotation** −180° to 180° (Z only, under **Advanced**) | **Rotation X**, **Rotation Y**, **Rotation Z** 0°–360° | | Center | **Center X** and **Center Y** (Paper materials) | **Center X** and **Center Y** (Paper materials) | | Zoom | **Shader zoom** 0.1×–10× | None | The 15 palette presets are Monochrome chrome, Mercury, Ultraviolet, Signal lime, Copper heat, Arctic, Vermilion ink, Cobalt bloom, Signal axis, Signal terraces, Solar orbit, Mineral wave, Paper aperture, Ink dither, and Signal dither. Design Lab shows the first seven. A preset sets Base, Mid, and Light, and the colors stay editable afterward. `/api/materials` publishes the API ranges under `controls`. They match the **Live material** controls. Speed runs from 0 to 1.5 in every control because motion stops getting faster at 1.5. For Prismatic sphere, speed sets the radius of the sphere's loop path, up to 0.5. Shaders.com materials use the colors, speed, and zoom, plus their native controls. Strength, detail, frequency, grain, brightness, amplitude, density, and rotation do not apply to them, so Design Lab hides those sliders and the **Advanced** section for them. ## Native Shaders.com controls [#native-shaderscom-controls] Each Shaders.com material shows its upstream settings in **Effect settings**: colors, gradient stops, lights, positions, numeric ranges, switches, choices, and structured values. A setting that applies to one mode appears only when that mode is chosen. | Setting type | Behavior | | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Colors | Background and base colors take Base, the main color takes Mid, highlights take Light, and multi-stop gradients take all three. Materials with a built-in color scheme, such as Color Wheel and Ink Flow, start in their custom-color mode. A color changed in **Effect settings** is saved and replaces the palette color. **Reset effect settings** returns every setting to its default | | Speed | The shared **Shader speed** control sets playback speed, and each effect's own speed multiplier is hidden. Patterns that are still by default upstream, such as Chevron, move at a slow native rate so the speed control can animate them | | Surface | Shape Effects materials have a **Surface** choice that starts at **Full canvas**. Full canvas fits the native surface to the artboard's ratio and removes the upstream demo sphere. Neon, Light Edge and Obsidian render as one rounded panel inset from the artboard edges, so their lit rim stays visible. **Shape** restores the original geometry and its placement controls | | Structured values | Gradient stops and lights have their own editors, with up to 8 entries. Other structured values, such as shapes, use a JSON field | Settings are stored in `settings.effectProps`, which holds only changed values. `/api/materials` returns each material's `nativeControls` with defaults, choices, and ranges. A color control's `palette` field names the stop that seeds it: `base` is `settings.colorA`, `main` is `colorB`, `highlight` is `colorC`, and `ramp` or `lights` spread all three. Controls marked `hidden`, such as the native `speed`, are not shown. `shaderEffects.components` lists all 199 upstream components. ```json { "materialId": "shader-effects-aurora", "settings": { "speed": 0.3, "effectProps": { "intensity": 80, "colorA": "#A533F8", "colorB": "#22EE88" } } } ``` This is the `shader` part of a `design-sequence` request. Aurora's `colorA` and `colorB` are set explicitly, and its `colorC` follows the palette. ## Time and motion [#time-and-motion] Every tool stores shader time, pause state, zoom, colors, and settings in its document. Design Lab adds lossless frame captures and shader sequences, described in [Shaders and time](/docs/studio/design-lab/shaders). Each `/api/materials` record has a `motion` object: | Field | Meaning | | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | | `provider` | `paper`, `webgpu`, `fluid`, `shadergradient`, `custom-glsl`, or `canvas2d` | | `motionModel` | `procedural`, `direct-time`, `stateful`, or `static` | | `supportsPngSnapshot` | The material can be captured as a lossless PNG | | `supportsEditableSeek` | A time value reproduces the frame. It is `false` for stateful and static materials | | `loop.kind` | `continuous`, `static`, `configured` (Prismatic sphere), or `analytic-candidate` (three Paper Dithering presets). No material promises a pixel-exact loop | ## Source format [#source-format] | Tool | Where the material is stored | | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Design Lab | Shader elements, and `metadata.designLab.layerShaders` for materials on content layers: material ID, settings, opacity, blend mode, zoom, `frameState`, and `frameSnapshot` | | Animation | `metadata.animation.sequenceBackground`, with per-scene exceptions in `backgroundOverrides` | | Lottie | `metadata.studio.state.background`, with `materialId` and `materialSettings` | | Expression tools | A shader layer whose `data.materialId` names the material and whose asset is the material's still thumbnail | ## HTTP [#http] `GET /api/materials` returns `{ categories, kinds, shaderEffects, controls, count, defaults, engines, lookPresets, materials, framePersistence, palettes, schemaVersion, sharedBy, imageEffects }`. Each material has `id`, `name`, `description`, `engine`, `qualityScore`, `sourceLabel`, `sourceUrl`, `category`, `kind`, and `motion`. Shaders.com materials add `nativeControls`, `settingsKey: "effectProps"`, and `requiresWebGPU: true`. `defaults` names the default materials for Animation, the landing page hero, and new shader surfaces. Design Lab starts new compositions with Gem Smoke. Read material IDs from the endpoint instead of deriving them from display names. Several names appear under more than one engine, for example Chroma Flow, Nebula, Mesh Gradient, and Liquid Metal. `POST /api/generate` with `kind: "design-sequence"` accepts a listed material ID and its settings. The server returns a recipe, and Studio renders the pixels. ## Licensing [#licensing] Paper Shaders, the Shaders.com components, WebGL Fluid Simulation, and HoloCloth keep their own licenses. Their notices and the visual references for the original studies are in [Third-party notices](https://github.com/Kevin-Liu-01/Glyphfield/blob/main/THIRD_PARTY_NOTICES.md). ShaderGradient is an MIT-licensed npm dependency. The design studies are original implementations, and Glyphfield bundles no Evil Rabbit, GRADIENTOOL, or Grainient code or downloadable assets. When a material has an upstream project or visual reference, the inspector links to it. --- # Color tokens Edit the brand palette as a color system with OKLCH scales, light and dark roles, contrast checks, vision simulation and proportions, then copy it as tokens. Canonical page: https://www.glyphfield.com/docs/studio/colors Markdown: https://www.glyphfield.com/docs/studio/colors.md Color tokens (tool ID `colors`) is the Glyphfield Studio tool that edits the active brand identity's palette and everything derived from it. Changes write to the identity as pending changes, as they do in Typography and Brand identity. Select **Save changes** in the save notice to keep them, or switch to Brand identity and call `identity.save`. Every other tool reads the result, including the brand kit, the Component library and the Brand book. ## Layout [#layout] | Region | Contents | | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Tool header | **File** (**Advanced** → **Edit source code**), **Undo color** and **Copy tokens** | | Left sidebar | **Brand colors**: every palette color with its role, HEX value and share, the proportion bar, and **Add color** | | Canvas | The view buttons **Show Palette view**, **Show Roles view**, **Show Scales view**, **Show Contrast view**, **Show Vision view** and **Show Proportion view** | | Right sidebar | The selected color's sections | ## Palette [#palette] The library lists every palette color with its role, HEX value and share of the layout. The bar above it draws the shares in proportion. **Add color** appends a new color token. **Remove color** in the inspector deletes a token and every pairing, role override and scale setting that refers to it. Glyphfield tools read the IDs `ink`, `paper`, `muted` and `emphasis`, so these four can be edited but not removed. The last remaining color cannot be removed either. A new ID must match `^[a-z][a-z0-9-]{0,39}$`. The inspector edits the selected color: | Section | Controls | | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | **Color** | **Exact color**, the shared color control (HEX, OKLCH, hue and opacity), plus **Lightness** (0–100%), **Chroma** (0–0.4) and **Hue** (0–360°). Dragging previews live, and releasing commits one undo step. | | **Token** | **Name**, **Role**, the stable ID and **Remove color** | | **Share of layout** | **Proportion** (0–100%) | | **Tint and shade scale** | **Lightest step** (50–100%, default 97.5%), **Darkest step** (0–50%, default 22%), **Scale chroma** (0–200%, default 100%), **Hue shift** (−90° to 90°, default 0), **Keep the exact brand value as a step** (on by default) and **Reset scale** | | **Contrast check** | **Contrast color** picks another palette color. The result shows the WCAG verdict and the APCA Lc value. | | **Semantic role** | Shown when a role is selected in the Roles view. For each mode, a color and a step (**Brand value** or 50–950). `Derive from the palette` clears the override. | | **Export tokens** | The token preview in the format chosen in **Token format**, with **Copy these tokens** | **Undo color** restores the previous state, up to 40 steps. ## Views [#views] | View | Contents | | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Palette | The selected color as a surface on a paper, ink or grid backdrop with the brand logo, the tagline and a primary action; its HEX, OKLCH, WCAG and APCA values; its OKLCH scale; and every token as a tile. Selecting a tile opens the color editor on the canvas. Escape closes it. | | Roles | Light and dark product screens painted with the semantic roles, and a role table with each mode's color reference and failing checks | | Scales | Every color's eleven steps. For the selected color, a lightness and chroma chart and a table with HEX, L, C, H and the contrast on white and on black per step. | | Contrast | The palette matrix. Rows are text colors and columns are backgrounds. Each cell shows the WCAG ratio and grade or the APCA Lc. | | Vision | The palette under typical vision, protanopia, deuteranopia, tritanopia and achromatopsia; the product screens under the selected simulation; and the pairs that nearly merge | | Proportion | A 10 × 10 waffle chart of the shares, a slider per color, **Keep the total at 100%**, **Normalize to 100%** and **Apply 60 / 30 / 10** | ## OKLCH scales [#oklch-scales] Each palette color has a scale of eleven steps from 50 to 950. Lightness is spaced evenly in OKLCH between the lightest and darkest step, so neighboring steps look equally far apart. Chroma follows the brand color and tapers toward white and black. Each step is then gamut mapped to sRGB by reducing chroma only. With **Keep the exact brand value as a step** on, the step nearest the brand color's lightness is the brand HEX value itself, and the Scales view marks it with a dot. A color reference names a palette color or one of its steps, for example `ink` or `emphasis.300`. ## Semantic roles [#semantic-roles] Product surfaces read twelve semantic roles in light and dark mode: | Role | Use | | ---------------------------------------- | ------------------------------------------------------------------------ | | `background`, `surface`, `surface-muted` | The page canvas; cards, panels and inputs; quiet fills and table headers | | `foreground`, `foreground-muted` | Body text and icons; secondary text | | `border`, `focus` | Dividers and input borders; the keyboard focus outline | | `primary`, `primary-foreground` | Primary actions and selection; text on primary | | `positive`, `caution`, `negative` | Success, warning and error states | Roles are derived from the palette until you override them. Light mode uses the lighter of `ink` and `paper` as the background and the darker as text. Muted text is the quietest step of the darker color that still reaches 4.5:1 on the background. `positive`, `caution` and `negative` use the `success`, `warning` and `error` colors when the palette has them, each moved to its nearest step that reaches 3:1. Without them, `positive` and `caution` use the accent and `negative` uses the text color. Dark mode uses the lighter color as text. Its background is the darker color when that color's OKLCH lightness is 0.3 or less, and otherwise the step of the darker color nearest lightness 0.2. Dark mode moves the accent and status colors to their nearest steps that reach 3:1 on the dark background. Select a role in the Roles view to override it per mode with a palette color and step. `Derive from the palette` removes the override. Overrides are stored in the identity's `colorSystem.light` and `colorSystem.dark`. The Roles view checks every text role against its background at 4.5:1, and `primary`, `focus` and the status roles at 3:1. The role table shows the pairs that fail. ## Contrast and pairings [#contrast-and-pairings] Select a matrix cell to approve that pair for text. Approved pairs are the identity's `colorPairings`. A pair at 4.5:1 or more records level `AA`, a pair from 3:1 to 4.5:1 records `AA-large`, and a pair below 3:1 cannot be approved. Until you approve a pair, **Approved pairings** lists the brand's default pairs, and the first change turns them into declared pairings. Each approved pair has an editable usage, its live ratio, a remove button and, when the colors no longer reach the level, **Fix**. **Fix** changes the foreground color's HEX value. **Contrast metric** switches the matrix between **WCAG 2** and **APCA**. WCAG cells show AAA, AA, AA18 (large text only) or a dash. The brand health audit and the Brand book read the same pairings. APCA Lc uses APCA-W3 0.0.98G-4g. The matrix labels |Lc| of 75 or more as Body, 60 or more as Text, 45 or more as Large and 30 or more as Spot. ## Proportion [#proportion] Proportion is the share of a layout that each color covers. The check passes when the shares total 90–110%, the dominant color covers at least 45% and `emphasis` covers 20% or less. With **Keep the total at 100%** on, moving one slider rescales the others. **Apply 60 / 30 / 10** sets paper to 60, ink to 30, emphasis to 10 and every other color to 0. ## Vision [#vision] The Vision view simulates typical vision, protanopia, deuteranopia, tritanopia and achromatopsia with the Machado (2009) model at full severity. It lists the pairs that nearly merge: pairs whose OKLab distance falls below 0.06 under the simulation although they are at least 0.096 apart in typical vision. ## Tokens [#tokens] **Copy tokens** copies the format chosen in **Token format**: | Format | Contents | | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | OKLCH CSS | One `--color-` property per color in OKLCH with its opacity. The name is the color name with spaces replaced by hyphens. | | CSS variables | `--brand-color-*`, every scale step as `--brand-color--`, and the semantic roles as `--brand-` with dark values under `prefers-color-scheme`, `data-theme="dark"` and `.dark` | | Tailwind v4 | `@theme` colors and scale steps (`bg-ink-700`) plus semantic utilities (`bg-background`, `text-foreground`, `bg-primary`) that switch with the theme | | Design tokens (DTCG) | `color`, `palette` (the scales) and `semantic.light` and `semantic.dark` aliases | The CSS variables, Tailwind and DTCG output come from the same serializers as the brand kit. ## Browser API [#browser-api] The Browser API (`window.glyphfield.studio`) exposes these actions while Color tokens is the active tool: | Action | Input | Output | | --------------------------- | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | | `colors.tokens.read` | `{ format?: 'oklch-css' \| 'css' \| 'tailwind' \| 'dtcg' }` (default `oklch-css`) | The tokens as text | | `colors.tokens.copy` | The same as `colors.tokens.read` | The copied text | | `colors.contrast.read` | None | The full matrix with WCAG and APCA values, the approved pairings and the semantic checks | | `colors.pairing.toggle` | `{ foreground, background }` | The resulting `colorPairings`. Pairs below 3:1 are refused. | | `colors.semantic.read` | None | Every role in light and dark with its reference, HEX value, default and override flag | | `colors.scale.read` | `{ id? }` | The scale steps of one color, or of every color | | `colors.vision.read` | `{ mode?: 'normal' \| 'protanopia' \| 'deuteranopia' \| 'tritanopia' \| 'achromatopsia' }` (default `deuteranopia`) | `{ mode, colors, confusable }` | | `colors.proportion.balance` | None | Applies 60 / 30 / 10 and returns each color's proportion | Changes made through actions are pending identity changes. `identity.save` is available only while Brand identity is the active tool, so select **Save changes** to keep changes made here. ## Source [#source] **File** → **Edit source code** shows version 2: ```json { "version": 2, "colors": [{ "id": "ink", "name": "Ink", "role": "Primary type", "hex": "#181818", "opacity": 100, "proportion": 30 }], "colorPairings": [{ "foreground": "ink", "background": "paper", "level": "AA", "usage": "Body text" }], "colorSystem": { "light": { "primary": "emphasis" }, "dark": { "primary": "emphasis.300" }, "scales": [{ "id": "emphasis", "chroma": 90 }] } } ``` `colors` is the whole palette in order. Scale settings must stay within `chroma` 0–200, `darkest` 0–0.5, `hueShift` −90 to 90 and `lightest` 0.5–1. Omitting `colorPairings` or `colorSystem` keeps the current values and drops references to removed colors. Version 1 sources (`{ colors: [{ hex, id, name, opacity, role }] }`) still apply. A field missing from a version 1 color keeps the value of the color at the same index. Opacity is a setting of this tool and is not stored in the identity. Earlier versions of this tool kept edited colors in a separate draft that did not reach the brand. When such a draft exists and differs from the brand, the tool offers **Apply earlier edits** and **Discard**. ## Keyboard shortcuts [#keyboard-shortcuts] Escape closes the color editor that a tile opened. The shared color control commits the HEX and OKLCH fields on Enter or when the field loses focus. ## HTTP [#http] Color tokens has no HTTP route of its own. `POST /api/brand/kit` renders the CSS, Tailwind and DTCG files from an identity, and `POST /api/generate` reads identity colors from its `identity` object. ## Limits [#limits] * 40 undo steps. * The four core IDs and the last color cannot be removed. * Semantic role checks appear here and in `brand.md`. They are not part of the brand health score. --- # Typography Edit the brand type system with four roles, a modular scale and variable font axes, check specimens, wrapping and licenses, and copy the type tokens. Canonical page: https://www.glyphfield.com/docs/studio/typography Markdown: https://www.glyphfield.com/docs/studio/typography.md Typography (tool ID `typography`) is the Glyphfield Studio tool that edits the active brand identity's four type roles (Display, Body, Accent and Code) and its modular type scale. Changes write to the identity as pending changes. Select **Save changes** in the save notice to keep them, or switch to Brand identity and call `identity.save`. ## Layout [#layout] | Region | Contents | | ------------- | ----------------------------------------------------------------------------------------------------------------------------------- | | Tool header | **File** (**Advanced** → **Edit source code**) and **Copy type tokens** | | Left sidebar | **Typography roles**: the four roles in their own faces with family, scale step, size and weight, and **Add font file to identity** | | Canvas | The view buttons **Show Specimen view**, **Show Scale view**, **Show Pairing view**, **Show Wrap view** and **Show Fonts view** | | Right sidebar | The selected role's sections | ## Roles [#roles] **Add font file to identity** stores an OTF, TTF, WOFF or WOFF2 file with the identity. The family name comes from the file name. "Bold" in the name sets weight 700, and "italic" sets the italic style. No license is recorded, so add one in [Brand identity](/docs/studio/brand-settings#typography). The inspector edits the selected role: | Section | Controls | | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Typeface** | **Font family** (a stored font file or an upright font Glyphfield ships, such as any Katagami member; choosing a shipped font stores it with the identity), **Preview size** (10 px up to 44 for Display, 30 for Body, 36 for Accent and 24 for Code), **Weight** (100–550 in steps of 25), **Line height** (0.7–2) and **Tracking** (−8 to 12 px). Dragging a slider previews live, and releasing commits the change. | | **Variable axes** | The axes read from the font file. When the font has an optical size axis (`opsz`), **Size optical axis automatically** keeps optical sizing automatic. Turn it off to set a fixed **Optical size**. When the font has a slant axis (`slnt`), **Slant** sets the angle. A font without these axes says so. | | **Type scale** | **Base size** (10–24 px), **Named ratio** (Minor second, Major second, Minor third, Major third, Perfect fourth, Augmented fourth, Perfect fifth or Golden ratio), **Ratio** (1.067–1.8) and the scale step of the selected role | | **Specimen** | **Sample text**, alignment (Left or Center) and **Measure** (30–90 characters) | | **Role guidance** | The guidance below for the current roles, and **Apply recommended tracking** | | **Type tokens** | The type section of the brand tokens as CSS variables, a Tailwind v4 theme or DTCG JSON, with **Copy type tokens** | The axes are read in the browser. A WOFF2 file needs a browser that can decode Brotli, and a WOFF file needs `DecompressionStream` with deflate. Otherwise the axes show as not readable. ## Modular scale [#modular-scale] Each size is `basePx × ratio^step` across nine steps. The default is a 16 px base and a 1.25 ratio. The steps are caption (−2), small (−1), body (0), lead (1), h4 (2), h3 (3), h2 (4), h1 (5) and display (6). The named ratios run from the minor second (1.067) to the golden ratio (1.618). By default Display is set at `display`, Body at `body`, Accent at `lead` and Code at `small`. Any role can move to another step, which is stored in `typeScale.roleSteps`. The Scale view shows every step at its size with the roles set on it. Select a step to set the selected role there, or pick a ratio from the chips. ## Guidance [#guidance] Typography checks every role at its scale size. Display sizes are 28 px and larger, and the Code role always counts as text. | Check | Rule | | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Leading | The recommended range is 0.95–1.15 for display sizes and 1.4–1.7 for text. A warning starts below 0.85 or above 1.25 for display sizes, and below 1.35 or above 1.8 for text. | | Tracking | Display sizes take slight negative tracking, −0.01 to −0.025 em. A warning starts below −0.035 em or at any positive value, and a note appears above −0.005 em. Text sizes use 0, with a warning beyond ±0.01 em. Code is flagged below −0.005 em. | | Measure | 45–75 characters per line for body text | | Scale | Warnings for a base below 14 px or a Display role less than 1.5 times the body size. Notes for a ratio below 1.125 or above 1.5. | | Weight | Body text below weight 300 | **Apply recommended tracking** sets −0.02 em on display-size roles and 0 on text roles whose tracking breaks the rule. ## Views [#views] | View | Contents | | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Specimen | The selected role at its preview size as an editable specimen, every role on one line, the weights of the family, and a typing meter (words per minute, words, characters and seconds). Typing in any line edits the same sample. | | Scale | The modular scale with sizes in px and rem and the roles set on each step | | Pairing | The roles together on one surface (Display on the primary color, Body, the alphabet and numerals, and Code), then every display face in the brand paired with the body face, each with a `Use for Display` button | | Wrap | The headline and lead at 320, 480 and 680 px with `text-wrap` set to `wrap`, `balance` or `pretty` | | Fonts | Every font file with the roles that use it, its weight range, its variation axes, its license and its source. A file without a recorded license is marked. | ## Browser API [#browser-api] The Browser API (`window.glyphfield.studio`) exposes these actions while Typography is the active tool: | Action | Input | Output | | -------------------------- | -------------------------------------------- | --------------------------------------------------------------------------------------- | | `typography.tokens.read` | `{ format?: 'css' \| 'tailwind' \| 'dtcg' }` | The type tokens as text | | `typography.tokens.copy` | The same as `typography.tokens.read` | The copied text | | `typography.scale.read` | None | The base, the ratio, the ratio name, each step in px and rem, and the step of each role | | `typography.guidance.read` | None | The guidance list for the current roles, scale and measure | | `typography.axes.read` | None | Each role's font file and its axes, or `null` when the file cannot be read | ## Source [#source] **File** → **Edit source code** shows version 2: ```json { "version": 2, "typography": [{ "role": "Display", "family": "Rasmus Inter", "fontId": "inter-variable", "weight": 500, "lineHeight": 0.98, "letterSpacing": -1.2, "opticalSize": 32 }], "typeScale": { "basePx": 16, "ratio": 1.333, "roleSteps": { "Display": "h1" } }, "specimen": { "sampleText": "Every language. One source.", "align": "left", "measure": 64, "previewSizes": { "Display": 40, "Body": 24, "Accent": 32, "Code": 18 } } } ``` Roles merge by `role`. The source can set `family`, `fontId`, `weight`, `lineHeight`, `letterSpacing`, `usage`, `opticalSize` and `slant`. Fields the source omits keep their current values. Other fields of the identity's role are kept, and roles the identity does not have are ignored. `opticalSize` is 6–144 and `slant` is −20 to 20. `opticalSize: null` and `slant: null` remove a fixed axis. `typeScale.basePx` must be 10–24 and `typeScale.ratio` 1.067–1.8. A version 1 source (`{ typography: [...] }`) still applies and leaves the scale and specimen unchanged. ## Kerning and type tokens [#kerning-and-type-tokens] Specimens render with `font-kerning: normal` and the `kern` feature. Optical sizing follows the size unless a role fixes `opsz`. The type tokens carry the same settings: * `--brand-font-kerning`, `--brand-font-feature-settings` and `--brand-font-optical-sizing`. * Each role's `--brand-font--size` and its tracking in em relative to that size, for example `--brand-font-display-tracking: -0.02em`. A role keeps its tracking at any size. * In Tailwind, each step's `--text---letter-spacing` uses the same em values. * `--brand-font--variation` and `--brand-font--style` appear when a role fixes an axis. ## Keyboard shortcuts [#keyboard-shortcuts] Typing in a specimen line edits the shared sample. **Clear specimen and restart typing meter** clears the sample and resets the typing meter. ## HTTP [#http] Typography has no HTTP route of its own. `POST /api/brand/kit` renders the type tokens with the rest of the kit, and `POST /api/generate` embeds the identity's font files in template SVGs. ## Limits [#limits] * Weights display up to 550. * Font files are limited to 2.5 MB when they are added through Brand identity or `identity.font.add`. * Axes are read from TTF, OTF, WOFF and WOFF2 files in browsers that can decompress them. --- # Expression tools Edit the layered documents behind OpenGraph, Terminal card, Partnership lockup, Blog cover and Slide templates, and export them as PNG, SVG or PDF. Canonical page: https://www.glyphfield.com/docs/studio/templates Markdown: https://www.glyphfield.com/docs/studio/templates.md OpenGraph, Terminal card, Partnership lockup, Blog cover and Slide templates are the five expression tools. They make finished brand artifacts such as social images, code cards, co-brand lockups, blog covers and slide decks. All five share one editor and one document format. Each tool starts from a brand template built from the active identity (the brand identity of the open project): its colors, type roles, logos, graphic device, products, proof and voice. Everything on the artboard is a layer that you can select, move, restyle or delete. ## Tools [#tools] | Tool | ID | Default format | Layouts | Page | | ------------------ | ------------- | ---------------------- | --------------------------------------------------------------------------------- | ----------------------------------------------------- | | OpenGraph | `opengraph` | `opengraph` 1200 × 630 | `split`, `statement`, `media` (Full bleed), `centered`, `editorial` | [OpenGraph](/docs/studio/opengraph) | | Terminal card | `terminal` | `opengraph` 1200 × 630 | `card`, `split`, `focus`, `caption` | [Terminal card](/docs/studio/terminal-card) | | Partnership lockup | `partnership` | `lockup` 1200 × 600 | `lockup`, `centered`, `hero` (Hero lockup), `announcement` | [Partnership lockup](/docs/studio/partnership-lockup) | | Blog cover | `blog` | `opengraph` 1200 × 630 | `editorial`, `feature` (Feature image), `statement`, `centered`, `ledger` (Index) | [Blog cover](/docs/studio/blog-cover) | | Slide templates | `slides` | `16x9` 1600 × 900 | 14 layouts, chosen per slide | [Slide templates](/docs/studio/slide-templates) | Each built-in identity sets its own default layout and page surface for each tool. ## Formats [#formats] | Social format ID | Size (px) | Slide format ID | Size (px) | | ---------------- | ----------- | --------------- | ----------- | | `opengraph` | 1200 × 630 | `16x9` | 1600 × 900 | | `wide` | 1600 × 900 | `4x3` | 1600 × 1200 | | `square` | 1080 × 1080 | `square` | 1200 × 1200 | | `portrait` | 1080 × 1350 | | | | `story` | 1080 × 1920 | | | | `linkedin` | 1200 × 627 | | | | `lockup` | 1200 × 600 | | | OpenGraph, Terminal card, Partnership lockup and Blog cover use the social formats. Slide templates uses the slide formats. **Format** re-flows every page into its current layout at the new size. Layers that you added move and scale with the page. ## Editor layout [#editor-layout] | Region | Contents | | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Tool header | **Save checkpoint**, the **Saved designs** picker, the save status, **File** (**Edit source code**), **More exports** (**Export SVG**, plus **Export PDF deck** in Slide templates) and **Export PNG** | | Left sidebar | **Slides** (Slide templates only), **Add** and **Layers** | | Canvas | The artboard in the shared canvas viewport, with zoom controls, **Undo**, **Redo** and **Action history** | | Right sidebar | The tool's own sections (such as **Content**, **Surface**, **Source** or **Partner**), the sections of the selected layer, then **Format and layout** | **Format and layout** holds **Format**, one button per layout, **Page surface** and **Reset to brand template**. Slide templates chooses layouts in its **Slide library** section instead. ## Type, spacing and logos [#type-spacing-and-logos] Every template sizes type from one modular scale per format with a ratio of 4:3. The body size is √(width × height) × 0.0176 for slides and √(width × height) × 0.0212 for social formats. Social images get the larger share because people often see them as small thumbnails. | Step | 1600 × 900 slide | 1200 × 630 social image | | -------- | ---------------- | ----------------------- | | caption | 16 px | 14 px | | body | 21 px | 18 px | | lead | 28 px | 25 px | | subhead | 38 px | 33 px | | headline | 50 px | 44 px | | title | 67 px | 58 px | | hero | 89 px | 78 px | * Template tracking follows the size: −0.022 em at title size and larger, −0.018 em at headline size, −0.014 em at subhead size, −0.008 em at lead size and 0 at body size and smaller. Uppercase text gets half of these values, and code keeps 0. Templates set tracking to 0 or a negative value. The **Tracking** slider in the inspector accepts −10% to +20%. * Text renders with kerning on (the `kern` feature). When a font has an optical size axis, the axis follows the font size. The canvas, the inline text editor, SVG and PNG use the same settings. * A 16:9 slide title is 6–8% of the slide height (67 px on a 1600 × 900 slide). Headlines on content layouts stay at or below 6% of the height. Tests in `src/lib/__tests__/expressionType.test.ts` check these limits. * Templates have no kicker, eyebrow, brand-name or issue labels above headlines. Metadata such as the website, the page number, a metric's label or a comparison side goes in the footer or after its content. * Logos are sized by the ink they show. Each bundled logo file carries a measured ink box. A mark's height falls as its width grows (height ∝ aspect^−0.4), so a square monogram and a long wordmark carry similar visual weight. ## Edit on the canvas [#edit-on-the-canvas] * Click a layer on the canvas or in **Layers** to select it. Shift-click, ⌘-click or Ctrl-click adds a layer to the selection or removes it. ⌘/Ctrl + A selects every unlocked layer on the page. Escape clears the selection. * Drag a layer to move it. Within 6 screen pixels, the layer snaps to the artboard edges and center and to the edges and centers of other layers. Guides show each match. * Drag an edge or corner handle to resize a layer. To rotate a layer, use the **Rotation** slider (−180° to 180°) or the buttons that rotate it by 15° in the **Layer** section. * Arrow keys nudge the selected layer by 1 px. Shift + arrow nudges it by 10 px. * To type on the canvas, double-click a text layer or select it and press Enter. Escape or a click outside the text ends editing. * Delete or Backspace deletes the selection. ⌘/Ctrl + D duplicates it with a 24 px offset. With one layer selected, ⌘/Ctrl + ] moves it forward and ⌘/Ctrl + \[ moves it backward. Add Shift to move it to the front or the back. * To open the selection menu, right-click a layer or focus it and press Shift + F10. * ⌘/Ctrl + Z undoes and Shift + ⌘/Ctrl + Z redoes while the pointer is over the canvas or the canvas has focus. History keeps 120 steps. Repeated edits to the same property within 900 ms count as one step, so a drag or a burst of typing undoes at once. **Layers** lists the stack with the top layer first. To restack, drag a row by its handle, or focus the row and press Alt + ↑ or Alt + ↓. Each row has a button that hides the layer and a button that locks it. A locked layer cannot be selected or moved on the canvas. Select its row in **Layers** to edit it in the inspector. The page background starts locked, so a click on the page selects the content on top of it. ## Add layers [#add-layers] **Add** has one button per layer kind: **Text**, **Image** (an image from the identity library), **Logo**, **Shape**, **Divider**, **Shader** (a shader background), **Texture** and **Device** (a brand device). **Upload image layer** adds a local image file. Shader and texture layers go directly above the page background, below the content. A shader layer shows the captured still of its material from the Shader Library (Glyphfield's catalog of shader materials), so the canvas and the export match. Brand devices are generated graphics in the identity's colors: `greetings` (Language field), `beam` (Knowledge beam), `waves` (Utility wave), `ledger` (Savings ledger), `horizon` (Network horizon), `convergence` (Convergence field), `field` (Programmable field), `window` (Focus window) and `interruption` (Engineered interruption). ## Inspector [#inspector] | Section | Controls | | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Layer** | **Name**, X, Y, W, H, **Rotation** (−180° to 180°) with 15° rotate buttons, **Layer opacity**, **Hidden**, **Locked**, bring forward, send backward, **To front**, **To back**, six alignment buttons, **Duplicate layer** and **Delete layer** | | **Text** | **Text**, **Type role** (Display, Body, Accent or Code), **Text size** 8–400 px, **Text weight** 100–550, **Tracking** −10% to +20%, **Line height** 70–240%, **Color**, text alignment, **Casing** (As typed, Uppercase or Lowercase), **Vertical** (Top, Middle or Bottom), **Shrink to fit the box** and **Upload layer font** | | **Image** | **Library image**, **Replace image**, **Fit** (Fill frame, Fit inside or Stretch), **Treatment** (Natural, Monochrome, Duotone or Brand duotone), **Image zoom** 50–300%, **Image horizontal** and **Image vertical** −100% to 100%, and **Corner radius** 0–200 px | | **Logo** | **Logo artwork**, **Replace logo artwork**, **Tone** (Original colors or a brand color) and **Logo effects** (invert, dither, outline and shadow) | | **Shape** | **Shape** (Rectangle, Ellipse or Line), **Fill**, **Stroke**, **Stroke width** 0–24 px and, for rectangles, **Corner radius** 0–400 px | | **Shader** | **Tint** (Original colors or Brand duotone) and a compact Shader Library with search and filters that shows 12 materials at a time | | **Texture** | **Pattern** (Grid, Dots, Lines, Diagonal or Noise), **Color** and **Texture spacing** 4–160 px | | **Brand device** | **Device** | | **Code window** | **Theme** (Brand dark, Brand light or Classic dark), **Chrome** (File tabs, Window or None), **Line numbers**, **Code size** 9–48 px, **Code line height** 100–240% and **Window radius** 0–64 px | | **Chart** | **Values · comma separated**, **Labels · comma separated** and **Bars** | When several layers are selected, the **Selection** section offers the six alignment buttons, **Duplicate selection** and **Delete selection**. Color fields list the identity's color roles (ink, paper, muted, emphasis, success, warning, progress and error, where the identity defines them) and **Custom color…**, which opens the shared color picker. A layer that uses a role stays linked to the identity. When that identity color changes, the layer changes with it. ## Layouts [#layouts] A layout button re-flows the layers that the template placed. Text, uploads and styles that you set by hand stay. Content that the new layout has no slot for is kept and returns when you switch back. **Reset to brand template** rebuilds the document from the identity's template at the current format, and you can undo it. ## Export [#export] | Action | Result | | ---------------------------------- | ------------------------------------------------------------------------------------------ | | **Export PNG** | The active page rendered as SVG and rasterized at 2×, with the long edge capped at 4800 px | | **More exports → Export SVG** | The active page as a self-contained SVG with its images and font files embedded | | **More exports → Export PDF deck** | Slide templates only: every slide in one PDF | PNG and SVG files are named `studio-.png` and `studio-.svg`. In Slide templates, slides after the first add a two-digit slide number, for example `studio-slides-02.png`. Exports render from the same document as the canvas. ## Source format [#source-format] Each tool stores its work as a CanvasDocument schema 2 (Glyphfield's portable document format) with expression source version 2. Each page is an artboard, and Slide templates has one page per slide. Elements are layers. Each template layer has a `data.slot` role, and its colors are brand roles. `metadata.studio` holds `{ sourceVersion: 2, toolId, state }`. `state` holds the format, each page's layout and surface, the text that a layout set aside, and flat `title`, `body`, `code` and `language` fields. The flat fields mirror the first page's headline, its list or supporting copy, and its code. Editing a flat field in source updates the layer it mirrors. Applying source rejects a document of another tool or kind and a document with a newer `sourceVersion`. Text layers need a `textStyle`, and code layers need at least one tab. Library assets embedded as data URLs are pointed back at the identity's files. Version-1 sources (the flat tool state from before the shared editor) migrate when you open or apply them. See [Source format reference](/docs/reference/source-formats). ## Browser API [#browser-api] The Browser API (`window.glyphfield.studio`) gives every expression tool these actions. `{tool}` stands for `opengraph`, `terminal`, `partnership`, `blog` or `slides`. | Action | Input | Output | | -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `{tool}.document.describe` | None | `{ format, formats, layouts, activePageId, selection, pages: [{ id, index, name, layout, surface, width, height, notes, layers }] }`. Layers are listed top first with `id`, `name`, `kind`, `component`, `slot`, `content` (text layers), `bounds`, `hidden` and `locked` | | `{tool}.layer.add` | `{ kind: 'text' \| 'image' \| 'logo' \| 'shape' \| 'divider' \| 'shader' \| 'texture' \| 'device', pageId?, content?, bounds?, fill?, libraryAssetId?, dataUrl?, fileName?, materialId?, device?, shape?: 'rect' \| 'ellipse', variant?: 'mark' \| 'wordmark' }` | `{ id }` | | `{tool}.layer.update` | `{ id, name?, content?, bounds?, opacity?, hidden?, locked?, fill?, fontRole?, fontSize?, fontWeight?, letterSpacing?, lineHeight?, align?, casing?, radius?, data? }` | `null` | | `{tool}.layer.remove`, `{tool}.layer.select` | `{ ids }` | `null` | | `{tool}.layer.duplicate` | `{ ids }` | `{ ids }` | | `{tool}.layer.reorder` | `{ id, to: 'forward' \| 'backward' \| 'front' \| 'back' \| number }` | `null` | | `{tool}.layer.align` | `{ ids, alignment: 'left' \| 'horizontal-center' \| 'right' \| 'top' \| 'vertical-center' \| 'bottom' }` | `null`. Aligns to the artboard | | `{tool}.format.set` | `{ format }` | `null` | | `{tool}.layout.apply` | `{ layout, pageId? }` | `null` | | `{tool}.template.reset` | None | `null` | | `{tool}.history.undo`, `{tool}.history.redo` | None | `true`, or `false` when there is nothing to undo or redo | | `{tool}.export.png`, `{tool}.export.svg` | None | The export artifact of the active page | `layer.update` clamps `fontSize` to 4–1200, `fontWeight` to 100–550, `letterSpacing` to −0.2 to 0.5 em, `lineHeight` to 0.6–3, `opacity` to 0–1 and `radius` to 0–2000. `align` is `left`, `center` or `right`. `fill` is a color role, a `#RRGGBB` value or `none`. Call `document.describe` first. It returns the layer IDs, slots, formats and layouts that the other actions take. Each tool page lists the extra actions of that tool. ```js const studio = window.glyphfield.studio; const doc = await studio.invoke('opengraph.document.describe'); const headline = doc.pages[0].layers.find((layer) => layer.slot === 'headline'); await studio.invoke('opengraph.layer.update', { id: headline.id, content: 'Ship every locale', fontRole: 'Display' }); await studio.invoke('opengraph.format.set', { format: 'square' }); const png = await studio.invoke('opengraph.export.png'); studio.download(png); ``` ## HTTP [#http] `POST /api/generate` with `kind: "template"` renders the same brand templates as a standalone SVG with the brand fonts embedded. `template` is `slides` (the default), `blog`, `partnership`, `opengraph` or `terminal`. Each request renders one page. The SVG leaves out any font whose data URL is longer than 560,000 characters. The [Generation API](/docs/agents/generate#templates) lists the optional fields, such as `layout`, `slideLayout`, `format`, `title` and `body`. --- # OpenGraph Make social preview images in seven formats from the identity's headline, proof and graphic device, then export them as PNG or SVG. Canonical page: https://www.glyphfield.com/docs/studio/opengraph Markdown: https://www.glyphfield.com/docs/studio/opengraph.md OpenGraph (tool ID `opengraph`) makes social preview images, the cards that appear when a link is shared. It is one of the [expression tools](/docs/studio/templates) and starts from the brand template of the active identity. The default Split layout holds the identity's headline, its promise as supporting copy, a proof chip, the brand mark and a media panel. The media panel shows the identity's graphic device or photograph. General Translation gets its language field, Stripe its programmable field, Ramp its campaign photograph and Tailwind CSS its utility wave. ## Content controls [#content-controls] * **Content** has **Headline**, **Typography role** and **Font weight** (100–550) for the headline layer. * **Surface** switches the page between **Base white** and **Base dark**. Text and marks switch with it. Each identity sets its default surface, and General Translation starts on its dark ink color. **Page surface** in **Format and layout** accepts any brand color role. * Split and Full bleed have a media panel. **Add supporting image** replaces the panel with a local image. **Identity evidence** picks an image from the identity library, and its **Brand device** option returns the panel to the generated device. * **Replace logo** uploads a new mark, and **Brand logo asset** picks one from the identity. Select the logo layer to reach **Logo effects** (invert, dither, outline and shadow). * **Add font file** loads a local font file for the headline. Every layer is also editable on the canvas. See [Expression tools](/docs/studio/templates). ## Formats and layouts [#formats-and-layouts] OpenGraph uses the seven social formats: `opengraph` 1200 × 630, `wide` 1600 × 900, `square` 1080 × 1080, `portrait` 1080 × 1350, `story` 1080 × 1920, `linkedin` 1200 × 627 and `lockup` 1200 × 600. | Layout | ID | Arrangement | | -------------- | ----------- | ------------------------------------------------------------------------------------- | | **Split** | `split` | Copy beside the media panel. Tall formats stack the panel above the copy | | **Statement** | `statement` | The wordmark, one large headline and a ruled footer with the website and a proof line | | **Full bleed** | `media` | The media panel behind the headline, with a dark scrim | | **Centered** | `centered` | Wordmark, centered headline, supporting copy and website | | **Editorial** | `editorial` | A large headline from the top edge and a ruled footer with the wordmark and website | ## Export [#export] **Export PNG** renders the artboard at 2×, which is 2400 × 1260 px for the default format. **More exports → Export SVG** downloads a self-contained SVG. For the social images of the deployed Glyphfield site itself, see [Social previews](/docs/reference/social-previews). ## Browser actions [#browser-actions] | Action | Use | | --------------------------------------------------------------------------------------------------------- | ------------------------------------ | | `opengraph.export.png` | PNG of the artboard at 2× | | `opengraph.export.svg` | Self-contained SVG | | `opengraph.document.describe` | Format, layouts, pages and layers | | `opengraph.layer.add` / `opengraph.layer.update` / `opengraph.layer.remove` / `opengraph.layer.duplicate` | Layer edits | | `opengraph.layer.reorder` / `opengraph.layer.select` / `opengraph.layer.align` | Stack order, selection and alignment | | `opengraph.format.set` / `opengraph.layout.apply` / `opengraph.template.reset` | Format, layout and template | | `opengraph.history.undo` / `opengraph.history.redo` | History | Agents can also fill labelled controls, for example `studio.set('Headline', 'Ship every locale')`. [Expression tools](/docs/studio/templates#browser-api) describes the inputs and outputs of the shared actions. ## HTTP [#http] `POST /api/generate` with `{ kind: 'template', template: 'opengraph', layout?, format?, title?, body? }` returns the same template as an SVG. `body` fills the supporting copy on layouts that have it. See [Generation API](/docs/agents/generate#templates). --- # Terminal card Make brand-themed code windows with file tabs, highlighted lines and wrapped long lines, then export them as PNG or SVG. Canonical page: https://www.glyphfield.com/docs/studio/terminal-card Markdown: https://www.glyphfield.com/docs/studio/terminal-card.md Terminal card (tool ID `terminal`) renders a code window in the identity's code font, with a color theme built from the identity's colors. It is one of the [expression tools](/docs/studio/templates). Each built-in identity starts with code from its own product, for example a `gt-next` component for General Translation, a PaymentIntent for Stripe, a Worker for Cloudflare, `docs.json` for Mintlify and utility classes for Tailwind CSS. A custom identity starts from the code snippet saved in its identity when it has one. Otherwise it starts from a `brand.ts` file with the identity's name, tagline and accent color. ## Content controls [#content-controls] | Section | Controls | | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Content** | **Card title** edits the title layer. **Language** sets the language of the active tab: TypeScript, TSX, JavaScript, Python, Bash, JSON, HTML or CSS | | **Source** | One button per file tab, a button that adds a tab and a button that removes the active tab. **Tab name** renames the active tab, the **Terminal source code** field edits its code, and **Highlighted lines · e.g. 2, 4-6** takes line numbers and ranges | | **Typography** | **Title font**, **Title weight**, **Code font** and **Code weight** | | **Brand asset** | **Card background** places an identity or proof image behind the card at 14% opacity. **Asset opacity** changes the opacity | The add button names a new tab `file-N` and gives it the language of the current tab. A new TypeScript, Python or Bash tab starts with the General Translation sample for that language, and a tab in another language starts empty. A window keeps at least one tab. If the active tab still holds one of the three General Translation samples, switching its language to TypeScript, Python or Bash loads the sample for that language. Code that you edited stays as it is. Highlighted lines get a tinted band and an accent rule at the left edge. ## Code window [#code-window] Select the code window to reach its inspector section: **Theme** (Brand dark, Brand light or Classic dark), **Chrome** (File tabs, Window or None), **Line numbers**, **Code size** (9–48 px), **Code line height** (100–240%) and **Window radius** (0–64 px). * In the two brand themes, token colors come from the identity's color roles. Each token color is mixed toward the text color until it reaches a contrast of 4.5:1 against the window, or 3:1 for comments and punctuation. Classic dark uses a fixed palette. * Long lines wrap inside the window after a space or a punctuation mark. A continuation row is indented two spaces past the line's own indent and has no line number. A highlighted line keeps its band across all of its rows. * Code shrinks only when the wrapped code is taller than the window, and it stops at 80% of its set size. * Templates set the code size between the format's body and lead sizes, which is 18 to 25 px on a 1200 × 630 card. ## Layouts and formats [#layouts-and-formats] | Layout | ID | Arrangement | | ----------- | --------- | ------------------------------------------------------------------ | | **Card** | `card` | A title row above a window that fills the rest of the card | | **Split** | `split` | The title beside the window. Tall formats stack them | | **Focus** | `focus` | The window alone, with a small footer for the wordmark and website | | **Caption** | `caption` | The window above a caption | Terminal card uses the seven social formats listed in [Expression tools](/docs/studio/templates#formats). ## Export [#export] **Export PNG** renders the card at 2×. **More exports → Export SVG** downloads a self-contained SVG with the code font embedded. ## Browser actions [#browser-actions] | Action | Use | | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------- | | `terminal.export.png` / `terminal.export.svg` | Export | | `terminal.tab.add` / `terminal.tab.select` / `terminal.tab.update` / `terminal.tab.remove` | File tabs, code, language and highlighted lines | | `terminal.document.describe` | Format, layouts, pages and layers | | `terminal.layer.add` / `terminal.layer.update` / `terminal.layer.remove` / `terminal.layer.duplicate` | Layer edits | | `terminal.layer.reorder` / `terminal.layer.select` / `terminal.layer.align` | Stack order, selection and alignment | | `terminal.format.set` / `terminal.layout.apply` / `terminal.template.reset` | Format, layout and template | | `terminal.history.undo` / `terminal.history.redo` | History | The tab actions edit the code window on the active page. `terminal.tab.add` takes `{ name?, language?, code? }` and returns `{ tabId }`. Its defaults are the name `file-N.ts`, the language `typescript` and the sample code for TypeScript, Python or Bash. The new tab becomes the active tab. `terminal.tab.select` and `terminal.tab.remove` take `{ tabId }`. `terminal.tab.update` takes `{ tabId, name?, language?, code?, highlight? }`, where `highlight` is a list of 1-based line numbers. `studio.set('Terminal source code', 'const ok = true;')` edits the active tab. The source document keeps flat `code` and `language` fields that mirror the active tab of the first code window. See [Expression tools](/docs/studio/templates#browser-api) for the shared actions. ## HTTP [#http] `POST /api/generate` with `{ kind: 'template', template: 'terminal', layout?, language?, title?, body? }` renders the card as an SVG. `body` is the code, up to 4000 characters. See [Generation API](/docs/agents/generate#templates). --- # Partnership lockup Lock up the brand with one or more partners using optical sizing, separators and alignment rules, then export the lockup as PNG or SVG. Canonical page: https://www.glyphfield.com/docs/studio/partnership-lockup Markdown: https://www.glyphfield.com/docs/studio/partnership-lockup.md Partnership lockup (tool ID `partnership`) makes co-brand lockups. It is one of the [expression tools](/docs/studio/templates). The partner lockup is one layer that holds the logo of the active brand and any number of partners. A partner is a logo or a written name. Logos come from the identity's proof assets, the other built-in identities, the Northstar sample partner or an uploaded file. The template starts with the identity's own proof partner. When the identity has no proof asset to use, the template uses the written placeholder "Partner". Optical sizing balances partners by the ink they show. Bundled logos carry a measured ink box, so empty space inside a logo file does not make that partner look smaller. ## Content controls [#content-controls] | Section | Controls | | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Content** | **Title** and two headline type controls named after the identity's short name, for example **GT headline font** and **GT headline weight** for General Translation | | **Partner** | **Partner**, **Partner treatment** (Use logo or Write name), then **Lockup name** for a written partner or **Replace partner logo** for a logo. **Partner headline font**, **Upload partner headline font** and **Partner headline weight** style the partner's name in the headline and in a written lockup. **Lockup spacing** sets the gap on each side of a separator, 0–160 px | | **Lockup** | One row per extra partner with its own artwork picker, upload and remove button. **Add partner** adds the next partner that is not in the lockup yet, and **Add written partner** adds a written name. The alignment rules follow | When the headline still reads "Brand × Partner" with the current names, choosing another partner updates the headline to match. ## Alignment rules [#alignment-rules] | Control | Options | | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Separator** | ×, +, /, **Rule** (a thin vertical line, `\|`) or **None** | | **Sizing** | **Optical balance** (the default) gives every mark the same visual area, so a square mark and a long wordmark carry equal weight. **Equal height** and **Equal width** are also available | | **Alignment** | **Start**, **Center** or **End** places the lockup in its box | | **Vertical** | **Center**, **Top** or **Baseline** aligns the marks. **Baseline** aligns their bottoms (`bottom` in the API) | | **Logo color** | **One color** (`mono`, the default) recolors the marks to the text color. **Original colors** (`original`) keeps their artwork colors | The lockup scales down to fit its box. ## Layouts and formats [#layouts-and-formats] | Layout | ID | Arrangement | | ---------------- | -------------- | ------------------------------------------------------------ | | **Lockup** | `lockup` | The lockup at the top, the headline above the footer | | **Centered** | `centered` | The lockup in the middle with the headline below it | | **Hero lockup** | `hero` | A large lockup alone, with the website in the footer | | **Announcement** | `announcement` | A large headline above a rule, with the lockup at the bottom | The default format is `lockup` (1200 × 600). The other social formats listed in [Expression tools](/docs/studio/templates#formats) also apply. ## Export [#export] **Export PNG** renders the lockup at 2×. **More exports → Export SVG** downloads a self-contained SVG with the partner logos and fonts embedded. ## Browser actions [#browser-actions] | Action | Use | | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `partnership.export.png` / `partnership.export.svg` | Export | | `partnership.partner.add` / `partnership.partner.remove` | Partners | | `partnership.lockup.update` | Separator, sizing, alignment, gap and tone | | `partnership.document.describe` | Format, layouts, pages and layers | | `partnership.layer.add` / `partnership.layer.update` / `partnership.layer.remove` / `partnership.layer.duplicate` | Layer edits | | `partnership.layer.reorder` / `partnership.layer.select` / `partnership.layer.align` | Stack order, selection and alignment | | `partnership.format.set` / `partnership.layout.apply` / `partnership.template.reset` | Format, layout and template | | `partnership.history.undo` / `partnership.history.redo` | History | The partner actions edit the lockup on the active page. * `partnership.partner.add` takes `{ partnerId?, kind?: 'logo' | 'text', label? }` and returns `{ id }`. Without `partnerId`, it adds the next partner that is not in the lockup yet. A text partner uses `label`, or "Partner" when `label` is missing. * `partnership.partner.remove` takes `{ id }`. It does not remove the brand (`brand`) or the last entry. * `partnership.lockup.update` takes `{ separator?: '×' | '+' | '/' | '|' | 'none', sizing?: 'optical' | 'height' | 'width', justify?: 'start' | 'center' | 'end', verticalAlign?: 'center' | 'top' | 'bottom', gap?, tone?: 'original' | 'mono' }`. `gap` accepts 0–400. Values outside these lists are rejected. See [Expression tools](/docs/studio/templates#browser-api) for the shared actions. ## HTTP [#http] `POST /api/generate` with `{ kind: 'template', template: 'partnership', partnerId?, partnerLogoDataUrl? }` renders the lockup as an SVG. `partnerId` is a proof asset ID of the identity, another built-in identity ID or `template-northstar`. See [Generation API](/docs/agents/generate#templates). --- # Blog cover Make editorial blog covers from the identity's voice, with feature images, background images and textures, then export them as PNG or SVG. Canonical page: https://www.glyphfield.com/docs/studio/blog-cover Markdown: https://www.glyphfield.com/docs/studio/blog-cover.md Blog cover (tool ID `blog`) makes editorial covers for blog posts. It is one of the [expression tools](/docs/studio/templates). The headline starts as the first voice phrase of the identity, or its tagline when it has no voice phrases. No layout places a label above the headline. ## Layouts [#layouts] | Layout | ID | Arrangement | | ----------------- | ----------- | -------------------------------------------------------------------------------------------------------- | | **Editorial** | `editorial` | The mark alone at the top, the headline anchored above the footer | | **Feature image** | `feature` | The headline beside a library image or the brand device. Tall formats stack the image above the headline | | **Statement** | `statement` | One large headline, a short emphasis bar and the wordmark | | **Centered** | `centered` | The mark, a centered headline and the footer | | **Index** | `ledger` | The wordmark above a rule, the headline and a ruled footer | General Translation and Starter default to Editorial, Basement defaults to Statement, and the other built-in identities default to Feature image. ## Content controls [#content-controls] * **Content** has **Title**, **Typography role** and **Font weight** (100–550) for the headline. * **Surface** chooses **Base white**, **Base dark**, **Grid** or **Noise**. Grid and Noise set the page to the identity's paper color and add a texture layer that you can restyle or delete. * **Add background image** uploads a local image, and **Brand background asset** picks one from the identity library. Either one places a full-page image behind the copy at 28% opacity. **Background image opacity** changes the opacity. * **Page surface** in **Format and layout** accepts any brand color role. Every layer is also editable on the canvas. See [Expression tools](/docs/studio/templates). Blog cover uses the seven social formats listed there. ## Export [#export] **Export PNG** renders the cover at 2×, which is 2400 × 1260 px for the default format. **More exports → Export SVG** downloads a self-contained SVG. ## Browser actions [#browser-actions] | Action | Use | | ------------------------------------------------------------------------------------- | ------------------------------------ | | `blog.export.png` / `blog.export.svg` | Export | | `blog.document.describe` | Format, layouts, pages and layers | | `blog.layer.add` / `blog.layer.update` / `blog.layer.remove` / `blog.layer.duplicate` | Layer edits | | `blog.layer.reorder` / `blog.layer.select` / `blog.layer.align` | Stack order, selection and alignment | | `blog.format.set` / `blog.layout.apply` / `blog.template.reset` | Format, layout and template | | `blog.history.undo` / `blog.history.redo` | History | See [Expression tools](/docs/studio/templates#browser-api) for the inputs and outputs of these actions. ## HTTP [#http] `POST /api/generate` with `{ kind: 'template', template: 'blog', layout?, format?, title?, texture?, backgroundImageDataUrl? }` renders the cover as an SVG. See [Generation API](/docs/agents/generate#templates). --- # Slide templates Build brand slide decks from 14 layouts with speaker notes and slide numbers, then export a slide as PNG or SVG or the whole deck as one PDF. Canonical page: https://www.glyphfield.com/docs/studio/slide-templates Markdown: https://www.glyphfield.com/docs/studio/slide-templates.md Slide templates (tool ID `slides`) builds slide decks. It is one of the [expression tools](/docs/studio/templates). A new deck has five slides built from the identity: 1. A title slide with the tagline as the title and the promise as the subtitle. 2. An agenda of the identity's strategy pillars. 3. A proof slide. It shows the identity's figures as metrics, or its customer logos as a proof wall, or a statement when it has neither. 4. A quote in the identity's voice. 5. A closing slide with the wordmark and website. ## Slides [#slides] The **Slides** section lists every slide with its number and a live thumbnail. Click a slide to edit it. **Add slide** inserts a slide after the current one in the layout chosen in **New slide layout** (Statement by default). **Duplicate slide**, **Move slide up**, **Move slide down** and **Delete slide** act on the current slide. To reorder, drag a thumbnail, or focus it and press Alt + ↑ or Alt + ↓. Each slide has its own layout. The **Slide library** section applies one of 14 layouts to the current slide. Each layout ID is the lowercase layout name. | Layout | ID | Content | | ---------- | ------------ | -------------------------------------------------------------------------- | | Title | `title` | A title and a subtitle. The subtitle is left out when it repeats the title | | Section | `section` | A section number and a headline | | Agenda | `agenda` | Up to 5 numbered items | | Split | `split` | A headline beside an image or the brand device | | Metrics | `metrics` | Up to 3 proof figures with labels, or a proof wall | | Quote | `quote` | A line in the brand voice with an attribution | | Timeline | `timeline` | Up to 4 steps on a line | | Statement | `statement` | One large centered statement | | Comparison | `comparison` | The identity's challenge beside its promise | | Process | `process` | Up to 4 steps | | Chart | `chart` | A bar chart beside a figure or the promise | | Team | `team` | Up to 3 people as initials in circles with names | | Image | `image` | A headline beside a framed image or the brand device | | Closing | `closing` | The wordmark, a closing line and the website | Metrics and Chart use the identity's numeric proof. An identity with fewer than two figures gets a proof wall on Metrics instead. The proof wall shows the identity's customer logos as one lockup, or its customer names in the display face, or its proof claims as a ruled list. Chart shows the identity's first figure beside the bars, or its promise when it has no figure. The chart's **Values · comma separated** and **Labels · comma separated** fields start with placeholder data for every identity (Q1 to Q5 with 42, 68, 55, 88 and 100), so replace them with real figures. Comparison labels its two panels at their foot with "Before" and "With" followed by the identity name. Switching layouts keeps the slide's text. The headline, list items, metrics and labels move into the new layout. Text that the new layout has no place for comes back when you switch again. ## Content controls [#content-controls] * **Content** has **Title**, **Typography role** and **Font weight** (100–550) for the headline of the current slide. * **Body or list · one item per line** sets the list items of agenda, timeline, process, comparison and team slides. * **Speaker notes** are stored with the slide. * **Surface** chooses **Base white**, **Base dark**, **Grid** or **Noise** for the current slide. **Add background image**, **Brand background asset** and **Background image opacity** place and fade an image behind it. Any text layer can show slide numbers with `{page}` and `{pages}`, for example `{page} / {pages}`. Both numbers are padded to two digits. Templates put the wordmark at the top left, the website at the bottom left and the slide number at the bottom right. The closing slide has the wordmark and website only. ## Type rules [#type-rules] Slides follow the shared type scale in [Expression tools](/docs/studio/templates#type-spacing-and-logos). On a 16:9 slide, a title is 6–8% of the slide height (67 px on 1600 × 900), and content headlines stay at or below 6% (50 px). Display text has negative tracking, kerning is on, and no layout has a label above its headline. ## Formats and export [#formats-and-export] Formats are `16x9` (1600 × 900), `4x3` (1600 × 1200) and `square` (1200 × 1200). A format change re-flows every slide. * **Export PNG** renders the current slide at 2×. * **More exports → Export SVG** downloads the current slide as an SVG. * **More exports → Export PDF deck** renders every slide at 2× into one PDF. Each page is a lossless, Flate-compressed image placed at 0.75 pt per pixel, so a 16:9 slide becomes a 1200 × 675 pt page. The PDF leaves out the speaker notes. The file is `studio-slides.pdf`. ## Browser actions [#browser-actions] | Action | Use | | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | | `slides.export.png` / `slides.export.svg` | Export the current slide | | `slides.export.pdf` | Export every slide as one PDF | | `slides.slide.add` / `slides.slide.duplicate` / `slides.slide.move` / `slides.slide.remove` / `slides.slide.select` | Deck management | | `slides.document.describe` | Format, layouts, slides and layers | | `slides.layer.add` / `slides.layer.update` / `slides.layer.remove` / `slides.layer.duplicate` | Layer edits | | `slides.layer.reorder` / `slides.layer.select` / `slides.layer.align` | Stack order, selection and alignment | | `slides.format.set` / `slides.layout.apply` / `slides.template.reset` | Format, layout (with an optional `pageId`) and template | | `slides.history.undo` / `slides.history.redo` | History | * `slides.slide.add` takes `{ layout?, index? }` and returns `{ pageId }`. The default layout is `statement`, and the default position is after the current slide. The new slide becomes the current slide. * `slides.slide.duplicate` takes `{ pageId? }` (default: the current slide) and returns `{ pageId }`. * `slides.slide.move` takes `{ pageId, index }`. * `slides.slide.remove` and `slides.slide.select` take `{ pageId }`. A deck keeps at least one slide. `slides.export.png` and `slides.export.svg` export the current slide. To export another slide, select it first. See [Expression tools](/docs/studio/templates#browser-api) for the shared actions. ## HTTP [#http] `POST /api/generate` with `{ kind: 'template', template: 'slides', slideLayout?, format?, title?, body? }` renders one slide as an SVG. `body` fills the list items, one per line. See [Generation API](/docs/agents/generate#templates). --- # Component library Build 36 product components from the brand tokens, review every state in light and dark mode, and copy their code as React with Tailwind or HTML with CSS. Canonical page: https://www.glyphfield.com/docs/studio/components Markdown: https://www.glyphfield.com/docs/studio/components.md Component library (tool ID `buttons`) is the Glyphfield Studio tool that builds the active brand identity's product interface from its tokens: the semantic color roles, the fonts, the corner radius and a density. Each component shows a live demo that works with the keyboard, each of its states, light and dark mode, and the code to ship it. ## Components [#components] The library has 36 components in 10 families. `components.list` returns each component's `id`. | Family | Components | | ------------ | ------------------------------------------------------------------------------------------------------------------------------- | | Actions | Buttons (primary, secondary, outline, ghost and destructive), icon buttons, and button groups (a segmented control and a pager) | | Forms | Inputs with hints, icons and validation; textareas with a character count; selects; checkboxes; radios; switches; uploaders | | Navigation | Navigation bar, sidebars, tabs with arrow-key navigation, breadcrumbs and pagination | | Feedback | Alerts for every status, toasts, progress and steps, badges and empty states | | Data display | Tables with status and tabular numbers, stats and a bar chart | | Cards | Product and content cards, and testimonials | | Overlays | Command menu, modals, sheets, popover menus and tooltips | | Messaging | An inbox with a reading pane, and comments with a composer | | Commerce | Pricing and checkout | | Content | Article body and metadata | Content comes from the identity: its products, proof, audiences, voice, domain and contact email. **Label** sets the primary action, and **Supporting copy** sets the descriptions. ## States [#states] Each component lists the states that apply to it and shows them next to the live demo: Default, Hover, Focus visible, Pressed, Selected, Disabled, Loading and Error. Their IDs are `default`, `hover`, `focus`, `active`, `selected`, `disabled`, `loading` and `error`. The state replicas use the same markup and CSS as the demo with the state forced. **Disabled state** disables the live demo too. ## Settings [#settings] | Section | Controls | | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Content** | **Label** and **Supporting copy** | | **System** | **Follow brand defaults**, **Component size** (Small, Default, Large), **Density** (Compact, Comfortable, Spacious), **Surface mode** (Base, or Soft for the muted surface behind components), **Corner radius** (0–32 px), **Border width** (0–4 px), **Elevation** (None, Soft, Strong) and **Disabled state** | | **Color system** | Ten colors for a custom palette: **Canvas**, **Surface**, **Text**, **Accent**, **Accent text**, **Muted surface**, **Muted text**, **Border**, **Success** and **Danger** | | **Typography** | **Font role**, **Font weight** (100–550), **Text scale** (70–140%) and **Letter spacing** (−6% to 12%) | | **Shared media** | **Shared asset** (an identity image, excluding PDF files) and **Asset opacity** (0–100) | With **Follow brand defaults** on, the density, radius, font and the light and dark colors come from the identity. Changing the density, radius, font or a color turns it off. The theme switch in the canvas toolbar shows light, dark or both. Light and dark use the identity's semantic roles (see [Color tokens](/docs/studio/colors#semantic-roles)). With a custom palette, dark mode inverts it: the **Text** color becomes the canvas and the **Surface** color becomes the text. Slider changes update the preview's CSS custom properties directly, without re-rendering the components. ## Code [#code] The code panel generates two files from the same settings as the preview: | Format | Files | | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | React + Tailwind | `.tsx` with Tailwind CSS v4 utilities (`bg-primary`, `text-foreground`, `rounded-brand`, and state variants such as `hover:`, `focus-visible:`, `aria-invalid:` and `peer-checked:`), and `theme.css` with the semantic roles for light and dark, the fonts and the radius | | HTML + CSS | `.html` with `gf-*` classes, and `components.css` with the same tokens as CSS custom properties and the component rules for every state. For example, Switches produce `toggles.html` and Modals produce `dialogs.html`. | The tokens come from the same serializers as the brand kit. Generated code shows the component's default state, and the **Disabled state** setting does not apply to it. The `caution` color always comes from the identity, even with a custom palette. The component root sets `font-kerning: normal` and automatic optical sizing. **Copy code** in the header copies both files, and each file also has its own copy button. ## Accessibility [#accessibility] Controls are native elements with labels: * Inputs are labeled with `for`. * Switches use `role="switch"` and `aria-checked`. * Tabs use `role="tablist"` and move with the arrow keys, Home and End. * Dialogs and sheets use `aria-modal` and labeled titles. * The focus ring uses the brand's `focus` role. State replicas are inert, so keyboard focus stays in the live demo. ## Browser API [#browser-api] The Browser API (`window.glyphfield.studio`) exposes these actions while Component library is the active tool: | Action | Input | Output | | ---------------------- | ------------------------------------------ | ------------------------------------------------------------------ | | `components.list` | None | `[{ id, label, family, description, states }]` for every component | | `components.code.read` | `{ pattern?, format?: 'react' \| 'html' }` | `{ pattern, files: [{ name, language, code }] }` | | `components.code.copy` | The same as `components.code.read` | The copied text: every file, each headed by its file name | `pattern` is a component ID. Both inputs default to the selected component and code format. ## Source [#source] **File** → **Edit source code** shows version 2 with `pattern`, `family`, `label`, `supportingCopy`, `disabled`, `size`, `density`, `radius`, `borderWidth`, `elevation`, `surface`, `theme`, `codeFormat`, `useBrandDefaults`, `colors` (the ten custom colors), `typography` (`role` and `weight`), `textScale`, `letterSpacing` and `asset` (`id` and `opacity`). `family` must match the component. Numbers are clamped: `borderWidth` to 0–4, `radius` to 0–32, `letterSpacing` to −6 to 12, `textScale` to 70–140, `typography.weight` to 100–900 (displayed up to 550) and `asset.opacity` to 0–100. Version 1 sources still apply, and `surface: "inverse"` becomes `theme: "dark"`. Settings saved by earlier versions, one draft per field, are migrated the first time the tool opens. ## Related tools [#related-tools] Brand elements contains composed product applications that you configure one at a time, such as a navigation bar, a hero, a pricing card, a command menu, a modal, a toast, a data table, a checkout card and a settings panel. Use the Component library to build and review the system, and use Brand elements for one composed application and its brief. The Studio's own editing interface is also built from shared components. [Shared editor components](/docs/studio/editor-systems) describes them, and [Source code editing](/docs/studio/source-editing) describes the shared source drawer. ## HTTP [#http] The Component library has no HTTP route. `POST /api/generate` with `kind: "element-brief"` returns briefs for the product elements in Brand elements. ## Limits [#limits] * Font weights display up to 550. * Generated code shows the default state. --- # Source code editing Read, edit and apply the JSON source document of any Studio tool in the source drawer or through the Browser API without breaking its layers or assets. Canonical page: https://www.glyphfield.com/docs/studio/source-editing Markdown: https://www.glyphfield.com/docs/studio/source-editing.md Every Studio tool keeps a JSON source document behind its visual controls. **File → Edit source code** opens that document in a drawer beside the canvas. The Browser API (`window.glyphfield.studio`) reads and applies the same document with `readSource()` and `applySource()`. A valid edit updates the state that the inspector, the canvas, autosave and export use. An invalid edit changes nothing. ## Source drawer [#source-drawer] **Edit source code** is disabled while a tool is still preparing its source. The source editor loads the first time you open a drawer, so the drawer appears after a short delay on that first open. Later drawers open at once. 1. Choose **File → Edit source code**. 2. Edit the JSON. 3. Choose **Apply code**, or press ⌘/Ctrl + Enter or ⌘/Ctrl + S. 4. Read any error in the drawer. An error leaves the artifact unchanged. 5. Check the canvas, then continue visually, save or export. | Control | Action | | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Apply code** | Validate and apply the draft. The button is disabled while the JSON does not parse, and it reads **Applied** after a successful apply | | **Reset** | Replace the draft with the current source of the tool | | **Copy** | Copy the draft to the clipboard | | **Format** (Shift + Alt + F) | Reformat the JSON | | **Find and replace** (⌘/Ctrl + F) | Open the find bar. Enter and Shift + Enter step through matches, as do **Previous match** and **Next match**. **Replace** changes the current match and **All** changes every match | | **Clean paste** | Appears when the draft contains rich-text spaces, and replaces them with standard JSON spaces | | **Jump to top-level section** | Move the cursor to a top-level key | | **Close source editor** (Escape) | Close the drawer. When the find bar is open, Escape closes the find bar first | The editor indents with Tab and outdents with Shift + Tab, keeps the indentation on Enter, and inserts the closing bracket or quote when you type an opening one. Pasted text has its rich-text spaces replaced automatically. The toolbar shows the cursor line and column, the line count and the size of the draft. Drag **Resize source code editor** to set the drawer width from 360 to 880 px. You can also focus the handle and use the arrow keys or Home and End. Shift + arrow moves in larger steps. This browser remembers the width. ## Browser API [#browser-api] ```js const studio = window.glyphfield.studio; const { source, toolId } = studio.describe(); if (!source.read || !source.apply) throw new Error(`${toolId} does not expose source.`); const current = JSON.parse(studio.readSource()); // Change only the intended fields and keep every unknown field. await studio.applySource(current); const after = JSON.parse(studio.readSource()); ``` `applySource` accepts a JSON string or an object. It resolves after the tool accepts the document and two animation frames pass. Image decoding, font loading, shader compilation and encoding can take longer, so wait for the preview before you capture it. The source adapter is registered while the tool is active, even when the drawer is closed. ## Source documents by tool [#source-documents-by-tool] | Tool | Document | | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | | Brand identity | The complete `BrandIdentity` | | Brand elements | `glyphfield.brand-element` version 2: `elementId` and the settings that differ from the identity defaults | | Moodboard | `glyphfield.moodboard` version 2: boards, tiles and export settings | | Brand book | `glyphfield.brand-book` version 1: section order and visibility, and the visibility, layout, surface, image and copy of each page | | Animation | CanvasDocument schema 2 with `metadata.tool: "animation-studio"` and the sequence in `metadata.animation` | | Lottie | CanvasDocument schema 2 with the Lottie state in `metadata.studio`. Raw Lottie JSON can also be pasted | | Design Lab | CanvasDocument schema 2 with Design Lab metadata source version 4 | | OpenGraph, Terminal card, Partnership lockup, Blog cover, Slide templates | CanvasDocument schema 2 with expression source version 2, with one page per artboard or slide | | Color tokens | Version 2: palette, `colorPairings`, `colorSystem` and the opacity of each token | | Typography | Version 2: type roles, `typeScale` and specimen settings | | Component library | Version 2: pattern, content, system, palette, typography, theme and code format | The [source format reference](/docs/reference/source-formats) lists the fields and validation rules of each document. ## Safe edits [#safe-edits] `readSource()` returns the current, migrated document with stable IDs, asset references, layer order, saved frame and timeline values, and tool metadata. Examples leave out fields that later versions add, so an edit that starts from the current source keeps marks in place, keeps the layer order and keeps newer settings. * Start from the document that `readSource()` returns. Do not build a CanvasDocument from an old example. * Keep element IDs when you change content or style. * Keep unknown fields, metadata and assets. * Change state through `applySource()` or the visible controls. Writing to `localStorage` or IndexedDB directly skips validation. * Apply a document only to the tool it came from. Expression tools reject a document of another tool or kind. * Check the canvas or an export after you apply. A successful apply confirms that the document is valid. It does not show how the document renders. ## Source and generation requests [#source-and-generation-requests] `POST /api/generate` takes a short, versioned request and returns an artifact or a document ready to apply. A source drawer document holds the full state of one open tool and is not a valid generation request. The `design-sequence` response connects the two: it contains a Design Lab `document` that you apply with Design Lab open. ```js const generated = await fetch('/api/generate', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ kind: 'design-sequence', identity: { preset: 'gt' }, shader: { materialId: 'paper-gem-smoke' }, sequence: { cutCount: 10, finalHoldMs: 5000, pace: 'accelerating' }, }), }).then((response) => response.json()); await window.glyphfield.studio.applySource(generated.document); ``` To share Design Lab and Animation work as files, use [project files](/docs/studio/project-files). See also the [Studio Browser API](/docs/reference/browser-api) and [Agent recipes](/docs/agents/recipes). --- # Project files Share and reopen an editable Design Lab or Animation workspace as one .glyphfield.json file with its artboards, images, fonts and saved shader frames. Canonical page: https://www.glyphfield.com/docs/studio/project-files Markdown: https://www.glyphfield.com/docs/studio/project-files.md A project file is an editable Design Lab or Animation workspace saved as one `.glyphfield.json` file. Design Lab is the layered composition tool and Animation is the scene sequencer. PNG, JPG, GIF and MP4 files are rendered outputs. A project file keeps the layers, so someone else can continue editing. ## Download a project file [#download-a-project-file] Choose **File → Download project file** in the tool header. In Design Lab, the export dialog also offers it as **Project file** in its **Editable project** section. Design Lab captures the current shader appearance of the active artboard and prepares one JSON download. You do not need to render a PNG first. A Design Lab project file contains: * Every artboard with its name, position and dimensions, and which artboard is active. * The loose canvas layers. * Editable layers with stable IDs, order, transforms, groups, locks, text and text runs, colors, converter and image effect settings, and shader recipes. * Embedded image and logo bytes, including images used only by inactive artboards. * Saved shader PNGs and native frame state from every artboard. * Timeline, export settings, brand ID and document metadata. * Embedded brand font files, typography roles, variable font weights and text metrics. Inactive artboards keep their saved state. Downloading does not run their renderers and does not create captures that are missing. A saved PNG keeps the captured pixels. A Fluid simulation does not resume from a saved PNG, and procedural shaders can render slightly differently on another GPU. An Animation project file contains the scenes, artboards, timing, keyframes, text entrances, backgrounds, audio clips, the image and audio bytes they use, and the brand font files and typography roles. The file is the existing CanvasDocument schema 2. Design Lab files have `metadata.tool: "design-lab"` and Design Lab metadata source version 4. Animation files have `metadata.tool: "animation-studio"` and `metadata.animation`. There is no separate project schema. The MIME type is `application/json`. ## Open a project file [#open-a-project-file] | Route | Result | | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | | **Add brand project** (the + button beside the project tabs) **→ Import project…** | Creates a new project named after the file and opens it in Design Lab or Animation. Existing projects stay unchanged | | **File → Open project file** in Design Lab or Animation | Replaces the current workspace. Saved checkpoints stay available | The file picker accepts `.glyphfield.json`, `.json` and `application/json`. The size limit is 128 MiB (134,217,728 bytes). Opening validates the file in the browser and does not fetch URLs found in the file. A file with missing embedded images or fonts, invalid base64 data or invalid canvas data fails with an error and opens nothing. Imported typography applies only to the workspace that opened the file. The receiving brand keeps its identity and unrelated settings. The typography snapshot is stored with the document, so it survives reloads and later downloads. If a typography role has no font file, the download stops with an error that asks you to add the font file. Older CanvasDocument files without a typography snapshot use the typography of the receiving workspace. ## Agents [#agents] ```js const studio = window.glyphfield.studio; const project = await studio.invoke('design.export.project'); if (!(project.blob instanceof Blob) || project.blob.size === 0 || !project.fileName.endsWith('.glyphfield.json')) { throw new Error('Invalid project file'); } studio.download(project); // Reopen the same bytes through the file control of Design Lab. await studio.set('Choose project file', new File([project.blob], project.fileName, { type: 'application/json' })); ``` Animation uses `animation.export.project`. Setting the file control starts the import and returns before it finishes. Before you call `readSource()`, wait for the status message "Opened" followed by the file name or for the **Could not open project** error. The Browser API (`window.glyphfield.studio`) reaches only the controls of the active tool, so it cannot use **Add brand project**. To open a file as a new project, a browser automation tool clicks **Add brand project**, chooses **Import project…** and passes the file to the file chooser. ## Scope [#scope] A project file holds one workspace. It is not a backup of every brand, tool, checkpoint history or browser setting. It includes the fonts and typography that the design needs, and leaves out the rest of the brand library. To back up a whole project, see [Backup and restore](/docs/artifacts/backup-and-restore). To change the JSON directly, use **File → Edit source code** and the [source editing workflow](/docs/studio/source-editing). --- # Shared editor components Reuse the shared shell, color, canvas, layer, source, select and storage components when you build or change a Studio tool in the Glyphfield codebase. Canonical page: https://www.glyphfield.com/docs/studio/editor-systems Markdown: https://www.glyphfield.com/docs/studio/editor-systems.md Studio tools in the Glyphfield codebase are built from shared components and hooks for the tool shell, color fields, zoom, layer editing, select menus, source editing and draft storage. A contributor who builds a tool from them gets the same interaction, accessibility, automation and export behavior as the other tools. ## Component map [#component-map] | Component or module | Responsibility | Used by | | --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | `ToolShell` (`src/components/tools/ToolShell.tsx`) | Tool header, left and right sidebars, the **File** menu, the lazily loaded source drawer and Browser API registration | Color tokens, Typography, Component library and the five expression tools | | `StudioToolHeader` | Header with the tool icon, title, description, a status slot and an actions slot | `ToolShell` and the tools that build their own shell | | `StudioFileMenu` | The **File** menu: optional **Open project file** and **Download project file**, tool-specific sections, and **Edit source code** under **Advanced** | Every tool with a source document | | `StudioActionMenu` (`src/components/ui/`) | A named toolbar button that opens the shared `StudioContextMenu` in a portal. Arrow keys also open it | **File**, **More exports** and the Studio header | | `LabInspectorSection` (`src/components/LabWorkspace.tsx`) | Collapsible inspector section with an icon. Collapsed content stays mounted | Design Lab, Animation, Lottie, Moodboard, Brand elements and Brand book, and every `ControlSection` from `src/components/tools/ToolFields.tsx` | | `ColorControl` (`src/components/ui/ColorControl.tsx`) | Swatch, picker, HEX, OKLCH, optional opacity and the screen eyedropper. The parent owns the value | Brand identity, Color tokens, Component library, Design Lab, Brand elements, Lottie, the expression tools and **Visual settings** | | `CanvasViewport` | Zoom, fit, view reset, pan, and optional **Undo**, **Redo** and **Action history**. Zoom is saved per project and tool | Design Lab, Animation, Lottie, Moodboard, Brand elements and the expression tools | | `EditableCanvasLayer` | Selection, move, resize, keyboard nudge, snapping guides and an optional rotate handle. The parent owns the transform | Design Lab, Animation and the expression tools | | `SourceCodeDrawer` and `LazySourceCodeDrawer` | The JSON source drawer. Tools mount `LazySourceCodeDrawer`, which loads the editor and its syntax grammar the first time a drawer opens | Every tool with a source document | | `src/lib/sourceCode.ts` | JSON parsing and diagnostics, rich-text space cleanup, formatting, and readers for constrained strings, numbers, Booleans, arrays and objects | Source validators in every tool | | `src/lib/canvasDocument.ts` | CanvasDocument schema 2: pages, elements, assets, parsing, serialization, mutations, history helpers and preflight | Design Lab, Animation, Lottie and the expression tools | | `StudioSelect` (`src/components/ui/`) | Select trigger and popover built on Radix Select, with keyboard navigation | Fonts, assets, materials, layouts, formats, languages and presets | | `MaterialFinishControls` | **Finish preset**, **Shadow**, **Border**, **Reflection** and **Liquid glass** | Animation frames and backgrounds | | `LogoAppearanceControls` | Invert, dither, outline and shadow for logos, images and stickers | Design Lab, Brand elements and the expression tools | | `useStudioDraft` (`src/hooks/usePersistentState.ts`) | Field state saved in `localStorage` under one key per project, tool and field | Tool fields, zoom, layers, surfaces, layouts and export settings | | `usePortableCanvasWorkspace` (`src/hooks/`) | Embeds assets, serializes the CanvasDocument, restores and writes autosave, and registers the project snapshot used when a project is duplicated | Design Lab, Animation, Lottie and the expression tools | | `src/lib/studioAutomation.ts` | The Browser API registry (`window.glyphfield.studio`): accessible controls, source round trips, tool actions and Blob downloads | Every Studio tool | ## Color control [#color-control] `ColorControl` is one component with optional features. By default it is compact: a row with the swatch, the label, the HEX value and the opacity opens a picker popover. `compact={false}` shows the swatch, HEX and OKLCH fields inline for dedicated color-editing surfaces. | State | Behavior | | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Resting | The swatch, label, normalized HEX and optional opacity | | Open | Saturation and brightness area, hue slider, **Pick screen color**, H, S and V readouts, HEX, OKLCH and optional opacity | | HEX editing | Commits on blur or Enter. Escape cancels. Invalid input leaves the color unchanged | | OKLCH editing | Parses OKLCH input and converts it to the stored HEX value | | With opacity | Adds a 0–100% range. Color and opacity change independently | | Dragging | Picker and preview updates are grouped into animation frames. Releasing the pointer commits the final value | | Eyedropper active | **Pick screen color** samples any visible pixel on the screen, including outside the browser. A sample commits one HEX edit and leaves opacity unchanged. Escape cancels | The conversion functions (`normalizeHex`, `formatOklch`, `parseOklch`, `oklchToHex`, `hexToHsv` and `hsvToHex`) live in `src/lib/color.ts`. The eyedropper (`src/components/ui/ScreenColorPicker.tsx`) uses the browser's EyeDropper API, which needs a supporting browser on HTTPS or localhost. Without it, the button is disabled with an explanation, and the other color controls keep working. Closing the picker or unmounting it cancels an unfinished sample. Browser API control discovery lists the button as ` pick screen color`. Screen sampling needs a real user gesture and a native screen selection, so agents set colors through the HEX or OKLCH fields and re-read the source to confirm the change. ## Canvas viewport [#canvas-viewport] `CanvasViewport` wraps the artifact without changing its aspect ratio. The stage scales on screen, and exports keep the artifact's declared pixel size. * Zoom runs from 40% to 200% by default. Hosts can change the range: Design Lab uses 5% to 800%. * The percentage button restores 100%. **Reset view** restores 100% and the starting pan. **Fit canvas** (F) fits the content at no more than 100%. **Zoom in** (+) and **Zoom out** (−) step by 10%. * The mouse wheel or trackpad zooms around the pointer. Dragging on empty workspace, middle-button dragging or Space + drag pans the view. * Zoom is stored with `useStudioDraft` for each project and tool. Pan resets when the tool remounts. * When the host passes `actionHistory`, the toolbar shows **Undo**, **Redo** and **Action history**, and ⌘/Ctrl + Z and Shift + ⌘/Ctrl + Z work while the pointer is over the canvas or the canvas has focus. These gestures change only the view transform. The document and its export geometry stay the same. ## Source drawer [#source-drawer] `SourceCodeDrawer` keeps source editing next to the canvas. The host controls it through four props: * `source` is the current serialized document of the tool. * `onApply` parses and validates the edited text, then updates the host state. An error it throws appears in the drawer and leaves the visual document unchanged. * `format` and `title` label the drawer. * `onClose` closes it. The tool and the canvas position stay as they were. The drawer is a shared editing shell, and each tool owns its schema. Each tool checks its own fields and converts valid source into the same state that its visual controls use. Lottie and Animation use CanvasDocument envelopes with their own metadata, the expression tools use expression documents, and the foundation and component tools use their own versioned objects. See [Source code editing](/docs/studio/source-editing), the [Source format reference](/docs/reference/source-formats) and the [Studio Browser API](/docs/reference/browser-api). ## Direct manipulation [#direct-manipulation] `EditableCanvasLayer` draws one movable object on the artboard. The host gives it a base box and a `CanvasLayerTransform` (offset, scale, optional width and height scale, and rotation) and receives the new transform in `onChange`. | State | Behavior | | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Idle | No selection frame or handles | | Selected | A selection frame, the layer label and resize handles. `resizeMode: 'scale'` shows one scale handle, and `resizeMode: 'box'` shows edge and corner handles | | Moving | Pointer capture moves the layer in canvas coordinates. Within 6 screen pixels it snaps to the canvas edges and center, to the edges and centers of other layers, and to the lines in `snapTargets` | | Resizing | Edge and corner drags change the scale or the box. The minimum scale is 0.02, and there is no fixed maximum | | Rotating | With `onRotate`, a rotate handle appears. Shift snaps the angle to 15° steps | | Keyboard | Arrow keys nudge by 1 px, and Shift + arrow nudges by 10 px. Shift + F10 or the context menu key opens the host's menu | | Locked | With `interactive={false}`, the layer is inert on the canvas. Inspector controls still work | The host owns the selection. The expression tools start with nothing selected and select a layer when it is added. Design Lab passes `onRotate`, `rotation` and `canvasThirdsSnapTargets` (rule-of-thirds lines on artboards). The expression tools rotate layers through the inspector and use the default snap lines. ## CanvasDocument model [#canvasdocument-model] `src/lib/canvasDocument.ts` defines the portable document model that people and agents share. It is separate from React component state and records: * The schema version, brand binding, capabilities, revision and metadata. * Pages with dimensions, safe area, bleed, background, notes and ordered element IDs. * Elements of the kinds `text`, `image`, `logo`, `shape`, `line`, `frame`, `group`, `gradient`, `texture`, `shader`, `effect`, `video` and `component`. * Bounds, rotation, anchors, locks for position, dimensions, aspect ratio and rotation, visibility, blend mode, border, radius, opacity and shadow. * Font bindings, text roles and text style. * Non-destructive image crop, focal point, fit, saturation, dither, grain, blur, posterization and halation. * Asset and font records that elements reference by ID. `applyCanvasMutation` supports these mutations: move several elements, resize, lock, delete, reorder, update and replace an asset. Replacing an asset changes only the source reference and keeps geometry, crop, image treatment, effects and constraints. The module also exports history and checking helpers. `commitCanvasChange` takes one mutation or a batch, and a batch is one undo step. `undoCanvasChange` and `redoCanvasChange` restore cloned documents. `saveCanvasVersion` records an author, time, name, note and revision, and `restoreCanvasVersion` returns a clone. `preflightCanvasDocument` reports missing assets, missing fonts, assets and fonts that are not embedded, elements that extend beyond their page and text over its line limit. Tests cover these helpers, and no Studio tool calls them yet. Each editor keeps its own undo stack (the expression tools use `useExpressionDocument`, with 120 steps), and saved checkpoints live in `src/lib/savedDesigns.ts`. ## Logo appearance [#logo-appearance] `LogoAppearanceControls` and `src/lib/logoAppearance.ts` keep logo treatment the same across tools. The CSS preview filter, the SVG export filter and the canvas renderer all read the same settings. * **Invert** reverses the colors of the resolved mark or image. No second file is needed. * **Dither** applies an ordered print pattern with an amount (0–100%), a cell size (2–18 px) and a direction (0–360°). The source file stays unchanged. * **Outline** follows the alpha of the SVG or transparent image, with its own color, opacity and width. * **Shadow** has a color, opacity, blur and horizontal and vertical offsets. * The outline and shadow colors use `ColorControl` with opacity. The settings are stored with the layer or element that uses them. In Brand elements, one setting applies to every logo in the selected element. ## Third-party libraries [#third-party-libraries] Studio tools use third-party packages through local components, so a tool does not depend on each library's API. | Package | Local boundary | Used for | | ----------------------------------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | | `@radix-ui/react-select` | `StudioSelect` | Accessible select popovers, keyboard navigation and focus management | | `@radix-ui/react-slot` | `Button` | Buttons that render as links or other elements with the same styles | | `three` and `@react-three/fiber` | `LiveMaterialCanvas`, `ShaderGradientSurface` and `HoloClothSurface` | Live GPU materials | | `@shadergradient/react` | `ShaderGradientSurface` | The editable ShaderGradient sphere | | `@paper-design/shaders-react` | The Paper adapter (`paperShaderRenderer.ts` and its registries) | Paper shader families and presets. `/api/materials` lists the ones the Shader Library shows | | `shaders` | `ShaderEffectsSurface` and `src/lib/shaderEffectProcessor.ts` | MIT-licensed Shaders.com WebGPU materials and the image effects on Design Lab Effect layers | | WebGL Fluid Simulation by Pavel Dobryakov | `src/lib/fluidSimulationShaders.ts` in `LiveMaterialCanvas` | The MIT-licensed fluid solver behind Fluid Energy | | `gifenc` | `src/lib/exportGif.ts` and `src/lib/canvasExport.ts` | GIF encoding and palettes | | `mediabunny` | `src/lib/canvasExport.ts` | MP4 encoding, including the Animation audio track | | `@lottiefiles/dotlottie-web` | `LottieStudio` | `.lottie` and Lottie JSON playback with exact frame seeking | | `prismjs` | `src/lib/codeHighlight.ts` and `src/lib/expressionSvg.ts` | JSON color in the source drawer and code color in Terminal card | | `@phosphor-icons/react` | `src/components/ui/SolidIcons.tsx` | Control icons | | `gt-next` | `` and `useGT` | Translatable Studio labels and accessible names | | Fumadocs | The docs shell and MDX source | This documentation, its search and its navigation | ## Build a new tool [#build-a-new-tool] 1. Wrap the tool in `ToolShell`, or compose `StudioToolHeader`, `StudioFileMenu` and `LazySourceCodeDrawer` yourself. 2. Store tool fields with `useStudioDraft(identity.id, tool.id, field, initialValue)`. 3. Use `ColorControl` for every editable color and opacity. 4. Wrap the artifact in `CanvasViewport` and keep its declared aspect ratio. 5. Represent every movable object with a `CanvasLayerTransform` and render it with `EditableCanvasLayer`. 6. Use `StudioSelect`, `Button` and the fields in `src/components/tools/ToolFields.tsx` (`ControlSection`, `Field`, `RangeField`, `UploadField` and `SegmentedChoice`) instead of one-off controls. 7. Build exports from the same resolved settings that drive the preview. 8. Serialize the editable state for the source drawer and validate edits with the `sourceCode.ts` readers, so source edits go through the same validators and state setters as the visual controls. A tool that stores a CanvasDocument can use `usePortableCanvasWorkspace` for serialization and autosave. 9. Register Browser API actions through the `automation` prop of `ToolShell`, add their contracts to `STUDIO_TOOL_ACTION_CONTRACTS` in `src/lib/studioAgentCapabilities.ts`, and document every action name. `src/lib/__tests__/documentationCoverage.test.ts` fails when an action is missing from the docs. A tool built this way looks and behaves like the rest of the Studio, and its renderer can still be SVG, Canvas, HTML or WebGL. --- # Artifacts overview Choose the right Glyphfield output format, produce it over HTTP or in the browser, verify the file, and keep the editable source beside it. Canonical page: https://www.glyphfield.com/docs/artifacts Markdown: https://www.glyphfield.com/docs/artifacts.md An artifact is a file that Glyphfield renders from a brand identity and an exact configuration, such as a PNG, an MP4 or an SVG. Keep the editable source next to the rendered file whenever the work may later need another size, language, shader frame or motion format. ## Output formats [#output-formats] | Output | Produced by | Use it for | | ---------------------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | | SVG | HTTP templates and backgrounds, the expression tools, Moodboard | Deterministic vector files for source control and later rasterizing | | PNG | Design Lab, Moodboard, Brand elements, the expression tools, Lottie frames, Animation posters | Lossless stills with transparency | | JPG | Design Lab | Smaller opaque stills | | GIF | Design Lab, Animation, Lottie | Short motion for email, docs and other places that need GIF | | MP4 | Design Lab, Animation, Lottie | Longer or higher-fidelity motion. Animation can include mixed audio | | PDF | Brand book (print dialog), Slide templates | A snapshot of the brand standards, or a slide deck | | HTML | Brand elements email elements | Email layouts with inlined styles | | JSON | Brand identities, element briefs, project files, tool source, Lottie | Editing, automation, handoff and regeneration | | `.lottie` | Lottie | The original compact animation archive | | ZIP, CSS, Tailwind, DTCG, Markdown | Brand kit, Color tokens, Typography | Design tokens and brand guidance for code | The expression tools are OpenGraph, Terminal card, Partnership lockup, Blog cover and Slide templates. [Capability matrix](/docs/reference/capability-matrix) lists the exports of every tool. ## Ways to produce an artifact [#ways-to-produce-an-artifact] ### HTTP [#http] Use `POST /api/generate` for repeatable SVG, structured element briefs and apply-ready Design Lab sequence source. The route validates each request against the contract from `GET /api/generate` and does not change any browser project. ### Browser [#browser] Use the Studio, or the Browser API (`window.glyphfield.studio`), when the output depends on Canvas, WebGL, WebGPU, local files, local fonts, visual placement, Lottie, frame capture or browser codecs. Browser API exports use the same renderer as the visible Studio. ### Both [#both] Generate a Design Lab document over HTTP, apply it in the browser, inspect it, then export PNG, JPG, GIF or MP4. HTTP authors the document and the browser renders it, so there is only one renderer. ## Checklist [#checklist] For every artifact: 1. Confirm the intended identity and source revision. 2. Inspect the rendered composition when the request is visual. 3. Confirm the dimensions, format, transparency or opacity, and file name. 4. Require a non-empty response body or Blob. 5. For motion, inspect several frames and the point where the loop restarts. For MP4 with audio, confirm the audio track. 6. Keep the portable source or a named saved design when the work may need to be regenerated. [Formats and portability](/docs/artifacts/formats-and-portability), [Download and use artifacts](/docs/artifacts/download-and-use) and [Backup and restore](/docs/artifacts/backup-and-restore) cover each step in detail. --- # Download and use artifacts Export files from the Studio or the HTTP API, check that each file is complete, and use SVG, image, motion, JSON and Lottie output in your own projects. Canonical page: https://www.glyphfield.com/docs/artifacts/download-and-use Markdown: https://www.glyphfield.com/docs/artifacts/download-and-use.md ## Export from the Studio [#export-from-the-studio] Set up the artifact, inspect the preview, then use the tool's export control. | Tool | Exports | | -------------------------------------------------------- | -------------------------------------------------------------- | | Design Lab | PNG, JPG, GIF, MP4, project file | | Animation | GIF, MP4, PNG poster, project file | | Lottie | PNG frame, GIF, MP4, the edited JSON or the original `.lottie` | | OpenGraph, Terminal card, Partnership lockup, Blog cover | PNG, SVG | | Slide templates | PNG, SVG, PDF deck | | Moodboard | PNG, SVG, identity JSON | | Brand elements | PNG, HTML email, JSON brief | | Brand book | PDF through the browser print dialog | | Brand identity | Identity JSON and the brand kit | [Capability matrix](/docs/reference/capability-matrix) lists the same exports with their Browser API actions. To export from Design Lab, the layered composition tool, with the Browser API (`window.glyphfield.studio`): ```js const studio = window.glyphfield.studio; if (studio.activeTool() !== 'material') throw new Error('Open Design Lab first.'); const artifact = await studio.invoke('design.export', { format: 'gif', mode: 'standard', download: false, }); if (!(artifact.blob instanceof Blob) || artifact.blob.size === 0) { throw new Error('Empty GIF export.'); } studio.download(artifact); ``` Run one browser export at a time. Exports share the renderer and encoder, and Design Lab rejects a new export or capture while one is running. Check each file before starting the next export. Design Lab exports the active artboard. PNG and JPG freeze the shader frame that is visible when the export starts. GIF and MP4 sample motion from the current frame and restore that paused pose afterward. These exports do not add captured-frame assets to IndexedDB or restart playback. Use `design.frame.pause` to pause without storing anything, and `design.frame.capture` when the editable source should include a lasting PNG of the shader's appearance. When a resource is missing, or a motion export of Fluid Energy is requested, the export fails with an error and nothing is substituted. ## Download raw SVG from the API [#download-raw-svg-from-the-api] ```bash BASE_URL=http://localhost:3012 curl -fsS -X POST "$BASE_URL/api/generate" \ -H 'Content-Type: application/json' \ -d '{ "kind": "template", "template": "slides", "slideLayout": "statement", "texture": "white", "title": "One identity. Every surface.", "identity": { "preset": "gt" }, "output": "raw" }' \ -o gt-statement-slide.svg test -s gt-statement-slide.svg ``` Set `BASE_URL` to your deployment. `http://localhost:3012` is the local development server. A raw response is `image/svg+xml` with a `Content-Disposition` header that names the file. ## Extract SVG from a JSON envelope [#extract-svg-from-a-json-envelope] Without `output: "raw"`, template and background requests return a JSON envelope: `{ artifact: { content, filename, height, mimeType, width }, schemaVersion: 1 }`. ```bash curl -fsS -X POST "$BASE_URL/api/generate" \ -H 'Content-Type: application/json' \ -d @request.json \ -o response.json jq -r '.artifact.content' response.json > artifact.svg jq '.artifact | { filename, mimeType, width, height }' response.json test -s artifact.svg ``` ## Use SVG [#use-svg] The commands above write the file into the current directory. Copy it into your application's public asset directory before referencing it from HTML or CSS. The example file is generated output and does not ship with Glyphfield. ```bash mkdir -p public/brand cp gt-statement-slide.svg public/brand/gt-statement-slide.svg ``` ```html General Translation statement slide ``` ```css .launch-hero { background: center / cover no-repeat url('/brand/launch-background.svg'); } ``` Inline an SVG in a page only when you trust it and need its internal styling or scripting. ## Use stills and motion [#use-stills-and-motion] * Use PNG for transparency and crisp flat graphics. * Use JPG for smaller opaque images. * Use GIF when the destination requires it. Check the dimensions, palette banding, file size and the point where it loops. * Use MP4 for longer or higher-fidelity motion. Add captions or a transcript where needed, and check the audio. * Respect `prefers-reduced-motion` and the platform's autoplay rules. ## Use JSON and briefs [#use-json-and-briefs] An element brief is a production specification in JSON, and it contains no image. Store it next to the implementation when you need to trace the work back to its source. Treat a CanvasDocument or other tool source as editable state. Open or apply it in a compatible Studio version instead of rendering it from guessed fields. ## Handoff bundle [#handoff-bundle] A complete handoff contains: 1. The rendered artifacts. 2. The exact editable source or the named Design Lab save. 3. The identity ID and revision. 4. Authorized asset and font files that the source does not embed. 5. The output settings and the expected loop and audio behavior. 6. License and attribution notes where required. With this bundle, a person or an agent can regenerate the work without layers shifting or shader timing changing. --- # Formats and portability Learn how each Glyphfield output format behaves, including SVG, PNG, JPG, GIF, MP4, PDF, JSON and Lottie, and what a file needs to stay portable. Canonical page: https://www.glyphfield.com/docs/artifacts/formats-and-portability Markdown: https://www.glyphfield.com/docs/artifacts/formats-and-portability.md ## SVG [#svg] Templates and backgrounds generated over HTTP are standalone UTF-8 SVG documents. The expression tools (OpenGraph, Terminal card, Partnership lockup, Blog cover and Slide templates) and Moodboard also export standalone SVG. * The dimensions are fixed on the root `` element. * Brand fonts, bundled marks and authorized data-URL images are embedded in the file. * Filters and patterns are deterministic and travel with the file. * Template text stays text and renders in the embedded brand font. * The file does not load anything from the Glyphfield deployment. Keep SVG as the master copy of an API artifact and rasterize it for each destination. ## PNG [#png] PNG is a lossless still. It keeps transparency where the composition has it, and it suits social images, slide backgrounds, documentation, product surfaces and archived proofs. A Design Lab PNG renders the complete layer stack: background, shaders at the selected frame, converter effects, text effects, assets, marks, stickers, opacity, blend modes and transforms. Design Lab, the layered composition tool, freezes the shader frame that is visible on screen and then composes the PNG or JPG at the selected output size. The export leaves playback paused and stores no shader-frame assets. To keep an editable checkpoint of the shader's appearance as well as the rendered file, capture the shader frame explicitly with **Capture shader frame** and keep the portable CanvasDocument source. The expression tools export PNG at twice the page size, capped at 4800 px on the longest edge. ## JPG [#jpg] JPG is an opaque Design Lab still. Transparent areas are composited over the artboard background before encoding. Use it when file size matters more than transparency or exact flat-color edges. ## GIF [#gif] GIF stores motion with a limited color palette and has no audio channel. Glyphfield reserves palette entries for important brand and text colors. Design Lab builds one palette for the whole GIF, or a palette per frame at **Best** quality. Animation and Lottie build one palette for the whole GIF, and Lottie GIFs run at 25 FPS. Design Lab has two loop modes. Animation and Lottie record the clip as it plays. * **Raw motion** records the requested interval without correcting the loop point. Use it for motion that already repeats or for an intended hard cut. * **Blended loop** records extra frames past the end, blends them toward the frames recorded at the start, and checks that the end meets the start. The GIF loop flag only repeats playback. It does not make the last frame match the first, so inspect the actual loop point. ## MP4 [#mp4] MP4 is video encoded in the browser, with better color and smaller files for motion than GIF. Glyphfield tries the H.264 codec first and then the other codecs the browser can encode. Design Lab encodes either the standard composition or the shader-sequence cut. Animation can mix overlapping audio clips into the video. Lottie MP4s run at 30 FPS. Codec support depends on the browser. When no MP4 video codec is available, the export fails with "This browser cannot encode an MP4 video." Keep the source and report the limitation. Glyphfield does not substitute GIF. Design Lab GIF and MP4 exports sample motion from the current frame and restore that paused pose afterward, without storing captured-frame assets. A saved PNG keeps the appearance of a frame but not the simulation history behind it. Fluid Energy is a stateful simulation, so it supports still export, but its motion cannot be exported from a timestamp. ## PDF [#pdf] The Brand book prints through the browser's print dialog to a paginated PDF of the brand standards, one 16 × 10 in page per sheet. The PDF is a snapshot of the pages built from the current identity and is not editable source, so export it again after changing the identity. Slide templates export a PDF deck directly, with each slide embedded as an image at twice its size. ## JSON and CanvasDocument [#json-and-canvasdocument] JSON can hold: 1. A `BrandIdentity`. 2. An element brief resolved against an identity. 3. An API envelope with embedded SVG. 4. A Studio tool's source configuration. 5. A CanvasDocument scene graph. 6. Raw Lottie JSON. Keep `schemaVersion`, tool metadata, stable IDs, asset references, ordering and unknown fields. Design Lab's current source is CanvasDocument schema 2 with Design Lab metadata source version 4. ## Lottie [#lottie] Raw Lottie JSON can be edited, recolored and downloaded. A binary `.lottie` archive stays binary. It can be replayed and downloaded, and it is not presented as expanded JSON. ## Fonts and assets [#fonts-and-assets] Fonts installed in the browser and temporary object URLs do not travel with editable source by themselves. A rendered PNG, JPG, GIF or MP4 contains their visible result, but an editable JSON document can still need the original authorized files. Embedding files as data URLs makes a document larger and more portable. For a lasting handoff, keep: * The editable source or saved design. * The authorized original images and fonts that the source does not embed. * The rendered artifact. * The requested dimensions, frame rate, duration, loop mode and codec. * The attribution and license records for third-party shaders and materials. [Storage and privacy](/docs/artifacts/storage-and-privacy) and [Source format reference](/docs/reference/source-formats) cover storage and source in detail. --- # Backup and restore Back up identities, editable source, browser saves and original files outside the browser, and restore them in another browser, device or Glyphfield version. Canonical page: https://www.glyphfield.com/docs/artifacts/backup-and-restore Markdown: https://www.glyphfield.com/docs/artifacts/backup-and-restore.md Glyphfield is local-first: it keeps your work in the browser and has no account that syncs it. Browser storage keeps everyday work fast and private, but a browser profile on one site origin is not a lasting backup. Keep portable source and original files outside the browser whenever a design must survive a new device, cleared site data or a move to another hostname. ## What to back up [#what-to-back-up] | Data | Where it lives | Portable on its own | How to back it up | | ----------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------- | | Project identity | Browser `localStorage` | After you copy its JSON | In Brand identity, open the source drawer with **Code**, select **Copy** and save the `BrandIdentity` as a JSON file | | Tool drafts and navigation | Browser `localStorage` | No | Copy the source of each important tool from its source drawer | | Autosaves and named saves in Design Lab, Animation, Lottie and the expression tools | IndexedDB, plus a small recovery journal in `localStorage` | No. They stay in one browser profile and origin | Select **Save checkpoint**, then copy the current CanvasDocument from the source drawer | | Converted Design Lab assets | IndexedDB, and asset records in the CanvasDocument | Only when the bytes are embedded | Copy the portable source, and keep any original file that it does not embed | | Captured shader frames | PNG files in IndexedDB, named by content hash | When the PNG bytes are embedded in the CanvasDocument assets | Capture the intended look and keep the complete portable source. A timestamp alone does not reproduce the frame | | Uploaded images, fonts, Lottie files and audio | Browser memory, object URLs or embedded records, depending on the tool | Not always | Keep the original authorized files beside the source | | PNG, JPG, SVG, GIF, MP4, PDF | The downloaded file | Yes, but it is not editable | Keep it beside the source as the approved proof | The expression tools are OpenGraph, Terminal card, Partnership lockup, Blog cover and Slide templates. Design Lab and Animation can also save a project file (`.glyphfield.json`) with **Download project file**. A project file embeds local images, saved frames and fonts, and **Open project file** reopens it. Closing a Studio tab does not delete a project. Deleting a browser profile, clearing site data, using private browsing, or moving to another origin can remove or hide local state. ## Backup folder [#backup-folder] For every design that matters, keep one folder that contains: 1. The active identity JSON. 2. The current tool source JSON, project file or Lottie source. 3. The approved rendered artifact. 4. Original assets and font files that the source does not embed. 5. A short note with the identity ID, tool name, output dimensions, frame rate, duration, loop mode and expected audio. 6. License and attribution records for third-party marks, materials, fonts and source media. Name the files as one set, for example: ```text launch-system/ identity.json design-lab.canvas.json launch-loop.mp4 launch-loop.gif assets/ wordmark.svg campaign-photo.webp display-font.woff2 README.md ``` ## Back up a Design Lab composition [#back-up-a-design-lab-composition] ### In the Studio [#in-the-studio] 1. Open the project and **Design Lab**, the layered composition tool. 2. Wait until the save status shows **Autosaved**. 3. Select **Save checkpoint** so the current state has a named save. 4. Open the source drawer with **Code** and select **Copy**. 5. Save the copied JSON outside the browser as `design-name.canvas.json`. 6. Export one PNG proof at the intended size. 7. If the design moves, export a GIF or MP4 and write down the duration, FPS, quality and loop mode. The source drawer is where source leaves the browser. A named save stays in the browser, so it is not an off-device backup. ### With the Browser API [#with-the-browser-api] The Browser API (`window.glyphfield.studio`) can capture the shader appearance and return the source in one call: ```js const studio = window.glyphfield.studio; if (studio.activeTool() !== 'material') { throw new Error('Open Design Lab before reading its source.'); } const description = studio.describe(); if (!description.source.read) throw new Error('Source reading is unavailable.'); // Freeze and store the visible shader appearance before backing it up. const source = await studio.invoke('design.frame.capture'); const document = JSON.parse(source); if (document.schemaVersion !== 2) { throw new Error(`Unexpected CanvasDocument schema ${document.schemaVersion}.`); } // Return `source` to the calling agent or save it through an authorized // file interface. Do not write into Glyphfield's browser storage. ``` If someone kept editing, read the source again right before the backup. Do not rebuild a document from an example or from stale state. A captured PNG keeps the approved still even when the shader engine, GPU or browser changes. Keep the editable recipe too. Fluid Energy needs its earlier simulation state to continue the same way, so its PNG keeps the still and not the simulation's history. ## Restore a composition [#restore-a-composition] ### In the Studio [#in-the-studio-1] 1. Open the correct project and tool. 2. Open the source drawer with **Code**. 3. Paste the complete saved document. 4. Select **Apply code** and fix any validation error it reports. 5. Confirm the layer count and the front-to-back order. 6. Inspect the logos, images, fonts, shader frames, converter colors and output size. 7. Select **Save checkpoint** only after the restored composition looks right. ### With the Browser API [#with-the-browser-api-1] ```js const studio = window.glyphfield.studio; const before = studio.readSource(); try { await studio.applySource(savedDocument); const restored = JSON.parse(studio.readSource()); if (restored.schemaVersion !== 2) throw new Error('Restore did not normalize.'); } catch (error) { // `before` is the recovery copy for this operation. throw error; } ``` `applySource()` validates before it changes anything, so a failed application leaves the current artifact unchanged. Keep the source from before the restore until you have checked the visual result. ## Move to another browser, device or origin [#move-to-another-browser-device-or-origin] Browser storage is separate for each origin and profile. `http://localhost:3012`, a preview deployment and the production hostname have separate stores, even when they serve the same Git commit. To move work: 1. Export the source and original files from the old origin. 2. Open the same or a newer compatible Glyphfield version at the new origin. 3. Create or select the intended project. 4. Apply the identity source first. 5. Open each tool and apply its source or open its project file. 6. Attach again any local font, image, audio or Lottie file that the source does not embed. 7. Export a proof and compare it with the approved artifact. Glyphfield has no single archive of every project, draft, IndexedDB record and original local file. The source-and-files folder described above is the supported way to move work. ## Autosave recovery [#autosave-recovery] Design Lab, Animation, Lottie and the expression tools write a complete autosave to IndexedDB. While a newer write is still in progress, a small recovery journal in `localStorage` holds the newest source. On the same origin and browser profile, a reload restores the newest complete draft. If recovery seems stuck: 1. Do not clear site data. 2. Reload the same origin once and wait for the save status to settle. 3. Open the expected project and tool. 4. If the source drawer opens, copy the source before making more edits. 5. If IndexedDB is blocked, keep any source you can read and the original files, then continue in a normal browser profile. Glyphfield cannot rebuild cleared site data. Recovery then depends on an external source or artifact backup. ## Migration rules [#migration-rules] * A CanvasDocument schema 1 document migrates to schema 2 when it parses. * CanvasDocument schema 2 is the current portable scene graph. * Design Lab metadata source version 4 is the current composition model. * A `design-sequence` HTTP response contains a version-3 compatibility document. Apply it first, then read the normalized CanvasDocument before storing it as the lasting source. * Unknown future canvas schema versions are rejected. * Keep stable IDs, page order, asset records and unknown metadata intact in any manual edit. [Version compatibility](/docs/reference/version-compatibility) has the full version table, and [Troubleshooting](/docs/reference/troubleshooting) covers recovery failures. ## Restore checks [#restore-checks] A restore is complete when: * The intended identity and tool are active. * The source applies without validation errors. * The layer count, order, transforms, opacity and visibility match. * Embedded and local assets load. * At least one still export is non-empty and has the expected dimensions. * Motion exports contain changing frames, seamless GIFs close cleanly, and MP4 audio is present when required. * The normalized source has been copied again after the restore. [Storage and privacy](/docs/artifacts/storage-and-privacy), [Source code editing](/docs/studio/source-editing) and [Formats and portability](/docs/artifacts/formats-and-portability) cover related topics. --- # Storage and privacy See where Glyphfield keeps projects, saves and local files in your browser, what the HTTP API does with request data, and which license terms apply. Canonical page: https://www.glyphfield.com/docs/artifacts/storage-and-privacy Markdown: https://www.glyphfield.com/docs/artifacts/storage-and-privacy.md ## Browser projects [#browser-projects] The Studio keeps projects, open tabs, the active tool and folder, most tool drafts, Visual settings and canvas view state in browser `localStorage`. Design Lab, Animation, Lottie and the expression tools (OpenGraph, Terminal card, Partnership lockup, Blog cover and Slide templates) keep named saves and complete autosaves in IndexedDB. Converted assets and captured shader frames are also stored in IndexedDB. A small recovery journal in `localStorage` holds the newest portable source while the page unloads, and it is cleared once IndexedDB has the same version. All of this data belongs to the current origin and browser profile. Closing a project tab does not delete the project. **Delete active project** asks for confirmation, and **Delete project** then removes that project from the project list in this browser. The deletion cannot be undone. Built-in identities cannot be deleted. ## Local files [#local-files] The browser loads the images, logos, fonts, Lottie files and shader inputs that you upload. Some are held in temporary object URLs for the current page session. Converted assets and portable canvas records can store embedded copies locally. A downloaded artifact contains or embeds the selected visual input where its format allows. Clearing site data can remove projects, drafts, saved designs and converted assets. Export the identity and source documents and keep the original authorized files before clearing the origin when the work must survive. Named saves and autosaves let you recover work inside the current browser, but they are not off-device backups. [Backup and restore](/docs/artifacts/backup-and-restore) describes a lasting backup of source and files. Pausing Design Lab and exporting PNG, JPG, GIF or MP4 do not create captured-frame assets. **Capture shader frame** stores a lossless PNG checkpoint with the editable shader recipe, and named saves and portable source keep these checkpoints. Playback and extending the time explorer do not encode or save new shader frames. ## HTTP requests [#http-requests] `POST /api/generate` processes request data in memory and does not store the submitted identity or assets. Its responses send `Cache-Control: no-store`. `POST /api/brand/validate` and `POST /api/brand/kit` are also stateless and send `no-store`. The GET discovery routes are public. `/api/agent`, `/api/labs`, `/api/materials`, `GET /api/generate` and `/openapi.json` allow caching for 300 seconds. The agent routes send `Access-Control-Allow-Origin: *`, so pages on other origins can call them. ## Analytics [#analytics] The public site measures visits with Google Analytics 4: the pages viewed, the device and an approximate location, to see which parts of Glyphfield people use. Analytics does not read projects, saves or uploaded files, and nothing it collects is used for ads or ad personalization. Visitors in the EEA, the UK and Switzerland are measured without analytics cookies (Google Consent Mode). The [Google Analytics opt-out browser add-on](https://tools.google.com/dlpage/gaoptout) turns the measurement off. ## Asset limits [#asset-limits] * Submit only assets you are authorized to process. * The API does not fetch remote URLs. * Custom images must be base64 data URLs of GIF, JPEG, PNG, SVG or WebP files, up to 5,000,000 characters each. * A request body cannot exceed 5,250,000 bytes. * Bundled General Translation and reference-brand assets remain the property of their owners. ## License [#license] Glyphfield's source is open-source software released under the MIT License. You may use, copy, modify, merge, publish, distribute, sublicense and sell the software under the notice and warranty terms in `LICENSE`. The software license does not grant rights to bundled third-party marks, reference-brand assets or assets that users submit. [Licensing](/docs/reference/licensing) lists the material that keeps its own terms. --- # Agent integration Connect a language model or coding agent to Glyphfield through the discovery routes, the generation API, the Studio Browser API and the Markdown docs. Canonical page: https://www.glyphfield.com/docs/agents Markdown: https://www.glyphfield.com/docs/agents.md Glyphfield is an open-source brand design studio. It gives coding agents and language models three interfaces. The HTTP routes describe the product and generate files. The Studio Browser API (`window.glyphfield.studio`) operates the open Studio in a browser. The documentation is available as Markdown. An agent can read the whole product contract from these interfaces without parsing the application's JavaScript. ## Discovery routes [#discovery-routes] | Route | Returns | | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | `/llms.txt` | A short guide for language models that routes each task to an interface | | `/llms-full.txt` | Every documentation page in one text file, built from the current MDX | | `/docs/.md` or `/api/docs/` | One documentation page as processed Markdown | | `/api/agent` | The versioned agent manifest with policies, resources, the generation contract and the Browser API contract | | `/openapi.json` | The OpenAPI 3.1 document for the HTTP routes | | `/api/catalog` | Studio tools, resource URLs, and summaries of the shader and tactile surface libraries | | `/api/labs` | Every Studio tool with its capabilities and agent access | | `/api/materials` | Every shader material and image effect with attribution, palettes, look presets and controls | | `/api/identities` | The nine built-in brand identities | | `/api/elements` | The brand element templates with their IDs, sizes and formats | | `/api/generate` | The generation contract (`GET`) and the generation endpoint (`POST`) | | `/api/brand/validate` | The BrandIdentity JSON Schema (`GET`) and stateless identity validation (`POST`). See [Brand setup with an agent](/docs/agents/brand-setup) | | `/api/brand/kit` | Brand kit token files and `brand.md` rendered from an identity (`POST`) | | `/api/search?query=` | Ranked documentation search results | | `/studio` | The browser workspace that registers the Browser API | | `skills/` in the repository | Five installable Agent Skills for composition, HTTP generation, Studio operation, export and brand setup | ## Interfaces [#interfaces] ### HTTP generation [#http-generation] `POST /api/generate` returns template SVGs, background SVGs, element briefs and apply-ready Design Lab documents. The same request always returns the same result, and no browser is involved. See [Generation API](/docs/agents/generate). ### Studio Browser API [#studio-browser-api] Open `/studio` in a browser the agent controls when the result needs Canvas, WebGL or WebGPU rendering, local fonts or images, visual placement, PNG or JPG rasters, GIF or MP4 encoding, or Lottie. The Browser API reads and applies the active tool's source. It lists and operates the controls in the active tool's workspace, and it exports the same files as the UI. See [Browser-agent workflow](/docs/agents/browser-workflow). ### Markdown documentation [#markdown-documentation] Read `/llms.txt` to route a task. Load `/llms-full.txt` for the complete product model, or one page as Markdown when the task needs only one topic. These routes and the human documentation come from the same MDX source. Use the smallest interface that can produce the requested artifact. The interfaces also combine: an HTTP `design-sequence` document is rendered and exported through the Browser API. ## Agent workflow [#agent-workflow] 1. Read the live contract and catalog IDs. 2. Read the current source before changing an open artifact. 3. Keep unknown fields and apply the smallest change through the tool's validator. 4. Read the state again after applying it. 5. Inspect the rendered output when appearance matters. 6. Check the saved file or the returned Blob. A successful request or click does not prove that the file exists. ## Authentication [#authentication] The public agent routes do not require authentication. Do not send an `Authorization` header. Read `/api/agent` and `GET /api/generate` at the start of each task, because schemas can change between releases. Install the [Glyphfield Skills](/docs/skills), then continue with [Choose an agent interface](/docs/agents/choose-interface), [Connect an agent](/docs/agents/connect) and [Agent recipes](/docs/agents/recipes). --- # Choose an agent interface Decide whether an agent task belongs to the HTTP generation API, the Studio Browser API or the Markdown docs, with worked examples for common requests. Canonical page: https://www.glyphfield.com/docs/agents/choose-interface Markdown: https://www.glyphfield.com/docs/agents/choose-interface.md Glyphfield offers agents three interfaces: the HTTP routes, the Studio Browser API (`window.glyphfield.studio`, available in an open `/studio` page) and the documentation as Markdown. Choose the interface before writing a request. ## Routing table [#routing-table] | Task | Interface | Reason | | ---------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------- | | Find tool, identity, shader, surface or element IDs, schemas or policies | HTTP discovery routes such as `/api/agent` and `/api/materials` | Structured, versioned JSON | | Generate a slide, blog cover, OpenGraph image, terminal card, partnership lockup, background, element brief or Design Lab document | `POST /api/generate` | Validated input and a portable response without a browser | | Render Canvas or WebGL output, use local fonts or files, place layers visually, or export PNG, JPG, GIF, MP4 or Lottie | `window.glyphfield.studio` | Uses the Studio renderer and the open project | | Read one topic | `/docs/.md` | One processed Markdown page | | Load all documentation | `/llms-full.txt` | Every page in one file | | Find an unknown topic or capability | `/api/search?query=` or `/api/catalog` | Ranked documentation results or structured capabilities | Source-controlled SVG, JSON briefs, repeatable requests and starting documents for Design Lab. Work that depends on the open canvas, WebGL, browser codecs, local files or a visual check. Instructions, workflows, examples, edge cases and exact source formats. The visible workspace shows placement, contrast, clipping, timing and motion. ## Decision order [#decision-order] 1. Read `/llms.txt` and `/api/agent`. 2. Look up the exact tool ID or generation kind in the discovery routes. Do not guess IDs. 3. Use `POST /api/generate` when it can express the whole result. 4. Open `/studio` and use the Browser API when the result depends on Canvas, WebGL, browser codecs, local files or visual placement. 5. Pass `response.document` from a `design-sequence` response to `applySource` yourself. An HTTP request does not change the open Studio. 6. Inspect the canvas and export through the active tool. 7. Treat the downloaded file or the returned Blob as the end of the task. ## Examples [#examples] ### Static agenda slide [#static-agenda-slide] Use HTTP. The slide renderer returns SVG and needs no open project. ### Gem Smoke poster with motion [#gem-smoke-poster-with-motion] Generate a `design-sequence` document over HTTP, then apply and export it in the browser. The server returns the composition, and the browser renders the shader pixels. ### Change to an existing local project [#change-to-an-existing-local-project] Use the Browser API. Read the open tool's source, apply the smallest change, and save or export in that project. An HTTP request cannot tell which browser-local project the user means. ### Brand element brief [#brand-element-brief] Find the element ID in `/api/elements` and send `POST /api/generate` with `kind: "element-brief"`. Open the Studio only when the user also wants a rendered proof. ## Interface boundaries [#interface-boundaries] * A source document from the Studio source drawer is not a `/api/generate` request body. * A discovery record is not a rendered artifact. * A successful HTTP response does not update a browser-local design. * Activating a control does not mean that an export finished. * A material preview does not grant the right to redistribute a third-party asset. See [Connect an agent](/docs/agents/connect), [Studio Browser API](/docs/reference/browser-api) and [Capability matrix](/docs/reference/capability-matrix). --- # Connect an agent Point an agent at a Glyphfield deployment, read the discovery routes in order, send a first generation request, and hand Design Lab documents to the browser. Canonical page: https://www.glyphfield.com/docs/agents/connect Markdown: https://www.glyphfield.com/docs/agents/connect.md An agent connects to a Glyphfield origin: the base URL of a deployment, or `http://localhost:3012` for a local development server. The API routes send `Access-Control-Allow-Origin: *`, so a web page on another origin can call them. ## Discovery order [#discovery-order] Follow these steps for each new origin: 1. Read `/llms.txt` for the short guide. Read `/llms-full.txt` when the task needs the complete product model. 2. Read `/api/agent` for the API version, policies, resources and contracts. 3. Read `/api/labs` for the Studio tools. 4. Read `/api/catalog` when choosing a background or tactile surface. Its `surfaceLibrary` holds every surface preset with its attribution and controls. 5. Read `/api/materials` when choosing a shader or an image effect. 6. Read `/api/identities` when using a built-in identity. 7. Read `/api/elements` when choosing a brand element. 8. Read `GET /api/generate` right before building a request. Validate the body against its `requestSchema` when the client supports JSON Schema. 9. Send the request to `/api/generate` as `POST` with `Content-Type: application/json`. 10. Save the returned artifact. For a `design-sequence` response, apply its `document` through `window.glyphfield.studio` and export in the browser. Use only the enum values that the contract lists. Read the structured routes instead of the client JavaScript bundle. ## Shell check [#shell-check] ```bash BASE_URL=http://localhost:3012 curl -fsS "$BASE_URL/llms.txt" curl -fsS "$BASE_URL/api/agent" | jq '{ version, schemaVersion, resources, interfaces, execution }' curl -fsS "$BASE_URL/api/labs" | jq '{ count, plugins: [.plugins[].id] }' curl -fsS "$BASE_URL/api/catalog" | jq '{ surfaces: .surfaceLibrary.count, surfaceControls: (.surfaceLibrary.controls | keys) }' curl -fsS "$BASE_URL/api/materials" | jq '{ count, engines, sharedBy }' curl -fsS "$BASE_URL/api/generate" | jq '{kinds: (.kinds | keys), requestSchema}' ``` For a deployed instance, set `BASE_URL` to its origin. ## TypeScript discovery client [#typescript-discovery-client] ```ts const baseUrl = 'http://localhost:3012'; const [manifest, labs, materials, generation, identities, elements] = await Promise.all([ fetch(`${baseUrl}/api/agent`).then((response) => response.json()), fetch(`${baseUrl}/api/labs`).then((response) => response.json()), fetch(`${baseUrl}/api/materials`).then((response) => response.json()), fetch(`${baseUrl}/api/generate`).then((response) => response.json()), fetch(`${baseUrl}/api/identities`).then((response) => response.json()), fetch(`${baseUrl}/api/elements`).then((response) => response.json()), ]); console.log(manifest.version, labs.count, materials.count, generation.schemaVersion); console.log(identities.identities.length, elements.elements.length); console.log(manifest.studioBrowserApi.global); ``` The discovery requests do not depend on each other, so they can run in parallel. Read the generation contract again if much time passes before the request. ## First generation request [#first-generation-request] ```ts const response = await fetch(`${baseUrl}/api/generate`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ kind: 'template', template: 'slides', slideLayout: 'title', texture: 'white', title: 'Code is the source of truth.', identity: { preset: 'gt' }, output: 'raw', }), }); if (!response.ok) throw new Error(await response.text()); const svg = await response.text(); ``` With `output: 'raw'`, the response body is a complete SVG document. ## Design Lab sequence [#design-lab-sequence] `POST /api/generate` builds the source document for Design Lab, the layered composition tool. The Browser API then renders it with the same shader canvases and compositor as the Studio UI. ```ts const response = await fetch(`${baseUrl}/api/generate`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ kind: 'design-sequence', identity: { preset: 'gt' }, shader: { materialId: 'paper-gem-smoke' }, sequence: { cutCount: 10, finalHoldMs: 5000, pace: 'accelerating' }, effect: { kind: 'bayer', opacity: 0.76 }, texts: [{ value: 'Open Source', weight: 500 }], export: { width: 1920, fps: 30, quality: 'best' }, }), }); const generated = await response.json(); // Run inside /studio?tool=material, the Design Lab page. const studio = window.glyphfield.studio; if (studio.activeTool() !== 'material') throw new Error('Open Design Lab first.'); await studio.applySource(generated.document); const artifact = await studio.invoke('design.export', { format: 'mp4', mode: 'shader-sequence', download: true, }); ``` Call `studio.describe()` before tool-specific actions. It returns each action's input and output contract. Its capability record marks each export as a direct Browser action (`browser-action`), a visible control (`browser-control`) or HTTP generation (`http`). `studio.controls()`, `activate(label)` and `set(label, value)` operate the visible controls of the active tool by accessible label, which covers tools that have no export action. `design.export` takes `png`, `jpg`, `gif` or `mp4`. Leave out `download` to receive only the returned Blob, and call `studio.download(artifact)` to save it later. ## Agent prompt [#agent-prompt] Give a language model the guide URL instead of pasting the schema into the prompt: ```text Read https://YOUR_ORIGIN/llms.txt and the linked agent manifest. Generate a white GT agenda slide titled “One system, every market.” Save the raw SVG response as gt-agenda.svg. Do not use undocumented enum values. ``` The deployment's own contract then decides which fields are valid. For broad implementation work, point to `/llms-full.txt` instead. For a focused task, point to one page, such as `/api/docs/studio/design-lab` or `/api/docs/reference/browser-api`. ## Browser source workflow [#browser-source-workflow] When `POST /api/generate` cannot express the artifact, open the matching Studio tool and use `window.glyphfield.studio`. Use `readSource` and `applySource` for exact documents, and use `controls`, `activate` and `set` for visible operations. Source stays readable while the tool is active, whether or not the source drawer is open. The source drawer (**File** → **Edit source code**) shows the same document to a person. Do not send a Studio source document to `POST /api/generate`. A source document is the browser-local state of one open tool, and the generation route has its own versioned contract. Only a `design-sequence` response contains an apply-ready `document`. See [Browser-agent workflow](/docs/agents/browser-workflow), [Source code editing](/docs/studio/source-editing) and [Source format reference](/docs/reference/source-formats). --- # Generation API Generate template SVGs, background SVGs, element briefs and apply-ready Design Lab documents with POST /api/generate and its versioned JSON contract. Canonical page: https://www.glyphfield.com/docs/agents/generate Markdown: https://www.glyphfield.com/docs/agents/generate.md `POST /api/generate` accepts a JSON body with `Content-Type: application/json`. The `kind` field selects one of four generators: `template` (the default), `background`, `element-brief` and `design-sequence`. `GET /api/generate` returns the current contract (`schemaVersion` 3) with the request schema, value ranges and examples. Read it before building a request. A top-level field that the contract does not define is rejected with `unknown_field`. ## Output [#output] * `template` and `background` return a JSON envelope by default (`output: "json"`). The SVG is in `artifact.content`. * `output: "raw"` returns the SVG itself as `image/svg+xml`. * `element-brief` and `design-sequence` always return JSON. Successful responses send `Cache-Control: no-store` and a `Content-Disposition` header with the file name. ## Design sequence [#design-sequence] A `design-sequence` request builds a document for Design Lab, the Studio's layered composition tool. The document holds a shader sequence: a series of cuts through other materials that ends on the chosen material and holds it. The composition can also include the identity's brand mark, text layers and one converter effect. ```json { "kind": "design-sequence", "identity": { "preset": "gt" }, "ratio": "wide", "backgroundColor": "#111216", "shader": { "materialId": "paper-gem-smoke", "shaderSize": 1 }, "sequence": { "cutCount": 10, "finalHoldMs": 5000, "pace": "accelerating" }, "effect": { "kind": "bayer", "opacity": 0.76, "foreground": "#F5F5F2", "background": "#111216" }, "texts": [{ "value": "Open Source", "weight": 500 }], "export": { "width": 1920, "fps": 30, "quality": "best" } } ``` | Field | Values | | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------- | | `shader.materialId` | Any ID listed by `/api/materials` (default `paper-gem-smoke`). Retired material IDs are rejected | | `shader.shaderSize` | Material zoom from 0.1 to 10 (default 1) | | `shader.opacity`, `shader.blendMode` | 0–1; `normal`, `multiply`, `overlay` or `screen` | | `shader.settings` | Shared material controls from `/api/materials`, and `effectProps` for Shaders.com materials | | `sequence.cutCount` | 8–12 cuts (default 10) | | `sequence.finalHoldMs` | 3000–6000 ms (default 5000) | | `sequence.pace` | `accelerating` (default) or `even` | | `effect.kind` | `bayer` (default), `ascii`, `halftone` or `posterize`, with `opacity`, `foreground`, `background` and converter settings | | `texts` | Up to 32 text layers, each with a `value` of up to 1000 characters | | `includeBrandMark` | `true` by default. An identity without a mark gets a monogram | | `ratio` | `wide` (default), `square` or `opengraph` | | `backgroundColor` | Six-digit HEX (default `#111216`) | | `export` | `width` 320–3840, `fps` 12, 15, 24 or 30, `quality` `fast`, `balanced` or `best`, `durationMs` 1200–4000, `gifLoop` `raw` or `seamless` | Image effects are not part of this request. Add them in the browser with `design.effects.add` after the document is applied. The response is JSON with these fields: * `schemaVersion: 1`: the version of the response envelope. * `document`: an apply-ready Design Lab compatibility source with `version: 3`. * `sequence.timeline` and `sequence.durationMs`: the resolved material IDs and cut boundaries. * `automation`: the browser global and the exact apply and export commands. `document.version` is not the active canvas schema. `applySource(response.document)` validates and migrates the compatibility source. The Design Lab adapter then exposes the normalized result as CanvasDocument schema 2 with Design Lab metadata source version 4. Read the source again after applying it and before making targeted CanvasDocument edits. When the document is applied, Design Lab keeps `export.durationMs` only if it is 1200, 1600, 2400 or 4000 and uses 1600 otherwise. Apply and render inside `/studio?tool=material`: ```js await window.glyphfield.studio.applySource(response.document); const artifact = await window.glyphfield.studio.invoke( 'design.export', { format: 'mp4', mode: 'shader-sequence', download: true } ); ``` Choose `png`, `jpg`, `gif` or `mp4`. `mode: 'shader-sequence'` works with GIF and MP4 only. The export action resolves to the same artifact object that the UI produces, rendered with the live shader canvases, composition effects, text, marks, layer order and output settings. `download: true` also saves the file. ## Templates [#templates] The `template` kind renders the Studio's brand templates as standalone SVG: OpenGraph images, terminal cards, slides, blog covers and partnership lockups. It uses the same layouts and renderer as the Studio and embeds the brand's font files and images, so the SVG renders in the brand typeface inside a plain `` element. A font whose data URL is longer than 560,000 characters is not embedded. Each request renders one page. When a request leaves out copy, the identity fills it in. Proof figures fill metrics slides, strategy pillars fill agenda slides, and the identity's own proof partner fills lockups. A lockup without a partner shows the placeholder text “Partner”. ```json { "kind": "template", "template": "slides", "slideLayout": "agenda", "texture": "white", "title": "One system, every market.", "body": "Foundation\nExpression\nApplication\nDelivery", "identity": { "preset": "gt" }, "output": "raw" } ``` | Field | Values | | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `template` | `slides` (default), `blog`, `partnership`, `opengraph` or `terminal` | | `slideLayout` | Slides only: `title`, `section`, `agenda`, `split`, `metrics`, `quote`, `timeline`, `statement`, `comparison`, `process`, `chart`, `team`, `image` or `closing` | | `layout` | `opengraph`: `split`, `statement`, `media`, `centered`, `editorial`. `blog`: `editorial`, `feature`, `statement`, `centered`, `ledger`. `terminal`: `card`, `split`, `focus`, `caption`. `partnership`: `lockup`, `centered`, `hero`, `announcement`. Slides also accept `layout`, and sending both `layout` and `slideLayout` is an error | | `format` | `opengraph`, `wide`, `square`, `portrait`, `story`, `linkedin` or `lockup`. Slides use `16x9`, `4x3` or `square` | | `texture` | `white`, `dark`, `grid` or `noise` | | `language` | Terminal only: `typescript`, `tsx`, `javascript`, `python`, `bash`, `json`, `html` or `css` | | `title` | 1–240 characters | | `body` | 1–1000 characters, or 4000 for `terminal`. Slides read one list item per line, terminal cards read it as code, and other layouts use it as supporting copy where they have a slot for it | | `background`, `foreground` | Six-digit HEX colors for the page surface and for every text layer | | `backgroundImageDataUrl`, `partnerLogoDataUrl` | Base64 image data URLs of up to 5,000,000 characters | | `partnerId` | For `partnership`: a proof asset ID of the identity, another built-in identity ID, or `template-northstar` | | `output` | `json` (default) or `raw` | The default size is 1600 × 900 for slides, 1200 × 630 for OpenGraph, terminal and blog, and 1200 × 600 for partnership. `format` changes it. The file name is `-