diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2023-01-30 07:19:03 +1030 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2023-01-30 07:19:03 +1030 |
commit | e8cac307e1751c46e4275d33009138dd926e22f9 (patch) | |
tree | 15dc29e96d08a612acf3fba8dba072650862f2f1 /src/win32 | |
parent | 47a932bffc16323b58e3c8f9bc3fe0d821838a84 (diff) | |
download | cairo-e8cac307e1751c46e4275d33009138dd926e22f9.tar.gz |
Fix dwrite crash when printing dwrite toy font
Fixes #632
Diffstat (limited to 'src/win32')
-rw-r--r-- | src/win32/cairo-dwrite-font.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/win32/cairo-dwrite-font.cpp b/src/win32/cairo-dwrite-font.cpp index 478f775b8..ce8f9a60e 100644 --- a/src/win32/cairo-dwrite-font.cpp +++ b/src/win32/cairo-dwrite-font.cpp @@ -1942,6 +1942,16 @@ _cairo_dwrite_scaled_font_create_win32_scaled_font (cairo_scaled_font_t *scaled_ } cairo_font_face_t *face = cairo_scaled_font_get_font_face (scaled_font); + if (cairo_font_face_status (face) == CAIRO_STATUS_SUCCESS && + cairo_font_face_get_type (face) == CAIRO_FONT_TYPE_TOY) + { + face = ((cairo_toy_font_face_t *)face)->impl_face; + } + + if (face == NULL || cairo_font_face_get_type (face) != CAIRO_FONT_TYPE_DWRITE) { + return CAIRO_INT_STATUS_UNSUPPORTED; + } + cairo_dwrite_font_face_t *dwface = reinterpret_cast<cairo_dwrite_font_face_t*>(face); RefPtr<IDWriteGdiInterop> gdiInterop; |