From c33175c60567f8eeee177e1a2c1442b73e5e20f6 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Sat, 30 Oct 2010 13:19:48 -0500 Subject: [PATCH 3/6] gdiplus: Don't rely on an HDC in GdipGetFontHeight. --- dlls/gdiplus/font.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index 2670e81..843cfb5 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); + + if (stat == Ok) + stat = GdipGetFontHeightGivenDPI(font, dpi, height); - return GdipGetFontHeightGivenDPI(font, dpi, height); + return stat; } /******************************************************************************* -- 1.7.1