diff options
author | crupest <crupest@outlook.com> | 2020-10-30 00:07:57 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-10-30 00:07:57 +0800 |
commit | 6aa2201797a9ed64ce0178215ae941d0c5f09579 (patch) | |
tree | 9a74ee8d9f616afbe693ef7825a71474850831b5 /include/cru/platform/graphics/TextLayout.hpp | |
parent | b4cb4fb7552d35c267bdb66913e4c822f16346ab (diff) | |
download | cru-6aa2201797a9ed64ce0178215ae941d0c5f09579.tar.gz cru-6aa2201797a9ed64ce0178215ae941d0c5f09579.tar.bz2 cru-6aa2201797a9ed64ce0178215ae941d0c5f09579.zip |
...
Diffstat (limited to 'include/cru/platform/graphics/TextLayout.hpp')
-rw-r--r-- | include/cru/platform/graphics/TextLayout.hpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/cru/platform/graphics/TextLayout.hpp b/include/cru/platform/graphics/TextLayout.hpp new file mode 100644 index 00000000..efd017d6 --- /dev/null +++ b/include/cru/platform/graphics/TextLayout.hpp @@ -0,0 +1,24 @@ +#pragma once +#include "Resource.hpp" + +#include <string> +#include <vector> + +namespace cru::platform::graphics { +struct ITextLayout : virtual IGraphResource { + virtual std::u16string GetText() = 0; + virtual std::u16string_view GetTextView() = 0; + virtual void SetText(std::u16string new_text) = 0; + + virtual std::shared_ptr<IFont> GetFont() = 0; + virtual void SetFont(std::shared_ptr<IFont> font) = 0; + + virtual void SetMaxWidth(float max_width) = 0; + virtual void SetMaxHeight(float max_height) = 0; + + virtual Rect GetTextBounds() = 0; + virtual std::vector<Rect> TextRangeRect(const TextRange& text_range) = 0; + virtual Point TextSinglePoint(Index position, bool trailing) = 0; + virtual TextHitTestResult HitTest(const Point& point) = 0; +}; +} // namespace cru::platform::graph |