gdiplus: Avoid saving negative values in pixel_size and emSize.

This commit is contained in:
Dmitry Timoshkov 2012-04-19 21:43:51 +09:00 committed by Alexandre Julliard
parent d080774e75
commit 9b5b04c1c1
1 changed files with 2 additions and 3 deletions

View File

@ -190,9 +190,6 @@ GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC hdc,
(*font)->lfw.lfUnderline = logfont->lfUnderline; (*font)->lfw.lfUnderline = logfont->lfUnderline;
(*font)->lfw.lfStrikeOut = logfont->lfStrikeOut; (*font)->lfw.lfStrikeOut = logfont->lfStrikeOut;
(*font)->pixel_size = (*font)->emSize = logfont->lfHeight;
(*font)->unit = UnitPixel;
hfont = CreateFontIndirectW(&(*font)->lfw); hfont = CreateFontIndirectW(&(*font)->lfw);
oldfont = SelectObject(hdc, hfont); oldfont = SelectObject(hdc, hfont);
GetTextMetricsW(hdc, &textmet); GetTextMetricsW(hdc, &textmet);
@ -201,6 +198,8 @@ GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC hdc,
(*font)->lfw.lfWeight = textmet.tmWeight; (*font)->lfw.lfWeight = textmet.tmWeight;
(*font)->lfw.lfCharSet = textmet.tmCharSet; (*font)->lfw.lfCharSet = textmet.tmCharSet;
(*font)->pixel_size = (*font)->emSize = textmet.tmHeight;
(*font)->unit = UnitPixel;
(*font)->height = 1; /* FIXME: need NEWTEXTMETRIC.ntmSizeEM here */ (*font)->height = 1; /* FIXME: need NEWTEXTMETRIC.ntmSizeEM here */
(*font)->line_spacing = textmet.tmAscent + textmet.tmDescent + textmet.tmExternalLeading; (*font)->line_spacing = textmet.tmAscent + textmet.tmDescent + textmet.tmExternalLeading;