[HarfBuzz] Emoticons support

Behdad Esfahbod behdad at behdad.org
Tue Nov 14 03:53:36 UTC 2017


Hi Sebastien,

Sorry for not replying before.

In short, HarfBuzz doesn't need any modifications as long as you you don't
use hb-ft.h (which is tracked at
https://github.com/behdad/harfbuzz/issues/489 ).

What you do need is:

  - In your graphics subsystem you need to pass FT_LOAD_COLOR to FreeType
and handle color glyphs loaded.  Look in cairo-ft-font.c.  The images come
back BGRA32 pre-multiplied.  Most graphics libraries know how to handle
that.  Also, the CBDT/CBLC and sbix formats implemented by FreeType are
bitmap formats.  So your font code needs to support scaling bitmap fonts
correctly,

  - You also need something called an emoji-itemizer, which you run on the
input text to identify sequences that need to be rendered as color emoji.
See pango-emoji.c for that.  That code also needs some updating for latest
version of Unicode: https://bugzilla.gnome.org/show_bug.cgi?id=789978

  - When you do identify such sequences, you should then ask for "emoji"
font family from Fontconfig.  That also would mean that users of your
library would not be able to select different emoji font.  We are
discussing that at https://bugzilla.gnome.org/show_bug.cgi?id=787365

That's the gist of it.  I'd be happy to dig deeper.

Cheers,
behdad

On Tue, Aug 1, 2017 at 5:06 PM, Sebastien Metrot <meeloo at meeloo.net> wrote:

> Hi,
>
> I just this tweet https://twitter.com/behdadesfahbod/status/
> 892235143599063040 and wondered how I could add support for colored
> emoticons to my open UI library that already uses harfbuz (albeit an old
> version of the APIā€¦).
>
> Very interesting in learning about this so any pointer is welcome!
>
> Thanks!
>
> S.
>
> _______________________________________________
> HarfBuzz mailing list
> HarfBuzz at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/harfbuzz
>
>


-- 
behdad
http://behdad.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/harfbuzz/attachments/20171113/eec110f4/attachment-0001.html>


More information about the HarfBuzz mailing list