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).
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.
Please turn the emoji input into a input method (either ibus or something homegrown but flexible enough to accommodate more than just emoji). Input methods, i.e. Japanese text input, are shockingly bad under Linux and if westerners used that technology for emoji input, the situation in general would improve. Not only get CJK/… users better technology, they would also not be confronted with two different drop-down menus for character selection.
Posted by: Kamikazow | Tuesday, 31 May 2016 at 06:09
Please also create a plasma widget that stays in our notificationares (just like networkmanager, klipper, etc) to choose emoji in random apps
however ... great work! emoji support is really important today
Posted by: lumks | Tuesday, 31 May 2016 at 13:44
Thanks for sharing with us.............................
Posted by: plus.google.com/116517752288761982280 | Saturday, 16 July 2016 at 07:44