summaryrefslogtreecommitdiff
path: root/pango/pango-attributes.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-02-13 13:19:45 -0600
committerMatthias Clasen <mclasen@redhat.com>2022-02-13 13:19:45 -0600
commitd4cf0b1c8dcdef31644879d6fbae11002828b927 (patch)
treecdf42ee36f3f1802aa6dbcd104633d8af94607da /pango/pango-attributes.c
parent9cb392f306e96534337b177eeee4e1239e8ab337 (diff)
downloadpango-font-palette-api.tar.gz
wip: Add an api to select palettes for color glyphsfont-palette-api
This commit adds a light-background attribute that can be used to influence which palette will be used to render COLRv0 layered glyphs with color fonts that have multiple palettes. This needs a way for cairo to invalidate its glyph cache when the selected palette changes, which needs new freetype api.
Diffstat (limited to 'pango/pango-attributes.c')
-rw-r--r--pango/pango-attributes.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c
index 60d14706..59966575 100644
--- a/pango/pango-attributes.c
+++ b/pango/pango-attributes.c
@@ -1556,6 +1556,20 @@ pango_attr_text_transform_new (PangoTextTransform transform)
return pango_attr_int_new (&klass, transform);
}
+
+PangoAttribute *
+pango_attr_light_background_new (gboolean light_background)
+{
+ static const PangoAttrClass klass = {
+ PANGO_ATTR_LIGHT_BACKGROUND,
+ pango_attr_int_copy,
+ pango_attr_int_destroy,
+ pango_attr_int_equal
+ };
+
+ return pango_attr_int_new (&klass, light_background);
+}
+
/* }}} */
/* {{{ Binding helpers */