3 ms·
But truncation is very often needed when you have more text than space. What's the alternative?
by millstone 13y ago
But truncation is very often needed when you have more text than space. What's the alternative?
- gliese1337 13y agoIf it's storage space, you truncate by bytes, rounding down to the nearest complete grapheme- no need to count graphemes. If it's display space, truncate by pixels, in which case you need "size in device units of the output text from a rendering engine". Again, no need to count graphemes.
- dustyleary 13y agoCounting graphemes and detecting "the nearest complete grapheme" are basically the same problem. The only reason counting graphemes is hard is because detecting grapheme boundaries is hard.
- oneeyedpigeon 13y agoOf course, neither of those approaches solves the 'ass-' problem, which is possibly a red herring.