diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-07-01 09:57:35 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-07-04 11:24:16 -0400 |
commit | 8ee5fe2707db5013dc53084ec1ac44e91b863f6d (patch) | |
tree | 1535b516d1df78b14be71ee84315a3318687d25c /pango2/pango-fontmap.c | |
parent | 9954891c66a241338cc48d2c2236b12dd2368572 (diff) | |
download | pango-8ee5fe2707db5013dc53084ec1ac44e91b863f6d.tar.gz |
Support color palettes in fonts
Add a pango_context_set_palette to select whether
we prefer the default palette, the palette for light
background, or the palette for dark background. Also
add a palette attribute that can be used to override
this.
Make the cairo renderer pick up the palette, and
apply it when installing the font for a run.
Predefined palette names are "default", "light",
"dark", "palette0", "palette1", ...
Additionally, PangoHbFace can associate custom
names with palette indices.
To try this, use the new --palette option of
pango-view.
Fonts to try this with are Amiri Quran Colored
or the Bungee Color family.
Diffstat (limited to 'pango2/pango-fontmap.c')
-rw-r--r-- | pango2/pango-fontmap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pango2/pango-fontmap.c b/pango2/pango-fontmap.c index 20cf8193..5ae9b69b 100644 --- a/pango2/pango-fontmap.c +++ b/pango2/pango-fontmap.c @@ -34,7 +34,7 @@ #include "pango-fontset.h" #include "pango-font-face-private.h" #include "pango-trace-private.h" -#include "pango-context.h" +#include "pango-context-private.h" #ifdef HAVE_CORE_TEXT #include "pangocoretext-fontmap.h" @@ -558,6 +558,7 @@ pango2_font_map_default_load_fontset (Pango2FontMap *self, lookup.language = language; lookup.description = (Pango2FontDescription *)description; lookup.ctm = ctm; + #ifdef HAVE_CAIRO lookup.font_options = (cairo_font_options_t *)pango2_cairo_context_get_merged_font_options (context); #endif |