Skip to content

fix: Avatar placeholders: Correctly use the first grapheme as the "letter"

mjk requested to merge mjk/gajim:fix-avatar-letters into master

Uses UAX29 implementation from Pango (indirectly -- via Gtk.TextIter) to step through grapheme clusters. GTK uses the same facility to position text cursor between user-perceived chars. This fixes avatars for many complex scripts (probably not all *) as well as simple things like Latin letters with combining diacritical marks. Also, no more need to iterate over thousands of emoji. :)

* E.g. 'ch' is a single letter in Slovak, but the API doesn't seem to take any locale arguments, and the one-size-fits-all algorithm is used.

Edited by mjk

Merge request reports

Loading