// DUiText.cpp: implementation of the CDUiText class.
//
//////////////////////////////////////////////////////////////////////

#include "DUiMan.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CDUiFont::CDUiFont()
{
    SetObjectType(DUI_FONT);

    m_wszFontName[0] = NULL;

    m_hFont = NULL;

}

CDUiFont::~CDUiFont()
{
    if (m_hFont)
    {
        DeleteObject(m_hFont);
    }
}


DWORD CDUiFont::Initialize()
{
    LOGFONT Font;

    memset(&Font,0,sizeof(Font));
    Font.lfHeight = 0;
    Font.lfWidth = 0;
    Font.lfEscapement = 0;
    Font.lfOrientation = 0;
    Font.lfWeight = 700;
    Font.lfItalic  = FALSE;
    Font.lfUnderline  = FALSE;
    Font.lfStrikeOut  = FALSE;
    Font.lfCharSet  = ANSI_CHARSET;
    Font.lfOutPrecision = OUT_DEFAULT_PRECIS;
    Font.lfClipPrecision = CLIP_DEFAULT_PRECIS;
    Font.lfQuality = DEFAULT_QUALITY;
    Font.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
    wcscpy(Font.lfFaceName,m_wszFontName);
    m_hFont = CreateFontIndirect(&Font);

    return 0;
}

