3 ms·
Slightly off-topic, but in the spirit of AMA - how would you recommend, on the web (via wasm-bindgen), converting text (like Slate or DraftJS's data models, not
by dakom 6y ago
Slightly off-topic, but in the spirit of AMA - how would you recommend, on the web (via wasm-bindgen), converting text (like Slate or DraftJS's data models, not necessarily html+css) to WebGL?
Converting to a texture by way of Canvas API calls won't really work with mixed directional text...
From following the links on your blog, seems like state of the art is Allsorts + Pathfinder?
- raphlinus 6y agoI can't wholeheartedly recommend anything right now. There should be a standard text layout library with pluggable back-ends, but there isn't. If you go to the #text stream on xi.zulipchat.com, there's a lot of discussion under the "Skribo: lifting the curse" topic and a couple others. It's definitely possible to build something yourself using Allsorts and other pieces, but making it all work well is a highly nontrivial task. Part of the problem is that there are a bunch of projects out there, each with their own subset of requirements, rather than one good one. I'd like to mentor work to make this situation better, but it's too much for me to take on single-handedly. I'm also hoping that WebGPU catches on, and we'll be able to run piet-gpu on it (through wasm). That would, I think, be compelling for a lot of interesting use cases.
- dakom 6y agoThanks for the overview! I'd love to learn and attack this, and I'm also interested in tying it to an ECS for rendering - but so many hours in the day... will reach out if I can see a real opportunity to do something here. I'd imagine it's also going to be needed by the Ruffle folks when they get to adding TLFText support