gdiplus: Use font emSize to map to pixel size instead of using gdi32 font metrics.

Dmitry Timoshkov dmitry at baikal.ru
Mon May 21 00:40:53 CDT 2012


GdipCreateFontFromLogfont has no choice but use what gdi32 provides (and the
tests show that it does that correctly), GdipCreateFont has an application
provided emSize and does correct mapping from emSize to lfHeight, so let's do
the same in GdipGetLogFont.

This patch fixes the regression reported in the bug 30724.
---
 dlls/gdiplus/font.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c
index 70ddef6..51733f4 100644
--- a/dlls/gdiplus/font.c
+++ b/dlls/gdiplus/font.c
@@ -483,7 +483,7 @@ GpStatus WINGDIPAPI GdipGetLogFontA(GpFont *font, GpGraphics *graphics,
 void get_log_fontW(const GpFont *font, GpGraphics *graphics, LOGFONTW *lf)
 {
     /* FIXME: use graphics */
-    lf->lfHeight = -font->otm.otmTextMetrics.tmAscent;
+    lf->lfHeight = -em_size_to_pixel(font->emSize, font->unit, font->family->dpi);
     lf->lfWidth = 0;
     lf->lfEscapement = 0;
     lf->lfOrientation = 0;
-- 
1.7.10.1




More information about the wine-patches mailing list