ULRE/inc/hgl/graph/font/TileFont.h

46 lines
1.4 KiB
C
Raw Normal View History

2020-07-29 01:00:25 +08:00
#ifndef HGL_GRAPH_TILE_FONT_INCLUDE
2020-06-29 19:49:54 +08:00
#define HGL_GRAPH_TILE_FONT_INCLUDE
#include<hgl/graph/TileData.h>
#include<hgl/graph/font/FontSource.h>
#include<hgl/type/RefObjectPool.h>
2020-06-29 19:49:54 +08:00
namespace hgl
{
namespace graph
{
2023-07-28 20:17:46 +08:00
using TileUVFloatMap=Map<u32char,RectScope2f>;
using TileResPool=RefObjectPool<u32char,TileObject *>;
2020-07-31 18:01:28 +08:00
2020-07-01 20:36:49 +08:00
/**
* Tile字符管理<br>
* unicode块, unicode块只能对应一个字体数据来源
*/
2020-06-29 19:49:54 +08:00
class TileFont
{
2020-07-07 19:16:23 +08:00
FontSource *source;
2020-06-29 19:49:54 +08:00
TileData *tile_data;
TileResPool to_res;
2020-07-31 18:01:28 +08:00
2024-11-09 19:28:31 +08:00
SortedSet<u32char> not_bitmap_chars;
2022-02-18 20:30:50 +08:00
2020-07-31 18:01:28 +08:00
public:
FontSource *GetFontSource (){return source;}
TileData * GetTileData (){return tile_data;}
Texture2D * GetTexture (){return tile_data->GetTexture();}
2020-07-31 18:01:28 +08:00
2020-06-29 19:49:54 +08:00
public:
TileFont(TileData *td,FontSource *fs);
virtual ~TileFont();
2020-07-31 18:01:28 +08:00
2024-11-09 19:28:31 +08:00
bool Registry(TileUVFloatMap &,SortedSet<u32char> &chars_sets); ///<注册要使用的字符
2020-07-31 18:01:28 +08:00
void Unregistry(const List<u32char> &); ///<注销要使用的字符
2020-06-29 19:49:54 +08:00
};//class TileFont
}//namespace graph
}//namespace hgl
#endif//HGL_GRAPH_TILE_FONT_INCLUDE