NewCaw icon indicating copy to clipboard operation
NewCaw copied to clipboard

Support the display of custom emojis

Open CodedOre opened this issue 3 years ago • 1 comments
trafficstars

Mastodon allows custom emojis to be used in Post texts and Profile descriptions. As we want to add support for Mastodon we should look into supporting this at some time.

As major problem though is that a normal Gtk.Label can't display other widgets inside, which will likely require some more work. The developers of Fractal for example have solved the problem on their side with a custom widget, so we could maybe borrow some ideas from there.

CodedOre avatar Nov 29 '21 15:11 CodedOre

I'm trying to work out what that widget does. At first I thought it was doing some hideous "break it into lots of widgets" thing with a grid. But it looks like it's using placeholder text that it then swaps it for (which it then finds again later, so it might have issues if people intentionally post that character?) and annotates as a list of Pango rectangles (one per widget) in the label's attributes and then uses size allocation to define where the widget paints itself. Which is… a bit of an effort! But clever. I didn't realise you could mess with Pango that much. And I guess it works.

I was going to suggest that maybe it would also allow us to support Twitter's "Hashflags" but… I'm not convinced I want to support all that junk!

https://hashflags.io/

The Mandalorian mask and Olympics rings were cool, but that's just getting silly!

IBBoard avatar Nov 29 '21 19:11 IBBoard