From 455de70201da10c9b5347f2c381fb61e8cc696fd Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Thu, 1 Nov 2018 12:53:29 +0300 Subject: [PATCH] gdiplus: Skip failed font family when building system collection. Signed-off-by: Nikolay Sivov Signed-off-by: Vincent Povirk Signed-off-by: Alexandre Julliard --- dlls/gdiplus/font.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index 74cd29b2c31..729592b982e 100644 --- a/dlls/gdiplus/font.c +++ b/dlls/gdiplus/font.c @@ -1496,6 +1496,7 @@ static WCHAR *load_ttf_name_id( const BYTE *mem, DWORD_PTR size, DWORD id ) struct add_font_param { GpFontCollection *collection; + BOOL is_system; GpStatus stat; }; @@ -1541,6 +1542,7 @@ GpStatus WINGDIPAPI GdipPrivateAddMemoryFont(GpFontCollection* fontCollection, lfw.lfPitchAndFamily = 0; param.collection = fontCollection; + param.is_system = FALSE; if (!EnumFontFamiliesExW(hdc, &lfw, add_font_proc, (LPARAM)¶m, 0)) ret = param.stat; @@ -1651,6 +1653,9 @@ static INT CALLBACK add_font_proc(const LOGFONTW *lfw, const TEXTMETRICW *ntm, if ((stat = GdipCreateFontFamilyFromName(lfw->lfFaceName, NULL, &family)) != Ok) { + WARN("Failed to create font family for %s, status %d.\n", debugstr_w(lfw->lfFaceName), stat); + if (param->is_system) + return 1; param->stat = stat; return 0; } @@ -1691,6 +1696,7 @@ GpStatus WINGDIPAPI GdipNewInstalledFontCollection( lfw.lfPitchAndFamily = 0; param.collection = &installedFontCollection; + param.is_system = TRUE; if (!EnumFontFamiliesExW(hdc, &lfw, add_font_proc, (LPARAM)¶m, 0)) { free_installed_fonts();