summaryrefslogtreecommitdiff
path: root/src/win32
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2023-01-26 13:14:59 +1030
committerAdrian Johnson <ajohnson@redneon.com>2023-01-26 13:19:53 +1030
commit75d876ee2966d7c35e35234382e3842be3b40935 (patch)
treed9c69623e7f0e0d8402745514f62dc14133de026 /src/win32
parent0151a67e33f7c96645ae581b31861780b531a7e1 (diff)
downloadcairo-75d876ee2966d7c35e35234382e3842be3b40935.tar.gz
dwrite: use custom palette when rendering COLRv0
Diffstat (limited to 'src/win32')
-rw-r--r--src/win32/cairo-dwrite-font.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/win32/cairo-dwrite-font.cpp b/src/win32/cairo-dwrite-font.cpp
index 764835bc8..e5e4efdb3 100644
--- a/src/win32/cairo-dwrite-font.cpp
+++ b/src/win32/cairo-dwrite-font.cpp
@@ -1036,7 +1036,16 @@ _cairo_dwrite_scaled_font_init_glyph_color_surface(cairo_dwrite_scaled_font_t *s
color_brush->SetColor(&color);
uses_foreground_color = TRUE;
} else {
- color_brush->SetColor(color_run->runColor);
+ double red, green, blue, alpha;
+ cairo_status_t status;
+ status = cairo_font_options_get_custom_palette_color (&scaled_font->base.options,
+ color_run->paletteIndex,
+ &red, &blue, &green, &alpha);
+ if (status == CAIRO_STATUS_SUCCESS) {
+ color_brush->SetColor(D2D1::ColorF(red, blue, green, alpha));
+ } else {
+ color_brush->SetColor(color_run->runColor);
+ }
}
dc4->DrawGlyphRun(origin,