3 ms·
I suspect that accuracy of rendering and consistency across platforms is the bigger concern here. There are enough differences between how different browsers a
by sime2009 5y ago
I suspect that accuracy of rendering and consistency across platforms is the bigger concern here.
There are enough differences between how different browsers and operating systems render text via the DOM, to make it very hard to get consistent results between then all. By using canvas they can get very close to pixel perfect consistency. (Especially if they bring their own FreeType library or similar along.)
- londons_explore 5y agoYou can already get nearly pixel-perfect consistency by rendering each character as a separate dom element at specific X-Y coordinates. Then the browser isn't responsible for line wrapping or anything. It has the benefit you can still use the browser for GPU acceleration and calculation of damage rectangles. I'd also question how important identical cross-device rendering is in todays world of vastly different screen sizes.
- sime2009 5y ago> You can already get nearly pixel-perfect consistency by rendering each character as a separate dom element at specific X-Y coordinates. You could do that for every character, but the size of the DOM and updating it will kill your performance. You're better off just drawing the characters yourself into a canvas then.