Skip to content

Design file format

A design is a JSON file. The console edits it, agents write it with inkless console show, and inkless print design.json prints it.

Units are millimetres. The origin is the top left of the label as it reads. The printer makes 8 dots per millimetre.

{
"version": 1,
"title": "Parts bin",
"printer": "pm290",
"size": { "widthMm": 48, "heightMm": 30 },
"pages": [{
"id": "page-1",
"elements": [
{ "type": "text", "x": 3, "y": 3, "w": 30, "h": 9, "text": "M3 SCREWS\n12 MM", "font": "sans", "weight": 700 },
{ "type": "text", "x": 3, "y": 13, "w": 30, "h": 3, "text": "socket head · stainless", "font": "mono", "sizePt": 7 },
{ "type": "shape", "shape": "line", "x": 3, "y": 17, "w": 42, "h": 0, "strokeMm": 0.3 },
{ "type": "qr", "x": 37, "y": 19, "w": 8, "h": 8, "value": "https://github.com/apresmoi/inkless" }
]
}]
}
Field Meaning
version Always 1
title Optional name
printer "pm290" or "hp6"
size { widthMm, heightMm }. PM290: up to 48 wide, 5 to 500 long. HP6-C: always 36 × 12
pages One entry per printed label
density Optional burn override
blueprint Settings that made the pages, if Blueprint made them

A page is { id, name?, heightMm?, elements }. heightMm gives one PM290 page its own length.

Every element has id, x, y, w, h, and optionally rotation (degrees clockwise) and invert (white on black in its box). Missing ids are filled in.

type Extra fields
text text, font (sans, serif, mono, display), sizePt (fits the box if left out; 1 pt = 0.3528 mm), weight (400, 700), align, lineHeight
image src (data URL, http(s) URL, or a file path in the CLI), fit (contain, cover, stretch), filter
shape shape (rect, ellipse, line), strokeMm, fill, radiusMm
qr value
barcode value (Code 128)
path d (SVG path data in mm, relative to x/y), strokeMm, fill
Field Meaning
mode dither, threshold, edges, outline or halftone
style For dither: floyd, atkinson or ordered
level Cut-off from 0 to 255; default 128
brightness, contrast -255 to 255; default 0
gamma Default 1
invert Swap black and white
lineMm Stroke width for edges and outline; default 0.25
cellMm Dot spacing for halftone; default 1