FYI: Related Work
@zero-ui: FYI, a while ago @syoyo did some similar work here: https://github.com/syoyo/nanocanvas (duktape bindings to the cross-platform nanovg library).
I contributed a few pull requests and wrote a very simple layout library that runs on it: https://github.com/prust/lightning-layout.
Recently I've needed a more powerful layout library, with horizontal and vertical flow (it looks like the one you have in ZUI has these), so I'm in the middle of extending it, but I've been working on it in Lua (for the excellent LÖVE runtime, which is written on SDL2) & I haven't finished it or ported it back to the JS yet.
I have a private version that has been ported to duktape and bound to dukluv, https://github.com/creationix/dukluv
https://github.com/syoyo/nanocanvas this project is not suitable for my present job
You can provide a e-mail, I sent you a demo program
@zero-ui: My email address is [email protected]
I can't send mail to your mailbox because it has been identified as spam. Please look directly at my newly submitted code