So in the past month I've devoted my weekends to get proper emojis support ready for KDE software. Thanks to our fantastic KEmoticons framework, all the heavy lifting is already done, we just needed a theme and utilize the theme.

I've came across this awesome open source set called Emoji One, which features over 1600 emojis and is ready to be used with CC BY 4.0 license. I've created a KEmoticons theme out of the last released set, supporting both the :ascii: notation as well as the unicode symbols which were gladly contributed by David Gil Oliva. This theme of course supports the good old emoticons too :)

And today I'm happy to announce that all is merged in now and will be released with next KDE Frameworks release.

Using it is very simple, if your app is already using KEmoticons, you can just set the EmojiOne theme explicitly and profit. If your app is not yet using KEmoticons, using is as simple as these three lines of code:

KEmoticons *kemoticons = new KEmoticons();

emojiTheme = kemoticons->theme("EmojiOne");

QString textWithEmojis = emojiTheme.parseEmoticons("Your text :poop:");

Additionally, if you want your emojis to be in a specific size, you can now newly apply a size constraint by doing this:

kemoticons->setPreferredEmoticonSize(QSize(16, 16));

...before you call parseEmoticons(..) and your parsed emojis will be in size 16x16 pixels.

What's next?

Emojis parser is nice, but how about input? Right now I have set of QML-with-C++ goodness that provides an enhanced auto-height-resizing TextArea that features emojis autocompletion, emojis rendered inline and a custom plain-text converter to give you back the plain text with the emojis in :ascii: format (with some tweaking it can return the unicode character easily).

Inline emojis with autocompletion

One other thing I have ready is nicely pre-ordered QAbstractListModel-subclass that can be used in popups to allow users to input emojis with mouse.

These extras are not yet ready to be released though, still some issues left to iron out. I think I'll end up bundling all these into its own package and release it standalone. They will require only KEmoticons, Qt and QtQuick.

Qt-only?

Currently the emojis come in KEmoticons framework, which is very flexible and provides tons of features, like support for installing custom themes that you can bundle with your app. All those features unfortunately come with some additional dependencies, but I believe we can cut these down to a single tier-1 dependency. I'll probably look into slimming KEmoticons down in my free time, but if you're interested in using this in your Qt-only app, please let me know and I'll prioritize it.