Module: wine Branch: master Commit: 455de70201da10c9b5347f2c381fb61e8cc696fd URL: https://source.winehq.org/git/wine.git/?a=commit;h=455de70201da10c9b5347f2c3...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Thu Nov 1 12:53:29 2018 +0300
gdiplus: Skip failed font family when building system collection.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Vincent Povirk vincent@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/gdiplus/font.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index 74cd29b..729592b 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();