codes layout
This commit is contained in:
parent
556e523684
commit
33b8ce120e
2
CMCore
2
CMCore
@ -1 +1 @@
|
|||||||
Subproject commit 9a2368d749699b67065646265110ba089a0264a4
|
Subproject commit 53449b1d4c579efd6f8bd2de6b315cc0663a1ecd
|
@ -56,7 +56,7 @@ namespace hgl
|
|||||||
/**
|
/**
|
||||||
* 文本排版属性
|
* 文本排版属性
|
||||||
*/
|
*/
|
||||||
struct TextLayoutAttributes
|
struct TextLayoutAttribute
|
||||||
{
|
{
|
||||||
FontSource * font_source =nullptr; ///<字符源
|
FontSource * font_source =nullptr; ///<字符源
|
||||||
CharLayoutAttr *char_layout_attr =nullptr; ///<缺省字符排版属性
|
CharLayoutAttr *char_layout_attr =nullptr; ///<缺省字符排版属性
|
||||||
@ -78,7 +78,9 @@ namespace hgl
|
|||||||
float tab_size =4.0f; ///<Tab符号尺寸(对应字符高度的系数)
|
float tab_size =4.0f; ///<Tab符号尺寸(对应字符高度的系数)
|
||||||
|
|
||||||
bool compress_punctuation =false; ///<压缩标点符号
|
bool compress_punctuation =false; ///<压缩标点符号
|
||||||
};//struct TextLayoutAttributes
|
};//struct TextLayoutAttribute
|
||||||
|
|
||||||
|
using TLA=TextLayoutAttribute;
|
||||||
|
|
||||||
using TEXT_COORD_TYPE=int; //字符必须坐标对齐显示才能不模糊,所以这里坐标系全部使用整型坐标
|
using TEXT_COORD_TYPE=int; //字符必须坐标对齐显示才能不模糊,所以这里坐标系全部使用整型坐标
|
||||||
|
|
||||||
@ -87,7 +89,7 @@ namespace hgl
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
FontSource *font_source;
|
FontSource *font_source;
|
||||||
TextLayoutAttributes tla;
|
TextLayoutAttribute tla;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@ -155,10 +157,10 @@ namespace hgl
|
|||||||
|
|
||||||
virtual ~TextLayout()=default;
|
virtual ~TextLayout()=default;
|
||||||
|
|
||||||
void Set (const TextLayoutAttributes *_tla) {if(_tla)hgl_cpy(&tla,_tla);}
|
void Set (const TLA * _tla) {if(_tla)hgl_cpy(&tla,_tla);}
|
||||||
void SetFont (FontSource *fs) {if(fs)font_source=fs;}
|
void SetFont ( FontSource * fs) {if(fs)font_source=fs;}
|
||||||
void SetTextDirection (const uint8 &td) {tla.text_direction=td;}
|
void SetTextDirection (const uint8 & td) {tla.text_direction=td;}
|
||||||
void SetAlign (const TextAlign &ta) {tla.align=ta;}
|
void SetAlign (const TextAlign & ta) {tla.align=ta;}
|
||||||
void SetMaxWidth (const float mw) {tla.max_width=mw;}
|
void SetMaxWidth (const float mw) {tla.max_width=mw;}
|
||||||
void SetMaxHeight (const float mh) {tla.max_height=mh;}
|
void SetMaxHeight (const float mh) {tla.max_height=mh;}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ namespace hgl
|
|||||||
bool TextRender::InitTextLayoutEngine()
|
bool TextRender::InitTextLayoutEngine()
|
||||||
{
|
{
|
||||||
CharLayoutAttr cla;
|
CharLayoutAttr cla;
|
||||||
TextLayoutAttributes tla;
|
TextLayoutAttribute tla;
|
||||||
|
|
||||||
cla.CharColor=Color4f(COLOR::White);
|
cla.CharColor=Color4f(COLOR::White);
|
||||||
cla.BackgroundColor=Color4f(COLOR::Black);
|
cla.BackgroundColor=Color4f(COLOR::Black);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user