[Interest] QML draw strings with emojis

Ian Monroe ian at monroe.nu
Fri Dec 19 00:37:08 CET 2014


On Thu, Dec 18, 2014 at 3:02 PM, Bo Thorsen <bo at vikingsoft.eu> wrote:
>
> Hi everyone,
>
> I have a request that I don't know how to fix. I hope one of you can
> give me a bit of help this time.
>
> I have an application that gets a string from the net and show it on the
> screen. The string can contain emojis, so the users would like to have
> those drawn the right way.
>
> This is a closed source application, Qt 5.3.2, Qt Quick 1, running on
> Windows and Mac. The text is shown in a standard Text element.
>
> What I tried so far: Added seguisym.ttf to the font database and set the
> font Segoe UI Symbol or Segoe UI WP on the Text element. This is pretty
> much what I was able to dig up in searches so far.
>
> No matter what I do, I get a ? instead of the emoji.
>
> Any ideas?
>

Use a regexp to identify emojis (pretty easy, just look up their character
ranges on Wikipedia) and set the font specifically to the emoji font, using
rich text support in Text. This avoids any dodgy character/font lookup code
in Qt.

Ian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20141218/09c0cd72/attachment.html>


More information about the Interest mailing list