Description
What is the issue with the HTML Standard?
The possibility to create and render TextCluster
objects has been discussed in this issue, and the spec PR is currently being reviewed.
After some discussions around potential use cases for these new capabilities, a couple of interesting points came up around how to make efficient use of the new API and what would be needed to improve its usefulness:
- Adding some kind of unique id or hash to each
TextCluster
, indicating that the underlying glyph (or glyphs) are the same. This would enable the creation of an atlas to reuse the clusters as textures. - Exposing bidi level information for each cluster.
We wanted to see what opinions people here have on adding these as read-only attributes to the TextCluster
interface. Were not sure what would be the best way to spec a unique id like that, as it doesn't really need to be consistent across platforms, it just has to be unique within each user agent. I tried to look around in the spec for other examples of hashing or generating unique ids but I wasn't able to find a reference.
cc: @whatwg/canvas