ULRE/inc/hgl/graph/text/FontSource.h

51 lines
1.2 KiB
C
Raw Normal View History

2019-11-06 20:52:09 +08:00
#ifndef HGL_GRAPH_FONT_SOURCE_INCLUDE
#define HGL_GRAPH_FONT_SOURCE_INCLUDE
#include<hgl/graph/FontInfo.h>
namespace hgl
{
namespace graph
{
/**
* <br>
*
*/
class FontSource
{
public:
/**
*
*/
struct Bitmap
{
int x,y; //图像显示偏移
int w,h; //图像尺寸
int adv_x,adv_y;//字符尺寸
unsigned char *data;
};//struct Bitmap
protected:
FontInfo fnt;
FontSource::Bitmap char_bitmap[0xFFFF]; ///<字符位图数据
protected:
virtual bool MakeCharBitmap(u16char)=0; ///<产生字体数据
virtual int GetLineHeight()const=0; ///<取得行高
public:
FontSource(const FontInfo &);
virtual ~FontSource();
FontSource::Bitmap *GetCharBitmap(u16char); ///<取得字体数据
};//class FontSource
}//namespace graph
}//namespace hgl
#endif//HGL_GRAPH_FONT_SOURCE_INCLUDE