<div dir="ltr"><div><div><div><div><div><div><div><div><div>Hi Sebastien,<br><br></div>Sorry for not replying before.<br><br></div>In short, HarfBuzz doesn't need any modifications as long as you you don't use hb-ft.h (which is tracked at <a href="https://github.com/behdad/harfbuzz/issues/489">https://github.com/behdad/harfbuzz/issues/489</a> ).<br><br></div>What you do need is:<br><br></div>  - 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,<br><br></div>  - 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: <a href="https://bugzilla.gnome.org/show_bug.cgi?id=789978">https://bugzilla.gnome.org/show_bug.cgi?id=789978</a><br><br></div>  - 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 <a href="https://bugzilla.gnome.org/show_bug.cgi?id=787365">https://bugzilla.gnome.org/show_bug.cgi?id=787365</a><br><br></div>That's the gist of it.  I'd be happy to dig deeper.<br><br></div>Cheers,<br></div>behdad<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 1, 2017 at 5:06 PM, Sebastien Metrot <span dir="ltr"><<a href="mailto:meeloo@meeloo.net" target="_blank">meeloo@meeloo.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi,<div><br></div><div>I just this tweet <a href="https://twitter.com/behdadesfahbod/status/892235143599063040" target="_blank">https://twitter.com/<wbr>behdadesfahbod/status/<wbr>892235143599063040</a> 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…).</div><div><br></div><div>Very interesting in learning about this so any pointer is welcome!</div><div><br></div><div>Thanks!</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>S.</div></font></span></div><br>______________________________<wbr>_________________<br>
HarfBuzz mailing list<br>
<a href="mailto:HarfBuzz@lists.freedesktop.org">HarfBuzz@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/harfbuzz" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/harfbuzz</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">behdad<br><a href="http://behdad.org/" target="_blank">http://behdad.org/</a></div>
</div>