3 ms·
Walking over grapheme clusters is common in UIs, e.g. visually truncating a string. Really I think you are arguing against the notion of "default iteration" al
by ridiculous_fish 10y ago
Walking over grapheme clusters is common in UIs, e.g. visually truncating a string.
Really I think you are arguing against the notion of "default iteration" altogether. As you say, the right type of iteration is context dependent, and it ought to be made explicit.
- dietrichepp 10y agoI'm not sure it is so common in UIs. Truncation is done by a single library function, so that's one case where it's used. Another case is for character wrapping, but that's fairly uncommon. I'm having trouble coming up with another case where it's used. Font shaping is done by a font shaping engine, which applies an enormous number of rules specific to the script in use. Text in a text editor isn't deleted according to grapheme cluster boundaries, and the text cursor doesn't fall on grapheme cluster boundaries either. These are all rules that change according to the script in use.