Are color glyphs only supported by the FreeType2 backend?

I’m using PangoCairo to draw text but I can’t get color glyphs to work with the Windows and macOS font backends, i.e. CAIRO_FONT_TYPE_WIN32 and CAIRO_FONT_TYPE_QUARTZ.

On macOS when using fonts such as “Apple Color Emoji” color emojis aren’t drawn at all when using CAIRO_FONT_TYPE_QUARTZ. When using CAIRO_FONT_TYPE_FT instead, color emojis work.

On Windows when using fonts such as “Segoe UI Emoji” emojis are drawn as black & white outlines instead of as colored emojis. Once again, when using CAIRO_FONT_TYPE_FT color emojis are drawn correctly.

So are colored glyphs like emojis generally unsupported for CAIRO_FONT_TYPE_WIN32 and CAIRO_FONT_TYPE_QUARTZ or am I doing something wrong here?

Good question! Yes, colored emojis are actually supported on Windows, but only when rendering via Cairo-DirectWrite. That’s an inherent limitation of the underlying technology: GDI cannot handle colored glyphs.

However, right now Pango in MSYS2 is built without support for Cairo-DirectWrite. That’s because the latest Cairo snapshot (1.17.8) is missing important fixes that have already landed in git main. So we’re waiting for a new Cairo release, which should happen for the GNOME 45 release in October.

Thanks for the information! What about macOS?

I don’t know much about macOS, unfortunately. There’s an open issue in Pango GitLab for that: Emojis don't render on macOS (#753) · Issues · GNOME / pango · GitLab. However I suspect that the issue is in Cairo, as it’s in charge of drawing glyphs.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.