Dmitry Timoshkov : gdiplus: Use an off-screen DC for font enumeration.
Alexandre Julliard
julliard at winehq.org
Wed Feb 20 14:01:14 CST 2013
Module: wine
Branch: master
Commit: 97b92fe12c35673a9234f990b8f66797cc58c603
URL: http://source.winehq.org/git/wine.git/?a=commit;h=97b92fe12c35673a9234f990b8f66797cc58c603
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date: Wed Feb 20 14:17:36 2013 +0800
gdiplus: Use an off-screen DC for font enumeration.
---
dlls/gdiplus/font.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c
index 6e31331..51c7aec 100644
--- a/dlls/gdiplus/font.c
+++ b/dlls/gdiplus/font.c
@@ -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;
More information about the wine-cvs
mailing list