/* ==================================================================== * ÆÄ ÀÏ : FontObject.h * ¸ñ Àû : ÆùÆ® °´Ã¼ÀÇ ±âº»Çü Á¦°ø * ÀÛ ¼º ÀÚ : À̹ý¼® * ÀÛ ¼º ÀÏ : 2006.10.10 * * Ãß°¡³»¿ë : * Ãß°¡³¯Â¥ ÀÛ¾÷ÀÚ Ãß°¡³»¿ë * 06.10.10 À̹ý¼® »ý¼º (¹¬Çâ ¿£Áø ÂüÁ¶) * * ÁÖÀÇ»çÇ× : * =================================================================== */ #pragma once struct sCacheInfo { unsigned int maxCacheItemNum; unsigned int texWidth; unsigned int texHeight; unsigned int texNum; sCacheInfo() { maxCacheItemNum = 1024; texWidth = 1024; texHeight = 256; texNum = 2; } }; class cFontObject { public: virtual ~cFontObject(); /// ÆùÆ®ÀÇ »ý¼º virtual bool CreateFont( HWND hwnd, LOGFONT* pLogFont, sCacheInfo& cacheInfo ) = 0; /// ÀåÄ¡ ¼Ò½Ç½Ã ó¸® ·çƾ virtual void Invalidate() { } virtual void Restore() { } /// ±ÛÀÚ Âï±â virtual bool DrawText( LPTSTR str, int strLen, RECT* pRect, unsigned long color, LPD3DXSPRITE pSprite, bool outerLine ) = 0; /// Font¸¦ ÀÌ¿ëÇÑ ¹®ÀÚ¿­¿¡ ´ëÇÑ Á¤º¸ virtual long GetTextExtent( HWND hwnd, LPCTSTR text, unsigned int textLen ); inline long GetTextWidth() { return mFontWidth; } inline long GetTextHeight() { return mFontHeight; } /// ÁÖÀÇ»çÇ× : offscreen¿¡ ÆùÆ®¸¦ ±×¸®´Â °æ¿ì´Â µî·Ï ÇØ¶ó!! virtual void SetAlpha( bool /*bAlpha*/ ) {} protected: cFontObject(); virtual bool SetFontInfo( HWND hwnd, LOGFONT* pLogFont ); protected: /// °ÔÀӺ긮¿À ¿£Áø¿¡¼­ Á¦°øÇÏ´Â Dx9°´Ã¼ NiDX9Renderer* mpRenderer; /// ÆùÆ®ÇÚµé HFONT mhFont; bool mOuter; /// ÆùÆ® »ý¼º½Ã ±âº» Á¤º¸ LOGFONT mLogFont; unsigned short mFontWidth; unsigned short mFontHeight; };