diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-02-13 13:19:45 -0600 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-02-13 13:19:45 -0600 |
commit | d4cf0b1c8dcdef31644879d6fbae11002828b927 (patch) | |
tree | cdf42ee36f3f1802aa6dbcd104633d8af94607da /pango/pango-markup.c | |
parent | 9cb392f306e96534337b177eeee4e1239e8ab337 (diff) | |
download | pango-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-markup.c')
-rw-r--r-- | pango/pango-markup.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pango/pango-markup.c b/pango/pango-markup.c index 9a3bde55..12b1533e 100644 --- a/pango/pango-markup.c +++ b/pango/pango-markup.c @@ -1233,6 +1233,7 @@ span_parse_func (MarkupData *md G_GNUC_UNUSED, const char *text_transform = NULL; const char *segment = NULL; const char *font_scale = NULL; + const char *light_background = NULL; g_markup_parse_context_get_position (context, &line_number, &char_number); @@ -1318,6 +1319,7 @@ span_parse_func (MarkupData *md G_GNUC_UNUSED, CHECK_ATTRIBUTE (lang); CHECK_ATTRIBUTE (letter_spacing); CHECK_ATTRIBUTE (line_height); + CHECK_ATTRIBUTE (light_background); break; case 'o': CHECK_ATTRIBUTE (overline); @@ -1784,6 +1786,16 @@ span_parse_func (MarkupData *md G_GNUC_UNUSED, } } + if (G_UNLIKELY (light_background)) + { + gboolean b = FALSE; + + if (!span_parse_boolean ("light_background", light_background, &b, line_number, error)) + goto error; + + add_attribute (tag, pango_attr_light_background_new (b)); + } + return TRUE; error: |