{
  "openapi": "3.1.1",
  "info": {
    "title": "Pixel \u0026 Grid Font Maker API",
    "version": "1.0.0",
    "summary": "Type pixel letters as # and . grids and get an installable TTF font: merged, dotted or tiled.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://luminagridfont.usefulweb.app"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Type pixel letters as # and . grids and get an installable TTF font: merged, dotted or tiled.",
        "description": "Write each glyph as a small grid of # (ink) and . (empty), with 2–5 for diagonal half cells, any size up to 32 × 32 and with descender rows. Choose merged outlines, round dots or separate squares, proportional or monospace widths and letter spacing, and download a verified TrueType font. Lumina Glyph Lab edits the same text with a live preview.\n\nMethodology:\n- Each glyph block starts with its character (or U+XXXX, or space) followed by equal-height rows. # 1 X @ █ are full cells, . 0 _ and spaces are empty, 2–5 are half cells cut along a diagonal (2 top-left, 3 top-right, 4 bottom-right, 5 bottom-left; the Grid Font Builder tiles). Short rows are padded with empty cells.\n- The rows above the baseline fill the cap height: one cell is round(700 / rows above the baseline) font units at 1000 units per em. Merged cells are traced into combined outlines (shared edges cancel, touching corners stay separate loops); dots are eight-point quadratic B-spline circles; separate squares are inset by half the remaining gap.\n- Proportional widths trim empty columns at both sides; monospace keeps the whole grid. Letter spacing adds half the chosen cells on each side. Without a space glyph the space is half the grid height wide (or the full grid in monospace).\n- The font is written and read back by the Lumina TrueType writer (same checks as the lumina-font-builder tool).\n\nPixel fonts look crisp when the font size is a multiple of the cell size on screen. The fonts have no hinting or embedded bitmaps; kerning and ligatures are not generated.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "lumina_grid_font",
        "x-owner-app": "lumina",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LuminaGridFontInput"
              },
              "examples": {
                "example1": {
                  "summary": "5 × 7 pixel font with descenders",
                  "value": {
                    "grid": "A\n.###.\n#...#\n#...#\n#####\n#...#\n#...#\n#...#\n.....\n.....\n\nB\n####.\n#...#\n#...#\n####.\n#...#\n#...#\n####.\n.....\n.....\n\nC\n.###.\n#...#\n#....\n#....\n#....\n#...#\n.###.\n.....\n.....\n\nE\n#####\n#....\n#....\n####.\n#....\n#....\n#####\n.....\n.....\n\nH\n#...#\n#...#\n#...#\n#####\n#...#\n#...#\n#...#\n.....\n.....\n\nI\n###\n.#.\n.#.\n.#.\n.#.\n.#.\n###\n...\n...\n\nL\n#....\n#....\n#....\n#....\n#....\n#....\n#####\n.....\n.....\n\nO\n.###.\n#...#\n#...#\n#...#\n#...#\n#...#\n.###.\n.....\n.....\n\nP\n####.\n#...#\n#...#\n####.\n#....\n#....\n#....\n.....\n.....\n\nX\n#...#\n#...#\n.#.#.\n..#..\n.#.#.\n#...#\n#...#\n.....\n.....\n\ng\n.....\n.....\n.####\n#...#\n#...#\n#...#\n.####\n....#\n.###.\n\np\n.....\n.....\n####.\n#...#\n#...#\n#...#\n####.\n#....\n#....\n\ny\n.....\n.....\n#...#\n#...#\n#...#\n#...#\n.####\n....#\n.###.\n\n1\n.#.\n##.\n.#.\n.#.\n.#.\n.#.\n###\n...\n...\n\n2\n.###.\n#...#\n....#\n..##.\n.#...\n#....\n#####\n.....\n.....\n\n!\n#\n#\n#\n#\n#\n.\n#\n.\n.\n\n.\n.\n.\n.\n.\n.\n.\n#\n.\n.",
                    "familyName": "Starter Pixel",
                    "module": "merged",
                    "descender": 2,
                    "width": "proportional",
                    "spacing": 1,
                    "size": 0.8,
                    "space": 0,
                    "sample": "HELLO PIXEL gpy 12!",
                    "date": ""
                  }
                },
                "example2": {
                  "summary": "Dot-matrix style from the same grids",
                  "value": {
                    "grid": "A\n.###.\n#...#\n#...#\n#####\n#...#\n#...#\n#...#\n.....\n.....\n\nB\n####.\n#...#\n#...#\n####.\n#...#\n#...#\n####.\n.....\n.....\n\nC\n.###.\n#...#\n#....\n#....\n#....\n#...#\n.###.\n.....\n.....\n\nE\n#####\n#....\n#....\n####.\n#....\n#....\n#####\n.....\n.....\n\nH\n#...#\n#...#\n#...#\n#####\n#...#\n#...#\n#...#\n.....\n.....\n\nI\n###\n.#.\n.#.\n.#.\n.#.\n.#.\n###\n...\n...\n\nL\n#....\n#....\n#....\n#....\n#....\n#....\n#####\n.....\n.....\n\nO\n.###.\n#...#\n#...#\n#...#\n#...#\n#...#\n.###.\n.....\n.....\n\nP\n####.\n#...#\n#...#\n####.\n#....\n#....\n#....\n.....\n.....\n\nX\n#...#\n#...#\n.#.#.\n..#..\n.#.#.\n#...#\n#...#\n.....\n.....\n\ng\n.....\n.....\n.####\n#...#\n#...#\n#...#\n.####\n....#\n.###.\n\np\n.....\n.....\n####.\n#...#\n#...#\n#...#\n####.\n#....\n#....\n\ny\n.....\n.....\n#...#\n#...#\n#...#\n#...#\n.####\n....#\n.###.\n\n1\n.#.\n##.\n.#.\n.#.\n.#.\n.#.\n###\n...\n...\n\n2\n.###.\n#...#\n....#\n..##.\n.#...\n#....\n#####\n.....\n.....\n\n!\n#\n#\n#\n#\n#\n.\n#\n.\n.\n\n.\n.\n.\n.\n.\n.\n.\n#\n.\n.",
                    "familyName": "Starter Dots",
                    "module": "dots",
                    "descender": 2,
                    "width": "monospace",
                    "spacing": 1,
                    "size": 0.85,
                    "space": 0,
                    "sample": "HELP 12.",
                    "date": "2026-11-08"
                  }
                },
                "example3": {
                  "summary": "Diagonal half cells in a 4 × 4 grid",
                  "value": {
                    "grid": "A\n.25.\n2##5\n#..#\n#..#\n\nV\n#..#\n#..#\n4##3\n.43.",
                    "familyName": "Tiny Diagonals",
                    "module": "merged",
                    "descender": 0,
                    "width": "proportional",
                    "spacing": 1,
                    "size": 0.8,
                    "space": 0,
                    "sample": "AVA",
                    "date": ""
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LuminaGridFontResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "LuminaGridFontInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "grid": {
            "title": "Glyph grids (a character on its own line, then rows of # and .; blank line between glyphs)",
            "type": "string",
            "maxLength": 400000,
            "default": "A\n.###.\n#...#\n#...#\n#####\n#...#\n#...#\n#...#\n.....\n.....\n\nB\n####.\n#...#\n#...#\n####.\n#...#\n#...#\n####.\n.....\n.....\n\nC\n.###.\n#...#\n#....\n#....\n#....\n#...#\n.###.\n.....\n.....\n\nE\n#####\n#....\n#....\n####.\n#....\n#....\n#####\n.....\n.....\n\nH\n#...#\n#...#\n#...#\n#####\n#...#\n#...#\n#...#\n.....\n.....\n\nI\n###\n.#.\n.#.\n.#.\n.#.\n.#.\n###\n...\n...\n\nL\n#....\n#....\n#....\n#....\n#....\n#....\n#####\n.....\n.....\n\nO\n.###.\n#...#\n#...#\n#...#\n#...#\n#...#\n.###.\n.....\n.....\n\nP\n####.\n#...#\n#...#\n####.\n#....\n#....\n#....\n.....\n.....\n\nX\n#...#\n#...#\n.#.#.\n..#..\n.#.#.\n#...#\n#...#\n.....\n.....\n\ng\n.....\n.....\n.####\n#...#\n#...#\n#...#\n.####\n....#\n.###.\n\np\n.....\n.....\n####.\n#...#\n#...#\n#...#\n####.\n#....\n#....\n\ny\n.....\n.....\n#...#\n#...#\n#...#\n#...#\n.####\n....#\n.###.\n\n1\n.#.\n##.\n.#.\n.#.\n.#.\n.#.\n###\n...\n...\n\n2\n.###.\n#...#\n....#\n..##.\n.#...\n#....\n#####\n.....\n.....\n\n!\n#\n#\n#\n#\n#\n.\n#\n.\n.\n\n.\n.\n.\n.\n.\n.\n.\n#\n.\n."
          },
          "familyName": {
            "title": "Font name",
            "type": "string",
            "maxLength": 63,
            "default": "My Pixel Font"
          },
          "module": {
            "title": "Cell style",
            "type": "string",
            "enum": [
              "merged",
              "dots",
              "gap"
            ],
            "default": "merged"
          },
          "descender": {
            "title": "Rows below the baseline",
            "type": "integer",
            "minimum": 0,
            "maximum": 16,
            "default": 2
          },
          "width": {
            "title": "Glyph widths",
            "type": "string",
            "enum": [
              "proportional",
              "monospace"
            ],
            "default": "proportional"
          },
          "spacing": {
            "title": "Letter spacing (cells)",
            "type": "number",
            "minimum": 0,
            "maximum": 8,
            "default": 1
          },
          "size": {
            "title": "Dot or square size (share of a cell, for dots and separate squares)",
            "type": "number",
            "minimum": 0.3,
            "maximum": 1,
            "default": 0.8
          },
          "space": {
            "title": "Space width (cells, 0 = automatic)",
            "type": "number",
            "minimum": 0,
            "maximum": 32,
            "default": 0
          },
          "sample": {
            "title": "Sample text for the preview",
            "type": "string",
            "maxLength": 120,
            "default": ""
          },
          "date": {
            "title": "Creation date written into the font (optional, YYYY-MM-DD)",
            "type": "string",
            "maxLength": 10,
            "default": ""
          }
        },
        "required": [
          "grid"
        ]
      },
      "LuminaGridFontResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "familyName",
              "cellUnits",
              "rows",
              "columns",
              "glyphs",
              "file",
              "warnings"
            ],
            "properties": {
              "familyName": {
                "type": "string"
              },
              "cellUnits": {
                "type": "integer"
              },
              "rows": {
                "type": "integer"
              },
              "columns": {
                "type": "integer"
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "glyphs": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "character",
                    "name",
                    "advance",
                    "cells",
                    "contours"
                  ],
                  "properties": {
                    "character": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "advance": {
                      "type": "integer"
                    },
                    "cells": {
                      "type": "integer"
                    },
                    "contours": {
                      "type": "integer"
                    }
                  }
                }
              },
              "file": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "filename",
                  "bytes",
                  "sha256",
                  "glyphs",
                  "kerningPairs",
                  "verified",
                  "checks",
                  "artifactUrl",
                  "fontBase64"
                ],
                "properties": {
                  "filename": {
                    "type": "string"
                  },
                  "bytes": {
                    "type": "integer"
                  },
                  "sha256": {
                    "type": "string"
                  },
                  "glyphs": {
                    "type": "integer"
                  },
                  "kerningPairs": {
                    "type": "integer"
                  },
                  "verified": {
                    "type": "boolean"
                  },
                  "checks": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "name",
                        "passed",
                        "detail"
                      ],
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "passed": {
                          "type": "boolean"
                        },
                        "detail": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "artifactUrl": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "fontBase64": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}