From a3745e927ddfc1c8d44070cad6ffe500b7ec7d98 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Mon, 20 Jul 2020 21:29:15 +0800 Subject: [PATCH] add TextLayout --- inc/hgl/graph/font/TextLayout.h | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/inc/hgl/graph/font/TextLayout.h b/inc/hgl/graph/font/TextLayout.h index 23d02d98..5e7f8df1 100644 --- a/inc/hgl/graph/font/TextLayout.h +++ b/inc/hgl/graph/font/TextLayout.h @@ -3,16 +3,12 @@ #include #include -#include +#include +#include namespace hgl { namespace graph { - - class TextRenderable:public vulkan::Renderable - { - };//class TextRenderable:public vulkan::Renderable - /** * 文本排版处理 */ @@ -20,12 +16,26 @@ namespace hgl { FontSource *source; + public: + + enum class Direction + { + LeftToRight=0, ///<横排从左到右 + RightToLeft, ///<横排从右到左 + TopToRight, ///<坚排从上到下从右到左 + };//enum class Direction + + RectScope2f scope; ///<绘制区域 + + bool text_symbols; ///<是否开启文本到符号自动替换 + bool symbols_edge_disable; ///<符号边界禁用 + public: TextLayout(FontSource *fs):source(fs){} virtual ~TextLayout()=default; - + bool Layout(const UTF16String &); };//class TextLayout }//namespace graph }//namespace hgl