[Standards] Support for stickers (custom emojis)

Andrey Gagarin andrey.gagarin at redsolution.com
Thu Oct 24 14:41:15 UTC 2019


пн, 21 окт. 2019 г. в 19:08, Jonathan Lennox <lennox at cs.columbia.edu>:

> The right concept here is probably "grapheme clusters", as defined in
> Unicode Standard Annex 29.  ICU has support for this.
>

We have succeded implementing reference processing on three clients and on
the server side. And not one of the developers had problems calculating the
necessary positions. You just handle every emoji as one glyph.

In addition we made a XMPP bot with which you can test different
references: markup, string with escaped text and different media. You can
try it xmpp:devbot at dev.xabber.com

For instance, if you have such text : "😁😂😆 funny comment with some bold
text!" and you want to make it in some part bold, you should count every
symbol in this text and in the end you will get such message to send:


<message type="chat" id="1" from="juliet at capulet.it/phone" to="
romeo at montague.it">
<reference begin="28" end="31" type="markup">
<bold/>
</reference>
<body>😁😂😆 funny comment with some bold text!</body>
</message>

Each of these three emojis is counted as 1 symbol.

The client will render:
[image: Screenshot_2019-10-24 Xabber Web.png]

More complex example with unicode combining characters: "Test ◌⃤ BOLD
italic usual text". We count this graphem as one character. The message
should be like this:

<message from="romeo at montague.it/desktop" to="juliet at capulet.it/phone"
type="chat" id="2">
<reference begin="8" end="12" type="markup">
<bold/>
</reference>
<reference begin="13" end="19" type="markup">
<italic/>
</reference>
<body>Test ◌⃤ BOLD italic usual text</body>
</message>

The client will render:

[image: Screenshot_2019-10-24 Xabber Web(1).png]

In addition we made a XMPP bot with which you can test different
references: markup, string with escaped text and different media content.
You can try it here xmpp:devbot at dev.xabber.com.

-- 
Andrey Gagarin
Developer, Redsolution OÜ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.jabber.org/pipermail/standards/attachments/20191024/068c8fd1/attachment.html>


More information about the Standards mailing list