Repository navigation
Renderer Notes
The firmware and desktop emulator share the C++ drawing handlers and canvas. Their request parsers and display-refresh paths differ. This page records behavior at the documented commit, including known limitations.
Commands run sequentially against a framebuffer. Later pixels replace earlier pixels. Transparency skips a pixel instead of blending. Rotation and mirroring change subsequent drawing; they do not transform content already present. clear fills the framebuffer.
The physical refresh creates a white framebuffer. An empty parsed command list skips the physical refresh. An unknown command can still leave a nonempty command list on the firmware, so do not treat a document containing only unknown commands as an intentional no-op.
The normal canvas is 792 × 272 with a top-left origin. Bounds handling is not uniform:
- Points and pixels require an in-bounds anchor.
- Lines and rectangles require both endpoints/corners in bounds.
- Circles must fit their center/radius bounds entirely inside the display.
- Pie sectors can cross edges and are clipped, but their center must be inside.
- Images and text have their own pixel paths; avoid assuming all commands clip identically.
There are existing coordinate inconsistencies. set_pixel adds one to both coordinates. clear_window also shifts by one and uses exclusive ends. The 1×1 around point path compensates for its handler offset, while image pixels and text glyph pixels pass directly to that path and shift one pixel up and left. Pie sectors use direct pixel coordinates. These differences matter when aligning mixed primitives.
The rotation setter changes the rotation field without swapping logical width and height. A 90° or 270° rotation can therefore clip on the rectangular canvas.
See Draw Text for field defaults and limitations. The current renderer wraps at glyph boundaries, does not implement ellipsis, and clips decorations differently from glyphs. Always specify an embedded family, currently helvetica.
Unknown commands are logged/skipped. Most primitive argument errors skip that command. Missing or incorrectly typed rich-text fields can cause the emulator parser to reject the whole document. Do not assume every malformed command allows later commands to render.
Use Examples with the Emulator to inspect layout. The emulator cannot verify physical wiring, power behavior, panel refresh timing, or exact panel colors. Confirm those on hardware.