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

📄 instifont.h

📁 跨平台2D引擎
💻 H
字号:
//instIFont.h
#ifndef INST_IFONT_H
#define INST_IFONT_H


#include <instTypes.h>
#include <instDefines.h>
#include <instStr.h>


namespace inst
{


class IFont:virtual public IDynamic
{
public:
	virtual ~IFont(){}
	virtual Bool IsA(const CStr &name)const{ return name==L"inst::IFont" || IDynamic::IsA(name); }
public:
	virtual CStr GetName()const=0;
	virtual void SetName(const CStr &name)=0;
	virtual Int32 GetHeight()const=0;
	virtual void SetHeight(POS h)=0;
	virtual Bool IsBold()const=0;
	virtual void SetBold(Bool b)=0;
	virtual Bool IsItalic()const=0;
	virtual void SetItalic(Bool i)=0;
	virtual Bool IsUnderline()const=0;
	virtual void SetUnderline(Bool un)=0;
	virtual UByte GetCharSet()const=0;
	virtual void GetCharSet(UByte cs)=0;

	virtual POS GetCharWidth(WChar wch)const=0;
	virtual POS GetStrWidth(const CStr &str)const=0;
};


typedef UInt32 DRAWTEXTFLAGS;

const DRAWTEXTFLAGS DTF_TOP				=	0x0000; //必须同时指定DTF_SINGLE指示文本对齐格式化矩形的顶部
const DRAWTEXTFLAGS DTF_LEFT			=	0x0000; //文本左对齐
const DRAWTEXTFLAGS DTF_CENTER			=	0x0001; //文本垂直居中
const DRAWTEXTFLAGS DTF_RIGHT			=	0x0002; //文本右对齐
const DRAWTEXTFLAGS DTF_VCENTER			=	0x0004; //必须同时指定DTF_SINGLE指示文本对齐格式化矩形的中部
const DRAWTEXTFLAGS DTF_BOTTOM			=	0x0008; //必须同时指定DTF_SINGLE指示文本对齐格式化矩形的底边
const DRAWTEXTFLAGS DTF_WORDBREAK		=	0x0010; //进行自动换行
const DRAWTEXTFLAGS DTF_SINGLELINE		=	0x0020; //只画单行
const DRAWTEXTFLAGS DTF_EXPANDTABS		=	0x0040; //描绘文字的时候,对制表站进行扩展。默认的制表站间距是8个字符。但是,可用DTF_TABSTOP标志改变这项设定
const DRAWTEXTFLAGS DTF_TABSTOP			=	0x0080; //指定新的制表站间距,采用这个整数的高8位
const DRAWTEXTFLAGS DTF_NOCLIP			=	0x0100; //描绘文字时不剪切到指定的矩形
//以上所有位的mask==0x1FF (0001 1111 1111)但是,tabstop"采用这个整数的高8位"
const DRAWTEXTFLAGS DRAWTEXTFLAGS_MASK	=	0xFF0001FF; //所以就是0xFF0001FF


}// end of namespace inst


#endif

⌨️ 快捷键说明

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