From cb21d1caf441b5adeeb52f3c6e3af03a0dcfc844 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Sat, 30 Oct 2010 13:19:48 -0500 Subject: [PATCH] gdiplus: Don't rely on an HDC in GdipGetFontHeight. --- dlls/gdiplus/font.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index 2670e8175dc..843cfb52683 100644 --- a/dlls/gdiplus/font.c +++ b/dlls/gdiplus/font.c @@ -452,12 +452,16 @@ GpStatus WINGDIPAPI GdipGetFontHeight(GDIPCONST GpFont *font, GDIPCONST GpGraphics *graphics, REAL *height) { REAL dpi; + GpStatus stat; TRACE("%p %p %p\n", font, graphics, height); - dpi = GetDeviceCaps(graphics->hdc, LOGPIXELSY); + stat = GdipGetDpiY((GpGraphics*)graphics, &dpi); - return GdipGetFontHeightGivenDPI(font, dpi, height); + if (stat == Ok) + stat = GdipGetFontHeightGivenDPI(font, dpi, height); + + return stat; } /*******************************************************************************