27 class GRAY3D_LINK cDXFont :
public cDXBaseT<ID3DXFont>
35 typedef cDXBaseT<ID3DXFont> SUPER_t;
38 cWinFontCfg m_FontCfg;
43 void SetFontChanged();
44 bool MeasureStr(cWinSize& sizeret,
const GChar_t* pszText);
48 cDXFont(
int iFontSize = 0,
const GChar_t* pszFontFaceName = k_szFontDef);
49 cDXFont(
const cDXFont& Font);
52 static const int k_SIZE_MIN = 6;
53 static const int k_SIZE_MAX = 80;
54 static const int k_SIZE_DEFAULT = 12;
55 static const GChar_t* k_szFontDef;
57 operator const cWinFontCfg&()
const
61 ID3DXFont* get_DXFont()
const
66 bool IsSameFont(
const cWinFontCfg& fontcfg)
const
68 return m_FontCfg.IsSameFont(fontcfg);
70 void put_Font(
const cDXFont& fontcfg);
72 void put_LogFontCfg(
const cWinFontCfg& fontcfg);
73 bool put_LogFontSystem(UINT uType = SPI_GETICONTITLELOGFONT);
75 int get_FontSize() const noexcept
77 return m_FontCfg.lfHeight;
79 int get_FontSizeA()
const
81 return m_FontCfg.get_FontSizeA();
83 void put_FontSize(
PIXELS_t iFontSize);
84 void put_FontWeight(
int lfWeight)
86 if (m_FontCfg.lfWeight == lfWeight)
88 m_FontCfg.lfWeight = lfWeight;
91 void put_FontFaceName(
const GChar_t* pszFaceName)
93 if (pszFaceName ==
nullptr)
94 pszFaceName =
_GT(
"");
95 if (!
StrT::Cmp(pszFaceName, m_FontCfg.lfFaceName))
97 StrT::CopyLen<GChar_t>(m_FontCfg.lfFaceName, pszFaceName,
_countof(m_FontCfg.lfFaceName));
101 bool put_FontHeight(
PIXELS_t iHeightPixels);
102 void put_FontSizeStr(SIZE size,
const cString& sText, DWORD dwFormatFlags = 0);
108 HRESULT GetFontRectW(cRectI&
rect,
const wchar_t* pwText,
StrLen_t iSizeChars, DWORD dwFormatFlags = 0);
109 HRESULT GetFontRectA(cRectI& rectText,
const char* pszText,
StrLen_t iSizeChars = -1, DWORD dwFormatFlags = 0);
110 HRESULT GetFontRectS(cRectI& rectText,
const cString& sText, DWORD dwFormatFlags = 0);
112 HRESULT AddTabs(
char* pszText,
int iWidthTabs,
PIXELS_t iTabWidth = 0);
115 HRESULT DrawTextW(ID3DXSprite* pSprite,
const wchar_t* pwText,
StrLen_t iSizeChars, cRectI&
rect, DWORD dwFormatFlags,
D3DCOLOR crTextColor);
116 HRESULT DrawTextEmbossW(ID3DXSprite* pSprite,
const wchar_t* pwText,
StrLen_t iSizeChars, cRectI&
rect, DWORD dwFormatFlags,
D3DCOLOR crTextColor);
#define GRAY3D_LINK
Definition: Gray3D.h:15
#define _GT(x)
like _T(x) macro for static text.
Definition: StrConst.h:27
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
DWORD D3DCOLOR
Stuff normally defined in windows.h or DirectX headers.
Definition: cColorRef.h:24
#define _countof(a)
Definition: cKernel.h:35
#define UNITTEST_FRIEND(n)
Define this in the class body to be unit tested. Allow the unit test to access private/protected stuf...
Definition: cUnitTestDecl.h:17
Definition: Gray3D.cpp:12
interface const RECTQ_t & rect
Definition: cQuadtree.h:44
int PIXELS_t
Count of pixels in a dimension of some image/surface.
Definition: cSurfaceInfo.h:20
int StrLen_t
the length of a string in chars (bytes for UTF8, wchar_t for UNICODE). or offset in characters....
Definition: StrConst.h:32
char GChar_t
My version of TCHAR, _TCHAR.
Definition: StrConst.h:26
cStringT< GChar_t > cString
Definition: cString.h:636
static __DECL_IMPORT COMPARE_t __stdcall Cmp(const TYPE *pszStr1, const TYPE *pszStr2)