▲ | samwillis 7 days ago | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There is a lot valid concern on accessibility and abuse this could result in, but it think it's important to see the other side of the argument. There was a really good thread on Twitter a couple of days ago: > In light of recent Figma news, lemme reiterate that of all the goods that can happen to the web, 90% of them can't happen due to not having access to font rendering & metrics in JS https://x.com/_chenglou/status/1951481453046538493 And a few choice replies: > t’s kind of crazy that a platform specifically designed for presenting text doesn’t provide functionality to manipulate text at a detail level > Brute forcing text measurement in tldraw breaks my heart Love it or hate it, the web is a platform for application development, making this easer is only good for everyone. My argument on web APIs is what we should continue to go lower level, and so font and text metrics APIs for canvas would be awesome and an alternative to this. But I'm also a proponent of "using the platform" and for text layout, web engines are incredible, and very performant. Extending that capability to layout inside a canvas enables many awesome features. One that I've repeatedly gone back to over the years is paginated rich text editing. It's simply impossible to do with contenteditable in a product level way - one of the reasons Google docs has a custom layout engine. This proposal would enable full use of contenteditable for rich text, but with full page/print layout control. I hope it lands in the browsers. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | chrismorgan 7 days ago | parent | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> of all the goods that can happen to the web, 90% of them can't happen due to not having access to font rendering & metrics in JS I’d be interested to see a representative excerpt of this person’s “goods that can happen to the web”, because it sounds pretty ridiculous to me. Not much needs that stuff, and a lot of that stuff is exposed in JS these days, and a lot of the rest you can work around it without it being ruinous to performance. It’s also pretty irrelevant here (that is, about HTML-in-Canvas): allowing drawing HTML to canvas doesn’t shift the needle in these areas at all. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | MartinMond 7 days ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> One that I've repeatedly gone back to over the years is paginated rich text editing. It's simply impossible to do with contenteditable in a product level way - one of the reasons Google docs has a custom layout engine. As do we at Nutrient, we use Harfbuzz in WASM plus our own layouting - see the demo here: https://document-authoring-demo.nutrient.io/ Getting APIs for that into the Platform would make life significantly easier, but thanks to WASM it’s not a total showstopper. Btw, I saw you’re working on sync at ElectricSQL - say hi to Oleksii :) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | 6 days ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[deleted] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | 6 days ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[deleted] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | troupo 7 days ago | parent | prev [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> I hope it lands in the browsers. Why would you want world's least performant layout/UI engine infect canvas? This literally just cements the situation you quote about having no access to good APIs. A reminder that Figma had to "create a browser inside a browser" to work around DOM limitations: https://www.figma.com/blog/building-a-professional-design-to... > It's simply impossible to do with contenteditable in a product level way - one of the reasons Google docs has a custom layout engine. This proposal would enable full use of contenteditable for rich text, but with full page/print layout control. Why would it enable contenteditable for rich text if you yourself are saying that it doesn't work, and Google had to implement its own engine? |