mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:19:49 +00:00
gdiplus: Use an off-screen DC for font enumeration.
This commit is contained in:
parent
61f82d6d02
commit
97b92fe12c
1 changed files with 6 additions and 6 deletions
|
@ -979,12 +979,12 @@ GpStatus WINGDIPAPI GdipIsStyleAvailable(GDIPCONST GpFontFamily* family,
|
|||
|
||||
*IsStyleAvailable = FALSE;
|
||||
|
||||
hdc = GetDC(0);
|
||||
hdc = CreateCompatibleDC(0);
|
||||
|
||||
if(!EnumFontFamiliesW(hdc, family->FamilyName, font_has_style_proc, (LPARAM)style))
|
||||
*IsStyleAvailable = TRUE;
|
||||
|
||||
ReleaseDC(0, hdc);
|
||||
DeleteDC(hdc);
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
@ -1276,7 +1276,7 @@ GpStatus WINGDIPAPI GdipPrivateAddMemoryFont(GpFontCollection* fontCollection,
|
|||
HDC hdc;
|
||||
LOGFONTW lfw;
|
||||
|
||||
hdc = GetDC(0);
|
||||
hdc = CreateCompatibleDC(0);
|
||||
|
||||
lfw.lfCharSet = DEFAULT_CHARSET;
|
||||
lstrcpyW(lfw.lfFaceName, name);
|
||||
|
@ -1288,7 +1288,7 @@ GpStatus WINGDIPAPI GdipPrivateAddMemoryFont(GpFontCollection* fontCollection,
|
|||
return OutOfMemory;
|
||||
}
|
||||
|
||||
ReleaseDC(0, hdc);
|
||||
DeleteDC(hdc);
|
||||
}
|
||||
return Ok;
|
||||
}
|
||||
|
@ -1403,7 +1403,7 @@ GpStatus WINGDIPAPI GdipNewInstalledFontCollection(
|
|||
HDC hdc;
|
||||
LOGFONTW lfw;
|
||||
|
||||
hdc = GetDC(0);
|
||||
hdc = CreateCompatibleDC(0);
|
||||
|
||||
lfw.lfCharSet = DEFAULT_CHARSET;
|
||||
lfw.lfFaceName[0] = 0;
|
||||
|
@ -1416,7 +1416,7 @@ GpStatus WINGDIPAPI GdipNewInstalledFontCollection(
|
|||
return OutOfMemory;
|
||||
}
|
||||
|
||||
ReleaseDC(0, hdc);
|
||||
DeleteDC(hdc);
|
||||
}
|
||||
|
||||
*fontCollection = &installedFontCollection;
|
||||
|
|
Loading…
Reference in a new issue