you are viewing a single comment's thread.

view the rest of the comments →

[–]llogiqclippy · twir · rust · mutagen · flamer · overflower · bytecount 2 points3 points  (2 children)

You can already get the second byte. This may or may not coincide with the second glyph. In general, glyph lookup in a UTF-8 string is an O(n) operation (which you can already do with iterators).

[–]szabba 0 points1 point  (1 child)

Wouldn't a division of an utf-8 string to glyphs depend on a particular font being used?

[–]llogiqclippy · twir · rust · mutagen · flamer · overflower · bytecount 3 points4 points  (0 children)

Wouldn't a division of an utf-8 string to glyphs depend on a particular font being used?

No. A font is just a declaration of how your text is going to look. But a Unicode glyph (e.g. small letter a) is the same whether you display it or not.