-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cairo: backport fix and enabled dwrite backend
- Loading branch information
Showing
3 changed files
with
36 additions
and
16 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
From 36d75971dde8dffd80311b0e67de53b5dd919e3b Mon Sep 17 00:00:00 2001 | ||
From: Adrian Johnson <ajohnson@redneon.com> | ||
Date: Sun, 20 Mar 2022 11:15:12 +1030 | ||
Subject: [PATCH] Ensure DWrite toy fonts can not fail if font name not found | ||
|
||
--- | ||
src/win32/cairo-dwrite-font.cpp | 8 ++++++-- | ||
1 file changed, 6 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/src/win32/cairo-dwrite-font.cpp b/src/win32/cairo-dwrite-font.cpp | ||
index afa859fbd..575d46642 100644 | ||
--- a/src/win32/cairo-dwrite-font.cpp | ||
+++ b/src/win32/cairo-dwrite-font.cpp | ||
@@ -327,8 +327,12 @@ _cairo_dwrite_font_face_create_for_toy (cairo_toy_font_face_t *toy_face, | ||
IDWriteFontFamily *family = DWriteFactory::FindSystemFontFamily(face_name); | ||
delete face_name; | ||
if (!family) { | ||
- *font_face = (cairo_font_face_t*)&_cairo_font_face_nil; | ||
- return CAIRO_STATUS_FONT_TYPE_MISMATCH; | ||
+ /* If the family is not found, pick a default that should work to avoid failing. */ | ||
+ family = DWriteFactory::FindSystemFontFamily(L"Arial"); | ||
+ if (!family) { | ||
+ *font_face = (cairo_font_face_t*)&_cairo_font_face_nil; | ||
+ return CAIRO_STATUS_FONT_TYPE_MISMATCH; | ||
+ } | ||
} | ||
|
||
DWRITE_FONT_WEIGHT weight; | ||
-- | ||
GitLab | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters