From 7c037e5254466ca743ec9079609fddc6df62cb88 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Sun, 8 May 2022 20:28:41 +0930 Subject: [PATCH] dwrite: Fix incorrect rendering of some SVG fonts SVG fonts are returning DWRITE_GLYPH_IMAGE_FORMATS_NONE as well as DWRITE_GLYPH_IMAGE_FORMATS_SVG in GetCurrentRun() resulting in the outline glyph and color glyph both rendered to the same glyph image. --- src/win32/cairo-dwrite-font.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/win32/cairo-dwrite-font.cpp b/src/win32/cairo-dwrite-font.cpp index 0a3b77362..edac72c5f 100644 --- a/src/win32/cairo-dwrite-font.cpp +++ b/src/win32/cairo-dwrite-font.cpp @@ -1035,7 +1035,6 @@ _cairo_dwrite_scaled_font_init_glyph_color_surface(cairo_dwrite_scaled_font_t *s case DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE: case DWRITE_GLYPH_IMAGE_FORMATS_CFF: case DWRITE_GLYPH_IMAGE_FORMATS_COLR: - default: /* Outline glyphs */ if (color_run->paletteIndex == 0xFFFF) { D2D1_COLOR_F color = foreground_color_brush->GetColor(); @@ -1050,6 +1049,8 @@ _cairo_dwrite_scaled_font_init_glyph_color_surface(cairo_dwrite_scaled_font_t *s color_run->glyphRunDescription, color_brush, DWRITE_MEASURING_MODE_NATURAL); + case DWRITE_GLYPH_IMAGE_FORMATS_NONE: + break; } }