---
name: alphabeta-project
description: Generate importable AlphaBeta Studio project files (.alphabeta.json) — complete typeface projects with drawn glyph outlines that a user can open in the studio and export as installable OTF/TTF/WOFF2 fonts. The file defines its own character set, so any Unicode script works (Latin, Persian, Japanese, Greek, …). Use when asked to create a font, typeface, or glyph set for AlphaBeta Studio, or to convert existing outline data into its project format.
---

# Creating AlphaBeta Studio project files

AlphaBeta Studio (an in-browser type foundry) opens portable project files
with the extension `.alphabeta.json`. You can author one as plain JSON; the
user imports it from the landing page (the "Import a project" card, click
or drag-and-drop) or from the studio's actions menu, then edits every
glyph and exports a real font.

**The file defines its own character set.** Glyphs can use any Unicode
codepoints — the app's built-in presets (Latin, Farsi) are just starting
points and place no restriction on imports. A Japanese, Greek, or
mixed-script project file is fully supported.

## File skeleton (format version 2)

```json
{
  "kind": "alphabeta-studio.project",
  "version": 2,
  "project": {
    "name": "<family name>",
    "styleName": "Regular",
    "designer": "<credit>",
    "charset": [<unicode codepoints, decimal>],
    "metrics": { "unitsPerEm": 1000, "ascender": 800, "descender": -200, "capHeight": 700, "xHeight": 500 },
    "glyphs": { "<codepoint>": { "commands": [...], "advanceWidth": 600, "leftSideBearing": 50 } },
    "preview": { "text": "<sample text>", "sizePx": 96, "trackingEm": 0 }
  }
}
```

- `kind` and `version: 2` are checked exactly; only version 2 exists.
- Everything else is optional with sensible defaults: metrics default to
  the values shown, `advanceWidth` to 600, `leftSideBearing` to 50, and
  `preview.text` to a sample built from the project's own characters.
- `charset` carries the display ORDER of the glyph grid plus any
  planned-but-undrawn cells. It cannot truncate the file: glyphs keyed
  outside `charset` are still imported, appended in codepoint order. Omit
  it entirely and the charset is derived from the glyph keys.
- Glyph map keys are decimal codepoint strings (`"19968"` for 一). No
  other per-glyph fields exist — no statuses, ids, or undo stacks.

## Drawing outlines (`commands`)

Absolute path commands only:

| Shape | Meaning |
|---|---|
| `{ "type": "M", "x", "y" }` | start a contour |
| `{ "type": "L", "x", "y" }` | line |
| `{ "type": "C", "x1", "y1", "x2", "y2", "x", "y" }` | cubic bezier |
| `{ "type": "Q", "x1", "y1", "x", "y" }` | quadratic bezier |
| `{ "type": "Z" }` | close contour |

**Coordinate rules (the common failure mode — read carefully):**

1. Units are font units on the `unitsPerEm` grid (default 1000), not pixels.
2. **Y points UP.** Baseline is `y = 0`. Capitals span 0→`capHeight` (700),
   lowercase bodies 0→`xHeight` (500), descenders go negative (to about
   `descender`, −200). CJK glyphs conventionally fill roughly −80…700,
   centered in the advance. If you are converting from SVG (Y-down), flip Y.
3. X grows rightward from 0; keep outlines within `0 … advanceWidth`.
4. Multiple contours per glyph are allowed. Fill rule is **nonzero**:
   counters (the hole of O, the window of 口) must wind opposite to the
   outer contour; same-direction contours union together.
5. No arc commands — approximate circles/arcs with cubics
   (circle ≈ 4 `C` segments, control-point offset ≈ 0.5523 × radius).
6. End every contour with `Z`.

## Sanity checklist before delivering a file

- [ ] `kind` is `"alphabeta-studio.project"`, `version` is `2`
- [ ] glyph map keys are decimal codepoint strings
- [ ] outlines sit on the baseline (lowest filled point of flat-bottomed
      letters at `y = 0`), not floating at mid-em or upside-down
- [ ] counters wind opposite to outers (check O / 口 render with holes)
- [ ] include a space glyph (`"32"`, empty `commands`, advance ~300) if
      the preview text contains spaces
- [ ] `preview.text` only uses characters present in the project

A minimal working file (Japanese: 一 and 口, demonstrating counter
winding) ships next to this skill:
[example.alphabeta.json](./example.alphabeta.json). Full app
documentation: [/llms-full.txt](/llms-full.txt).

Need a character set for a specific language rather than outlines? Sixteen
ready-made templates and per-script recipes live in the
[alphabeta-language-templates skill](../alphabeta-language-templates/SKILL.md).
