gdiplus: Move internal helper get_log_fontW() out of public GdipGetLogFontW() export.

oldstable
Dmitry Timoshkov 2012-10-24 18:10:30 +09:00 committed by Alexandre Julliard
parent 16d5f457e2
commit 71eb164482
2 changed files with 42 additions and 17 deletions

View File

@ -449,10 +449,18 @@ GpStatus WINGDIPAPI GdipGetLogFontA(GpFont *font, GpGraphics *graphics,
return Ok;
}
void get_log_fontW(const GpFont *font, GpGraphics *graphics, LOGFONTW *lf)
/*******************************************************************************
* GdipGetLogFontW [GDIPLUS.@]
*/
GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics, LOGFONTW *lf)
{
REAL height;
TRACE("(%p, %p, %p)\n", font, graphics, lf);
if (!font || !graphics || !lf)
return InvalidParameter;
if (font->unit == UnitPixel)
{
height = units_to_pixels(font->emSize, graphics->unit, graphics->yres);
@ -481,21 +489,8 @@ void get_log_fontW(const GpFont *font, GpGraphics *graphics, LOGFONTW *lf)
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = 0;
strcpyW(lf->lfFaceName, font->family->FamilyName);
}
/*******************************************************************************
* GdipGetLogFontW [GDIPLUS.@]
*/
GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics,
LOGFONTW *lfw)
{
TRACE("(%p, %p, %p)\n", font, graphics, lfw);
if(!font || !graphics || !lfw)
return InvalidParameter;
get_log_fontW(font, graphics, lfw);
TRACE("=> %s,%d\n", debugstr_w(lfw->lfFaceName), lfw->lfHeight);
TRACE("=> %s,%d\n", debugstr_w(lf->lfFaceName), lf->lfHeight);
return Ok;
}

View File

@ -2133,6 +2133,38 @@ end:
return stat;
}
void get_log_fontW(const GpFont *font, GpGraphics *graphics, LOGFONTW *lf)
{
REAL height;
if (font->unit == UnitPixel)
{
height = units_to_pixels(font->emSize, graphics->unit, graphics->yres);
}
else
{
if (graphics->unit == UnitDisplay || graphics->unit == UnitPixel)
height = units_to_pixels(font->emSize, font->unit, graphics->xres);
else
height = units_to_pixels(font->emSize, font->unit, graphics->yres);
}
lf->lfHeight = -(height + 0.5);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
lf->lfWeight = font->otm.otmTextMetrics.tmWeight;
lf->lfItalic = font->otm.otmTextMetrics.tmItalic ? 1 : 0;
lf->lfUnderline = font->otm.otmTextMetrics.tmUnderlined ? 1 : 0;
lf->lfStrikeOut = font->otm.otmTextMetrics.tmStruckOut ? 1 : 0;
lf->lfCharSet = font->otm.otmTextMetrics.tmCharSet;
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = 0;
strcpyW(lf->lfFaceName, font->family->FamilyName);
}
static void get_font_hfont(GpGraphics *graphics, GDIPCONST GpFont *font,
GDIPCONST GpStringFormat *format, HFONT *hfont)
{
@ -2153,8 +2185,6 @@ static void get_font_hfont(GpGraphics *graphics, GDIPCONST GpFont *font,
unit_scale = units_scale(font->unit, graphics->unit, res);
font_height = font->emSize * unit_scale;
if (graphics->unit != UnitDisplay)
font_height /= graphics->scale;
}
pt[0].X = 0.0;