add TileFont/FontManage
This commit is contained in:
26
inc/hgl/graph/font/FontManage.h
Normal file
26
inc/hgl/graph/font/FontManage.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef HGL_GRAPH_FONT_MANAGE_INCLUDE
|
||||
#define HGL_GRAPH_FONT_MANAGE_INCLUDE
|
||||
|
||||
#include<hgl/graph/font/Font.h>
|
||||
#include<hgl/type/Map.h>
|
||||
namespace hgl
|
||||
{
|
||||
namespace graph
|
||||
{
|
||||
struct FontConfig
|
||||
{
|
||||
};//
|
||||
|
||||
/**
|
||||
* 字体管理模块,包括所有的字体数据源,以及字符绘制器。<br>
|
||||
* 在可期的未来,我们会增加对字体、字符的使用情况统计信息
|
||||
*/
|
||||
class FontManage
|
||||
{
|
||||
MapObject<Font,FontSource> sources;
|
||||
|
||||
TileFont *
|
||||
};//class FontManage
|
||||
}//namespace graph
|
||||
}//namespace hgl
|
||||
#endif//HGL_GRAPH_FONT_MANAGE_INCLUDE
|
@@ -3,20 +3,34 @@
|
||||
|
||||
#include<hgl/graph/TileData.h>
|
||||
#include<hgl/graph/font/FontSource.h>
|
||||
#include<hgl/type/UnicodeBlocks.h>
|
||||
|
||||
namespace hgl
|
||||
{
|
||||
namespace graph
|
||||
{
|
||||
/**
|
||||
* Tile字符管理<br>
|
||||
* 本模块允许有多个字符数据来源,每个来源也可以对应多个unicode块, 但一个unicode块只能对应一个字体数据来源
|
||||
*/
|
||||
class TileFont
|
||||
{
|
||||
FontSource *source;
|
||||
using FontSourcePointer=FontSource *;
|
||||
using FontSourceTable=FontSourcePointer[(size_t)UnicodeBlock::RANGE_SIZE];
|
||||
|
||||
FontSourceTable source_map;
|
||||
|
||||
TileData *tile_data;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
TileFont()
|
||||
{
|
||||
hgl_zero(source_map);
|
||||
}
|
||||
};//class TileFont
|
||||
|
||||
TileFont *CreateTileFont(const Font &,const int=-1);
|
||||
}//namespace graph
|
||||
}//namespace hgl
|
||||
#endif//HGL_GRAPH_TILE_FONT_INCLUDE
|
||||
|
Reference in New Issue
Block a user