⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cfont.h

📁 墨香最新私服
💻 H
字号:
// cFont.h: interface for the cFont class.
//
//////////////////////////////////////////////////////////////////////

#ifndef _cFONT_H_
#define _cFONT_H_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

//#include "cWindowDef.h"
#include "../Engine/GraphicEngine.h"
#include "../4DyuchiGRX_common/IGeometry.h"


#define CFONT_OBJ	USINGTON(cFont)

typedef struct _FONT_DESC
{
	WORD wWidth;
	WORD wHeight;
	//WORD wHalfWidth;
	//WORD wHalfHeight;
}FONT_DESC;

class cFont  
{
public:
	enum FONT_KIND{FONT0=0, FONT1, FONT2, FONT3, FONT4, FONTMAX};
	cFont();
	virtual ~cFont();
	void Release();
	// GetInstance()
//	MAKESINGLETON(cFont);
	BOOL CreateFontObject(LOGFONT *pFont, WORD idx);
	void RenderFont(WORD wFontIdx, char * text, int size, RECT * pRect, DWORD color);
	IDIFontObject * GetFont(WORD idx)
	{
		#ifdef _DEBUG
		if(idx>FONTMAX||idx<0) return NULL;
		#endif //_DEBUG
		return m_pFont[idx];
	}
	BOOL IsCreateFont(WORD idx)
	{
		if(idx>FONTMAX||idx<0) return FALSE;
		if(m_pFont[idx]) return TRUE;
		else return FALSE;
	}
	LONG GetTextExtent(WORD hFIdx, char *str, LONG strSize);
	LONG GetTextHeight(WORD hFIdx) { return m_FontDesc[hFIdx].wHeight; }
	LONG GetTextWidth(WORD hFIdx) { return m_FontDesc[hFIdx].wWidth; }
	IDIFontObject * m_pFont[FONTMAX];
	FONT_DESC m_FontDesc[FONTMAX];
	
//KES 030915
	HFONT m_hFont[FONTMAX];
	LONG GetTextExtentEx( WORD hFIdx, char* str, int strLen );
};
EXTERNGLOBALTON(cFont);
#endif // _cFONT_H_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -