I'm working on a project that has to handle special rendering of emoji as well, and I simply ask the system "will this string render in the emoji font" and "how big of a rect do I need to render this string" to calculate the same thing, rather than trying to handle it myself and relying on assumptions about the sizing of the emoji. I figure this way I also future proof against whatever emoji they think up in the future.
My idea was to increase the font size of a message that only consists of Emoji, depending on the number of Emoji in the message, like this:
https://xmpp.pix-art.de/imagehost/display/file/2017-03-09_09...
The code turned out more complex than first expected, mirroring the same problems OP encountered:
https://github.com/ge0rg/yaxim/blob/gradle/src/org/yaxim/and...