Support rendering colored bitmap fonts in Quartz backend
Submitted by Kristian Rietveld
Assigned to Andrea Canciani @ranma42
Description
Created attachment 78291 Use CTFontDrawGlyphsPtr() when available, so that colored bitmap glyphs are rendered correctly. Based on original patch authored by Jonathan Kew.
Currently, Cairo is unable to render glyphs from e.g. the Apple Color Emoji font. In order to make this work, glyphs should be rendered using CTFontDrawGlyphsPtr() instead of CGContextShowGlyphsWithAdvances().
Mozilla has support for this in their Cairo, see Mozilla bug 715798 for related discussion. I am attaching a patch that is based on the Mozilla code authored by Jonathan Kew (on CC), but modified so that it applies to Cairo master as of April 21, 2013.
When used in combination with Pango/CoreText (this requires a Pango patch that I will commit soon) the colored bitmap glyphs do render, but are slightly cut off. I am not yet sure whether this should be solved in Pango or Cairo, but at least the glyphs render now :) Mozilla seem to be experiencing similar problems, see e.g. Mozilla bug 804934.
Patch 78291, "Use CTFontDrawGlyphsPtr() when available, so that colored bitmap glyphs are rendered correctly. Based on original patch authored by Jonathan Kew.":
cairo-ctfontdrawglyphs.patch
Version: 1.12.14