diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2023-01-27 10:44:31 +0000 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2023-01-27 10:44:31 +0000 |
commit | 407bb0a478890c2640c326fab0642d8595407ba1 (patch) | |
tree | ba3d78570920bba2e44f5cb60383b14524602f1d /src/win32 | |
parent | 22d0cd1ec3f41c04d242ba775d4eb1693aca8c14 (diff) | |
parent | 75d876ee2966d7c35e35234382e3842be3b40935 (diff) | |
download | cairo-407bb0a478890c2640c326fab0642d8595407ba1.tar.gz |
Merge branch 'dwrite-custom-palette' into 'master'
dwrite: use custom palette when rendering COLRv0
See merge request cairo/cairo!424
Diffstat (limited to 'src/win32')
-rw-r--r-- | src/win32/cairo-dwrite-font.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/win32/cairo-dwrite-font.cpp b/src/win32/cairo-dwrite-font.cpp index fd866d4f0..478f775b8 100644 --- a/src/win32/cairo-dwrite-font.cpp +++ b/src/win32/cairo-dwrite-font.cpp @@ -1055,7 +1055,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, |