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.
This commit is contained in:
Dylan Smith 2008-06-25 11:40:39 -04:00 committed by Alexandre Julliard
parent c96a273f91
commit 60757ca6d5
1 changed files with 2 additions and 1 deletions

View File

@ -52,7 +52,8 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor)
cf.dwEffects = CFE_AUTOCOLOR | CFE_AUTOBACKCOLOR; cf.dwEffects = CFE_AUTOCOLOR | CFE_AUTOBACKCOLOR;
lstrcpyW(cf.szFaceName, lf.lfFaceName); 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; if (lf.lfWeight > FW_NORMAL) cf.dwEffects |= CFE_BOLD;
cf.wWeight = lf.lfWeight; cf.wWeight = lf.lfWeight;
if (lf.lfItalic) cf.dwEffects |= CFE_ITALIC; if (lf.lfItalic) cf.dwEffects |= CFE_ITALIC;