Skip to content

Draft: Add support for color glyphs to SVG backend

Raman Varabets requested to merge cyber_v1/cairo:svg-color-glyphs into master

I had a trouble with SVG font glyphs being rendered as bitmap by the SVG backend. I thought it was a pango issue at first, reported here https://gitlab.gnome.org/GNOME/pango/-/issues/796, but it turned out to be an issue in cairo. So I decided to try and fix it. Honestly I don't exactly know what I'm doing but here is a working PoC. I'm submitting this work as a draft to get some feedback.

Known issues:

  • improper cleanup on error in at least one place (marked FIXME)
  • bitmap color fonts aren't rendered correctly anymore (apparently because _cairo_svg_document_emit_bitmap_glyph_data is now used instead of composite_one_color_glyph in cairo-surface.c.

Please let me know what you think.

Edited by Raman Varabets

Merge request reports