Re: [svgwg] Character counting in text 'x', 'y', 'dx', 'dy', and 'rotate' attributes. (#537)

Right. The number of items in the position array should be equal to the number of code points in the string; they are parallel. When the browser chunks up the text, it accumulates all positions that a grapheme cluster (or whatever method the browser uses for chunking) includes into the same chunk. That way, the next character is still shown at the same place as it would have been shown if the browser chose a different chunking method.

You can also think of it as the set of positions is turned into a set of absolute positions, so each code point corresponds to an absolute position. Then, all the positions that correspond with the non-first-code-point in the cluster are ignored, so after the end of the cluster, the next item is shown at appropriate absolute position.

-- 
GitHub Notification of comment by litherum
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/537#issuecomment-453577036 using your GitHub account

Received on Friday, 11 January 2019 16:36:20 UTC