Append a blob payload to the blob table and return its index.
Notes:
Convenience helper that encodes a ZRDL v1 DRAW_TEXT_RUN blob payload from segments and appends it via addBlob().
Finalize and return the ZRDL binary, or error if any command failed.
Clear framebuffer. Emits OP_CLEAR (opcode 1).
Clear framebuffer and fill the viewport with a style.
Why: ZRDL v1 CLEAR carries no style payload. This helper provides a deterministic "clear with background" that works in both raw and widget render modes by emitting CLEAR + FILL_RECT.
Optionalstyle: Readonly<Draw text at (x,y). Strings are interned and deduplicated. Emits OP_DRAW_TEXT (opcode 3).
Optionalstyle: Readonly<Draw a pre-measured text run blob at (x,y). Emits OP_DRAW_TEXT_RUN (opcode 6).
Fill rectangle at (x,y) with size (w,h). Emits OP_FILL_RECT (opcode 2).
Optionalstyle: Readonly<Hide the cursor by emitting SET_CURSOR with visible=false. Convenience method equivalent to setCursor({ ..., visible: false }).
Pop clipping rectangle from clip stack. Emits OP_POP_CLIP (opcode 5).
Push clipping rectangle onto clip stack. Emits OP_PUSH_CLIP (opcode 4).
Reset builder state for reuse. Clears commands, strings, and error state.
Set cursor position and appearance. Emits OP_SET_CURSOR (opcode 7).
Notes:
ZRDL v2 drawlist builder interface.
Extends v1 with SET_CURSOR command for native cursor control. When v2 is negotiated, the engine handles cursor display internally, eliminating the need for "fake cursor" glyphs.