After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 766091 - Emoji (other code points too?) are not rendering correctly (Cairo backend)
Emoji (other code points too?) are not rendering correctly (Cairo backend)
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: coretext
1.40.x
Other Mac OS
: Normal normal
: ---
Assigned To: gtk-quartz maintainers
pango-maint
Depends on:
Blocks:
 
 
Reported: 2016-05-07 00:55 UTC by Caleb Hearon
Modified: 2017-08-31 23:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Caleb Hearon 2016-05-07 00:55:40 UTC
Hello,

I noticed that, on OS X, emoji are not rendering correctly with Cairo as a backend.

To test this I modified the code here: https://developer.gnome.org/pango/stable/pango-Cairo-Rendering.html and added an emoji in the middle of the "text" string. It renders with a fallback glyph, and the value is `D83C` no matter which emoji I use.

I tested both 1.40.1 and 1.38. I also noticed there were some changes to pangocoretext.c that looked like they addressed this, but when I tried that (current master commit as of right now) I got no fallback glyph at all, just empty space where the emoji should be

OSX 10.11.4
Pango@master
Cairo 1.14.6
Comment 1 Kristian Rietveld 2016-05-07 04:35:20 UTC
Did you try Cairo @ master?

The changes that recently went into Pango master are discussed in bug 753312. These rely on a Cairo modification that unfortunately has not been committed yet, see https://bugs.freedesktop.org/show_bug.cgi?id=63771.
Comment 2 Caleb Hearon 2016-05-08 13:50:44 UTC
I'm trying, I got pixman and cairo master to compile but when I call cairo_surface_write_to_png I get CAIRO_STATUS_NO_MEMORY returned. I compiled with and without quartz. Linking to the Homebrew version works fine. Any ideas?

I don't see your patches in Cairo master anyways, though, so I don't know if it would work. Thank you for your work on this
Comment 3 Kristian Rietveld 2016-05-08 15:39:35 UTC
(In reply to Caleb Hearon from comment #2)

> 
> I don't see your patches in Cairo master anyways, though, so I don't know if
> it would work. Thank you for your work on this

Sorry for the confusion, my previous comment was not clear. You will need Cairo from git master or Cairo 1.14 from source and apply the patches in https://bugs.freedesktop.org/show_bug.cgi?id=63771 yourself. You are right that the patches are not present in Cairo master.
Comment 4 Caleb Hearon 2016-11-03 00:37:24 UTC
Hi Kristian, thanks again for working on this - I finally got around to trying these patches but emojis don't show up and have no affect on characters around them. I tried applying the patches to cairo master, and I tried applying them on the colors branch that Behdad mentioned where you posted the patches. Both with latest Pango 1.40.3. Should they be working, or is there anything else I need to do?

Some discussion trying to get them to work is here: https://github.com/Automattic/node-canvas/issues/760#issuecomment-258037417
Comment 5 Kristian Rietveld 2016-11-09 20:40:03 UTC
Just updated my Cairo and pango branches to the latest git versions, and the patches still work fine for me.
Comment 6 Tao Dong 2017-02-12 03:57:51 UTC
Emoji font works with pango master branch f4cbd27f4e5bf8490ea411190d41813e14f12165 or 1.40.2 and cairo master branch 5854dd9df40a68efb0cb1b2bb7f94e3f05cbdf45 or 1.14.6.

pango depends on cairo, compile and install cairo first.

emoji font seems too big and pango cuts off right and bottom edges of emoji font.

Thanks to Kris!

(In reply to Kristian Rietveld from comment #5)
> Just updated my Cairo and pango branches to the latest git versions, and the
> patches still work fine for me.
Comment 7 Tao Dong 2017-02-12 04:54:38 UTC
I put an image here:

https://github.com/Automattic/node-canvas/issues/760


(In reply to Kristian Rietveld from comment #5)
> Just updated my Cairo and pango branches to the latest git versions, and the
> patches still work fine for me.