summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-02-20 00:26:14 +0000
committerMatthias Clasen <mclasen@redhat.com>2023-02-20 00:26:14 +0000
commitc644484d40da496ac68235179be0e9a491c7ea41 (patch)
treeb8b718258421b600bf833469c6354c17d65ef76c
parentc3b796b5b1f46cec16550f1cd0afbc2db10e9415 (diff)
parentd915ff0eaf43e301c35592376a14778445faa183 (diff)
downloadpango-c644484d40da496ac68235179be0e9a491c7ea41.tar.gz
Merge branch 'detect-colrv1' into 'main'
shape: Properly detect COLRv1 color fonts See merge request GNOME/pango!677
-rw-r--r--pango/shape.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/pango/shape.c b/pango/shape.c
index e666bb3d..acf4be59 100644
--- a/pango/shape.c
+++ b/pango/shape.c
@@ -306,6 +306,11 @@ font_has_color (hb_font_t *font)
face = hb_font_get_face (font);
+#if HB_VERSION_ATLEAST (7, 0, 0)
+ if (hb_ot_color_has_paint (face))
+ return TRUE;
+#endif
+
return hb_ot_color_has_layers (face) ||
hb_ot_color_has_png (face) ||
hb_ot_color_has_svg (face);
@@ -320,6 +325,11 @@ glyph_has_color (hb_font_t *font,
face = hb_font_get_face (font);
+#if HB_VERSION_ATLEAST (7, 0, 0)
+ if (hb_ot_color_glyph_has_paint (face, glyph))
+ return TRUE;
+#endif
+
if (hb_ot_color_glyph_get_layers (face, glyph, 0, NULL, NULL) > 0)
return TRUE;