mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
gdiplus: Implement GdipIsStyleAvailable.
This commit is contained in:
parent
7dfc674437
commit
b7c9adcd06
1 changed files with 28 additions and 2 deletions
|
@ -760,15 +760,41 @@ GpStatus WINGDIPAPI GdipGetLineSpacing(GDIPCONST GpFontFamily *family,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
static INT CALLBACK font_has_style_proc(const LOGFONTW *elf,
|
||||
const TEXTMETRICW *ntm, DWORD type, LPARAM lParam)
|
||||
{
|
||||
INT fontstyle=0;
|
||||
|
||||
if (!ntm) return 1;
|
||||
|
||||
if (ntm->tmWeight >= FW_BOLD) fontstyle |= FontStyleBold;
|
||||
if (ntm->tmItalic) fontstyle |= FontStyleItalic;
|
||||
if (ntm->tmUnderlined) fontstyle |= FontStyleUnderline;
|
||||
if (ntm->tmStruckOut) fontstyle |= FontStyleStrikeout;
|
||||
|
||||
return (INT)lParam != fontstyle;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipIsStyleAvailable(GDIPCONST GpFontFamily* family,
|
||||
INT style, BOOL* IsStyleAvailable)
|
||||
{
|
||||
FIXME("%p %d %p stub!\n", family, style, IsStyleAvailable);
|
||||
HDC hdc;
|
||||
|
||||
TRACE("%p %d %p\n", family, style, IsStyleAvailable);
|
||||
|
||||
if (!(family && IsStyleAvailable))
|
||||
return InvalidParameter;
|
||||
|
||||
return NotImplemented;
|
||||
*IsStyleAvailable = FALSE;
|
||||
|
||||
hdc = GetDC(0);
|
||||
|
||||
if(!EnumFontFamiliesW(hdc, family->FamilyName, font_has_style_proc, (LPARAM)style))
|
||||
*IsStyleAvailable = TRUE;
|
||||
|
||||
ReleaseDC(0, hdc);
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
Loading…
Reference in a new issue