Fork me on GitHub
#membrane
<
2022-01-15
>
zimablue19:01:43

SIde stupid question - this isn't quite the place but you might know - is xterm.js the most "evolved" implementation of rich/unicode text on webGL? would that be recommended to read/fork as a starting place for that?

phronmophobic20:01:29

I'm not sure what you mean. I thought xterm used the 2d canvas API and not webGL?

phronmophobic20:01:50

As I mentioned in the other thread, it might be helpful to describe what you're working on.

zimablue20:01:38

I think it's webGL now, or at least someone put a lot of work into trying: https://github.com/xtermjs/xterm.js/issues/2033

👍 1
zimablue20:01:50

I said there, trying to build a visual programming ish tool, I've built custom tools in react before but by no means an expert, wondering if it's time to jump away from DOM

zimablue20:01:10

it seems like if one wants to do that, interesting graphics are now easier but text is harder, that's why I was searching around for text implementations

zimablue20:01:27

btw I read most of your blog series on membrane already, I found it very informative thank you

phronmophobic21:01:55

thanks! If you have any feedback or suggestions for ways to improve or clarify anything in the posts, I'm very open to criticism.

phronmophobic21:01:06

Improved programming tools is one of the main target use cases for membrane. Im still working on the ideas and tools for the 4th blog post.

zimablue21:01:45

well, if you have any idea the best place for me to look for a reference implementation or library for text-heavy applications on canvas/webGUI let me know, so far all I saw is xterm.js, "primrose" and "carota"

phronmophobic22:01:26

There's lots of applications that use text. Another example off the top of my head is CodeMirror. For performance, it depends a lot on what you're trying to do, what the bottlenecks are, common usage etc. I thought displaying text was one area where the DOM actually worked well. It still depends on usage though.

phronmophobic22:01:29

Unless you're 100% sure that drawing text will be a significant bottle neck and there's no way to replace the renderer in the future (like xterm.js did), then I would probably just use whichever graphics library seems most comfortable.

zimablue23:01:59

AFAIK there's few that actually "paint" the text though, only ones using canvas/webGL or the very low levels of a desktop app framework like I assume buried somewhere in WPF, qt

zimablue23:01:21

so if I'm committed to be in web, not use DOM, I need to find a library or reference

phronmophobic00:01:35

fwiw, I've found text rendering to be pretty fast. If you do need some speedups, you can do some basic draw caching (eg. by line) and that should be fast enough for most use cases.

phronmophobic00:01:02

It's probably fast enough without draw caching for most use cases as well.