[cairo] Color fonts

Adrian Johnson ajohnson at redneon.com
Sun Aug 13 12:06:59 UTC 2017


On 10/08/17 08:13, Behdad Esfahbod wrote:
> On Sun, Jul 30, 2017 at 12:20 AM, Adrian Johnson <ajohnson at redneon.com
> <mailto:ajohnson at redneon.com>> wrote:
> 
>     Does it work with user fonts?
> 
> 
> Not yet.  There's a comment in cairo-user-font.c:
> 
>         /* TODO
>          * extend the glyph cache to support argb glyphs.
>          * need to figure out the semantics and interaction with subpixel
>          * rendering first.
>          */
> 
> We now have the argb glyph cache.  We have to do some tricks to identify
> color glyphs.  Still, interaction with subpixel rendering remains ambiguous.
> 
> When we do fix the above, I like to make cairo-surface.c wrap OpenType
> color glyphs into a user-font before drawing.  This way we can still get
> original text to be embedded in PDF whereas current implementation just
> draws them as images and loses text.

That would be the easiest way to get nice PDF/PS output. If you could
use the original CBDT images instead of 72ppi scaled images the output
would be even better.

Also, the current implementation has a regression. If a font contains
any color glyphs, every glyph in the font will be rendered as an image
instead of show_glyphs.


More information about the cairo mailing list