I have some light graphic design that I need to do in batch, mostly compositing some text and images in simple layouts. And saving images from them. I would like to try Membrane, because I want to learn it more, and because I want to invest in a design system that isn't necessarily beholden to the arbitrary strictures and cruft of browser DOM, and isn't too low level to do basic layout and UI stuff (like maybe Quill or something more pure graphics oriented might be). I have always felt like HTML+CSS (+ half ass browser standards) is a straight jacket to more open ended design thinking and creative flow, and always feel like i'm holding my nose when using it. I have read and listened to some of you materials, and appreciate your thinking in that direction. Membrane might be heavy-weight, and not primed for the graphic side of things, but half of a UI is the the graphic rendering, so I think it would be a worthwhile exercise to see what I can flex with it. And I would want to add interactivity inevitably anyway, or maybe build tooling for visual rendering flows. So.. what is the state of Membrane now for this purpose? I notice the examples were ported to Java 2D. Why? How usable is Skia target for someone who tries to stick to higher level api's (when I can. ps I only know clojure, no C or even JS or java)? Would Skija help? Any other targets to consider? I work on windows part time, any dealbreakers there? How high or low level would you rate graphics substrates you have experimented with so far? I will probably need some font styling, hopefully use some variable fonts. How is this going? Does Java 2D provide better knobs for typography at the moment? What about leveraging java-fx, or css whithin? I am willing to invest in using skia, if that is the richest target. But I want to be able to do a little something quickly for now. Any open ended thoughts or guidance appreciated. Thanks.
Overall, I think membrane would be a good fit for this purpose. The main caveat depends on if you need to draw elements that aren't implemented yet like gradients. There are ways to extend any of the graphics implementations with java2d and skija being the easiest to extend from clojure. Part of the reason for supporting multiple graphics libraries is to "test" the design. Just making a second implementation of an interface has sorted out quite a few design issues. The most feature complete graphics implementations are skia and java2d with skija as a close 3rd. Some caveats: • Skia does not yet work on windows. • Skija has a bug in its glfw integration that makes it crash when trying to open and close and then open a window again. If you're drawing to images, then this might not even come up for you. > How high or low level would you rate graphics substrates you have experimented with so far? To be honest, it seems like most of the graphics APIs are pretty similar. They all pretty much have strokes and fills for shapes, text, and images. > I will probably need some font styling, hopefully use some variable fonts. How is this going? Does Java 2D provide better knobs for typography at the moment? They all seem pretty similar. I know Skija does include some paragraph shaping, but I haven't used it yet. > What about leveraging java-fx, or css whithin? That's not something I've looked at. What kind of properties would you be interested in. I might suggest starting with java2d, but I'm happy to answer more questions if you want to have more information about which toolkit to use.
If there are missing graphics elements that you need, I'm pretty open to trying to add support for them as long as there is a reasonable data representation
If you have an example of the type of result you're looking for, I could also throw together an example to help get you started
Thank you for they status report! I would like to take you up on that. I got Membrane running with lein the other night. Worked with java2d examples after adding macos dependencies explicity. The skia example was crashing, so I may need to switch to deps.edn to get latest artifacts?
Between graphics implementations, is Skia superior to java-2D in terms of depth or rendering quality or anything? I assume it is more performant? If Skija was more complete and less buggy, would it be more desireable api to use than current Skia? For the features it has, is it easier to use? If using java-2d, would it be helpful to use clj-2d library in conjunction? Sorry these questions are vague. I just want to pick a solid target that has a fully featured model, and potential to render things, and maybe has an accessible enough api that I could help with implementing primitives or custom renderings, etc; even if I needed to grow with it a bit. If Skia or Skija has more legs than java-2d, I might prefer that, even if not 100% baked? Or maybe the choice is not too consequentil and I just need to jump in and play with whatever works the best at the moment.. (It's good to have choices, I'm just prone to analysis paralysis and premature optimization 🤓)
PS. I come from an art and design background and learned programming to draft, create, and publish graphic form. On the publishing side, i developed deep appreciation the power that custom UI affords, but was confounded by the complexity and limitations of web UI, the prized but malnourished child at the intersection of so many competing tech stacks. I've been largely stuck in this tarpit since the IE6 days, and feel like I have barely been able to realize any creative ambitions there, except maybe being able to have a multi-column layout 🤔). So... I hope I have some relevant intuitions how things maybe could work.
I siezed on clojure becuse it was immediatly obvious to me that the repl + a visual canvas is like god mode. Especially coming from design apps; where most things are imperative, full of mutable state, and manual configuration processes.
I started out in Clojure with Hoplon, because that was one of the first things out, before React. (I was reading your thread on Slack archive with the authors. Very illuminating!) Hoplon was simple enough to start learning with, and still go quite far. Javelin is conceptually simple, and nice for handling state and reactivity. It makes piping clojure data around components easy and fun. I struggled more with the HTML side. Hoplon is a thin wrapper over HTML. So one would still need to know the ins and outs of Javascript browser dom methods and behaviors, and js interop. That side was less clojurey and more js-land (because it is basically almost raw HTML). I was really empowered by Hoplon (and it's little community is super sweet). I just personally lost steam when everyone went reagent and beyond, and the framework went into mostly hibernation.
I'm done with gratuitous biography for now. But I am inspired by your work and thought, and exited to dig in deeper, on this library, and on UI in general!
The background is helpful. I think membrane has a lot of simple, reusable, pieces, but the flexibility means that it's a little harder to get started. Based on your description, I would probably recommend either skija or java2d for getting started since both of them can have custom extensions without writing c code. Skija will probably look better in the long run.
The main idea, which isn't really new, is just to describe what you want using data and separately, you can choose how it carried out (ie. windowing, graphics, etc).
Side note: Using java2d shouldn't require any extra dependencies. If you're checking out the membrane project, then I thought the latest version of the main branch should work for at least the skija, skia, and java2d options.
Membrane tries really hard to not get in your way, so if you have an idea for what you want your workflow to look like, then I can probably help make it happen. Thanks for checking it out!