From 60757ca6d5ceb79a5599ca5be0c17225d9a86555 Mon Sep 17 00:00:00 2001 From: Dylan Smith Date: Wed, 25 Jun 2008 11:40:39 -0400 Subject: [PATCH] richedit: Corrected the conversion used for the initial font size. The LOGFONT's lfHeight member is in logical units, and is being used to set the yHeight member of CHARFORMAT2 which is supposed to be in twips. --- dlls/riched20/para.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/riched20/para.c b/dlls/riched20/para.c index d6a06d317c0..de69794c33d 100644 --- a/dlls/riched20/para.c +++ b/dlls/riched20/para.c @@ -52,7 +52,8 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor) cf.dwEffects = CFE_AUTOCOLOR | CFE_AUTOBACKCOLOR; lstrcpyW(cf.szFaceName, lf.lfFaceName); - cf.yHeight = ME_twips2pointsY(&c, lf.lfHeight); + /* Convert system font height from logical units to twips for cf.yHeight */ + cf.yHeight = (lf.lfHeight * 72 * 1440) / (c.dpi.cy * c.dpi.cy); if (lf.lfWeight > FW_NORMAL) cf.dwEffects |= CFE_BOLD; cf.wWeight = lf.lfWeight; if (lf.lfItalic) cf.dwEffects |= CFE_ITALIC;