canvas is the third base scene of the custom runtime — the right-hand button on the
device, or PUT /api/v1/scene {"base":"canvas"}. it is the one scene nothing on the device draws
by itself: an integration pushes a document of drawing primitives and the device renders it, so
the integration can send data rather than 2,496 bytes of raw rgb.
every picture on this page is a photograph of the panel. they were captured off GET /screen by
runtime/tools/tc002-canvas-docs.py, which drives the device through this same catalogue — so the
documents below and the images of them cannot drift apart. the panel is 52 × 16 pixels; the
images are scaled six times, nearest-neighbour, so a panel pixel is a visible square.
for the api itself — routes, fields, limits, the patch format, what is stored and when — see the
canvas section of RUNTIME.md. this page is the visual counterpart: what
the primitives actually look like on the glass.
a document is a list of elements. push it once, then send only the values that change:
curl -sX PUT http://10.0.0.111/api/v1/canvas -H "Authorization: Bearer $ADMIN" -d '{
"elements": [
{"type":"text","at":[0,0],"font":"mini","colour":"506070","text":"amsterdam"},
{"id":"t","type":"text","at":[0,5],"font":"block","colour":"ffffff","text":"9"},
{"id":"g","type":"sparkline","at":[28,11],"size":[24,5],"style":"bars","colour":"205070",
"min":0,"max":100,"data":[40,45,50,60,55,50,45]}
]}'
# and afterwards, only the readings — no pixels, no layout
curl -sX PATCH http://10.0.0.111/api/v1/canvas -H "Authorization: Bearer $CONTROL" \
-d '{"values":[{"id":"t","text":"11"},{"id":"g","data":[45,50,60,70,65,60,55]}]}'that layout is 361 bytes sent once; each update after it is about 70. the elements that change
carry an id, and the ones that never change do not need one.
small is 5 × 7 and has every printable character. mini is 3 × 5 and carries letters and digits —
it is the face the device's own menus use. block (6 × 10) and big (10 × 14) carry digits and a
colon only, for a number you read across a room. twenty more, imported from pixel fonts made for
led matrices and old pcs, are in imported faces below.
| face | size | characters | a full line |
|---|---|---|---|
small |
5 × 7 | all printable ascii | 8 characters |
mini |
3 × 5 | letters, digits and : / . % ? - |
13 characters |
block |
6 × 10 | digits and : |
7 characters |
big |
10 × 14 | digits and : are what it is for, but it falls back to the 5 × 7 face doubled, so letters do render |
4 characters |
a character costs its width plus one pixel of gap (two for big), so "a full line" above is how
many fit across 52 pixels. anything longer is clipped — or scrolled.
block and big exist for one job: a reading that has to be legible from across the room. they
carry 0–9 and : and nothing else, so a deg or a kW beside them comes from small or
mini.
twenty more faces, imported from pixel fonts drawn for led matrices and old pcs. they are
proportional (the int10h ones are monospaced at 8 columns), they carry far more than ascii, and
text in them is utf-8: "text":"20°C" draws a degree sign. a \n in any text starts a new line
under the last, one row apart (a tile's label and value stay one line each, so there it is a
space). name one as font anywhere a font is
taken — a text element, a plain notification, the clock, a berry script, and (the short ones) the
device menus.
each face's height is trimmed to the rows its letters, digits and latin-1 actually use, so a 16-row text-mode cell whose ink sits in rows 2–12 is an 11-row face here. a glyph reaching outside those rows — the box-drawing set and the full blocks of the cp437 faces — is cut to them.
matrix fonts by trip5 (Matrix-Fonts, mit): latin,
greek and cyrillic, drawn for 8-row led clocks. the x variants drop the descender row and use
the full height for capitals; the 8x6 ones are wider, at most six columns a glyph.
| face | rows | glyphs | a full line of lowercase |
|---|---|---|---|
chunky6 chunky6x light6 light6x |
6 | 441 | 12–13 characters |
chunky8 chunky8x light8 light8x |
8 | 731 | 12–13 characters |
chunky8x6 light8x6 |
8 | 463 | 8 characters |
tiny5 by stefan schmidt (font_tiny5, ofl-1.1;
on google fonts): capitals five rows tall, with latin,
greek, cyrillic and armenian. tiny5-duo doubles the vertical strokes and tiny5-mono is
monospaced. its accented capitals and descenders make the trimmed face 11 rows.
| face | rows | glyphs | a full line of lowercase |
|---|---|---|---|
tiny5 |
11 | 1,941 | 13 characters |
tiny5-duo |
11 | 1,941 | 9 characters |
tiny5-mono |
11 | 2,286 | 8 characters |
int10h — vileR's ultimate oldschool pc font pack
(cc by-sa 4.0): bios and text-mode fonts of real machines, the full cp437 set with its smileys,
card suits, arrows, box drawing and greek; ibm-vga is the extended (pxplus) version, with latin,
greek and cyrillic beyond cp437. eight columns a glyph, so six characters across, and too wide for
seconds on the clock.
| face | from | rows | glyphs |
|---|---|---|---|
phoenix |
the phoenix bios 8×8 | 8 | 255 |
phoenix-2y |
the same, doubled in height | 16 | 255 |
phoenix-8x14 |
phoenix's vga 8×14 | 14 | 255 |
ibm-iso8 |
ibm pc dos's iso 8×16, one-pixel strokes | 15 | 255 |
apricot-xenc |
the apricot xen-c | 14 | 255 |
robotron-a7100 |
the robotron a7100 | 11 | 255 |
ibm-vga |
the ibm vga 8×16, pxplus | 15 | 787 |
a character a face does not have draws as the face's replacement glyph if it has one, and as ?
if it does not: cp437 has no cyrillic, so phoenix draws Ж as ? where ibm-vga has it.
the hand-drawn faces know ascii and one more character: small and mini draw a degree sign, so
21.4°C reads as a temperature in a tile. anything else they lack is one ?.
give a text element a size and it becomes a box: align places the string inside it, and
anything that does not fit is cut off at the box edge rather than running over its neighbour.
filled decides between an outline and a solid block. without a size a rect takes the rest of
the panel.
at is one end, to is the other. lines are drawn with a bresenham walk, so a steep line is a
line rather than two dots.
at is the centre and r the radius; filled again decides between a ring and a disc.
one lit point. the primitive everything else is made of, and occasionally the one you want.
a value from 0 to 100 in its box, with an optional background for the empty part. vertical
fills from the bottom, which is where a level belongs.
a bar can instead watch a transfer the device measures for itself: "watch":"staging" (the
staging directory an in-place update copies the next build into, every file in it summed) or
"watch":"image" (the image a flash copies to /data), with "bytes" the size it will reach.
the renderer measures it every 100 ms while the bar is on the panel and eases to each reading
over 400 ms, so the bar moves as one continuous motion with what has actually arrived. a moving bar
(watching or gliding) is filled to a fraction of a pixel: its leading pixel lights by how far the
fill has got into it, so each new pixel fades in instead of switching on. the watch
is one of those two names, never a path. a renderer that cannot measure (the console's preview)
gets no readings and draws the bar empty; value is ignored while a bar watches. this is the bar
under the update tools' Updating..., Flashing... and Working....
up to 52 samples — one per panel column. three styles, and the same data in each:
with no min and max a sparkline scales to whatever its samples span, so a flat line is flat.
give it a range and two charts become comparable. a threshold recolours the samples that cross
it:
data is a list of numbers. samples can also be sent as data_hex, which costs two characters
each instead of up to four; a json string given as data is refused and told to use data_hex,
because reading "1,2,3" as bytes would draw a wrong picture without saying so.
sixty-one 8 × 8 glyphs built into the runtime. they are monochrome and take the element's
colour, which is why they suit a panel where the palette belongs to the document rather than to
the artwork. GET /api/v1/icons lists them on the device.
anything that needs colours of its own is a sprite: 8 × 8 or 16 × 16 of raw rgb888, uploaded as
octets to PUT /api/v1/sprites/<id> and drawn by id. black is transparent, so a sprite can sit
over something else. eight slots, and they survive a renderer restart.
the ring is the one to look at: the panel shows through its middle because those pixels are black.
the composite an integration reaches for first, and the one place the device makes a layout decision for you. a tile is a glyph, a label and a reading. given room it puts the glyph on the left with the label over the value; where there is not room the label is dropped rather than squeezed or cut off, and the reading — the half worth keeping — stays.
a PATCH value replaces a tile's reading and never its label: the reading is the part that
changes, the label is layout.
at: [x, y] and size: [w, h] are pixels from the top-left. tile: n, of: m divides the panel
into columns and row: n, of: m into rows — the device does the rounding, so the pieces meet
exactly with no gap and no overlap (52 does not divide by three).
a box is not only a position: it aligns what is inside it and cuts off what is not.
elements draw in the order they are given, so the last one wins where they meet. that is what lets a document build up in layers — ground, then chart, then labels on top.
anything may be placed off the panel and what fits is drawn. that is deliberate: it is what lets an element be animated in from outside.
an animation is declared per element, so a document pays for motion only where it asked for it —
a scene of static elements asks the renderer for no frames at all once it has settled. ms is the
period, and phase (0–100) offsets an element within it, so a row of things does not move in
lockstep.
the colour walks the wheel from whatever the element was given as its starting point.
brightness rides up and down, never quite to nothing.
on for its duty cycle, dark for the rest. amount is the duty as a percentage.
up and down by amount pixels, or across with axis: "x".
the flipboard: each character settles out of flipping glyphs, left to right, and then stops. an arrival animation — it runs once when the value arrives rather than forever.
a character at a time, then it holds. also an arrival animation.
for text too wide for its box: a pixel every ms, wrapping once it has left.
a sparkline draws itself in from the left, and starts again whenever its data changes.
a bar whose value changes eases to it from wherever it was drawn: quickly at first, settling
gently, over ms (1,000 unless given). a new value arriving mid-glide sets off from the point the
bar had reached, so a stream of patches — a download, a progress count — moves it smoothly rather
than in jumps. a bar that appears gliding grows from empty. a renderer that only knows a document's
published ages (the console after a reload) draws a gliding bar at its value.
each element runs on its own clock, so a document mixes them freely.
the device starts a document's animations when it installs it, and a document says nothing about
when it was said. so GET /canvas publishes an age_ms for the document and for each element
— a PATCH restarts only the elements whose value actually changed — and a second renderer of the
same document back-dates its own install by those ages to draw the phase the panel is drawing. the
console's preview does exactly that.
every document on this page can also be a notification: POST /notify with elements instead
of text draws it under the notification's lifecycle — a duration or hold, a name to dismiss
it by, stack to queue it behind the current one — and its arrival animations start the moment
it is shown, not when it was queued. the base scene comes back when it leaves, and a restart drops
it, because notifications live in the renderer's memory and never on flash. tc002 notify --data @doc.json sends one; the console's canvas builder has a "send as notification" button; the
Updating... the update tools show is one of these, white tiny5 pulsing over a gliding bar of
how much has been copied, held until the new runtime is up.
posting a document under the name of the one showing updates it in place: no transition, its
continuous animations keep their phase, and an element whose value changed starts its arrival
again — a gliding bar easing to the new value. that is how the update tools drive their bar: the
same notice, posted again with the bar's new value, a few times a second. a document that should show without being saved but is not a notification is a
PUT /canvas with "persist": false.
the demo reels in runtime/tools/ play every one of these on the device, and print what each step
costs:
runtime/tools/tc002-demo-shapes.py -s 10.0.0.111 --token-file tokens
runtime/tools/tc002-demo-text.py -s 10.0.0.111 --token-file tokens
runtime/tools/tc002-demo-charts.py -s 10.0.0.111 --token-file tokens
runtime/tools/tc002-demo-icons.py -s 10.0.0.111 --token-file tokens
runtime/tools/tc002-demo-images.py -s 10.0.0.111 --token-file tokens
runtime/tools/tc002-demo-layout.py -s 10.0.0.111 --token-file tokens
runtime/tools/tc002-demo-tiles.py -s 10.0.0.111 --token-file tokens
runtime/tools/tc002-demo-dashboard.py -s 10.0.0.111 --token-file tokenseach takes --hold, --only, --list and --loop, and each puts back the scene and the
canvas it found. tc002-demo-lint.py checks every document all eight would send — the limits,
the fields, and where the ink actually lands — without a device.
to regenerate every image on this page:
runtime/tools/tc002-canvas-docs.py -s 10.0.0.111 --token-file tokensit needs ffmpeg on the machine running it, for the gifs only — the stills go through a twenty-line
png encoder at the bottom of that file. that is the one tradeoff here: quantising a hue sweep to a
256-colour palette by hand would be a worse use of the repository than a dependency in a
documentation script.
























































