diff options
author | crupest <crupest@outlook.com> | 2020-05-24 01:40:02 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-05-24 01:40:02 +0800 |
commit | d86a71f79afe0e4dac768f61d6bff690567aca5b (patch) | |
tree | 4957e9a64c77680deb07201fbd879bf036616dae /include/cru/platform/graph/TextLayout.hpp | |
parent | f3a8fd608a9776ef0a5f547da918a32cf6074060 (diff) | |
download | cru-d86a71f79afe0e4dac768f61d6bff690567aca5b.tar.gz cru-d86a71f79afe0e4dac768f61d6bff690567aca5b.tar.bz2 cru-d86a71f79afe0e4dac768f61d6bff690567aca5b.zip |
...
Diffstat (limited to 'include/cru/platform/graph/TextLayout.hpp')
-rw-r--r-- | include/cru/platform/graph/TextLayout.hpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/cru/platform/graph/TextLayout.hpp b/include/cru/platform/graph/TextLayout.hpp new file mode 100644 index 00000000..4086ac56 --- /dev/null +++ b/include/cru/platform/graph/TextLayout.hpp @@ -0,0 +1,23 @@ +#pragma once +#include "Resource.hpp" + +#include <string> +#include <vector> + +namespace cru::platform::graph { +struct ITextLayout : virtual IGraphResource { + virtual std::string GetText() = 0; + virtual void SetText(std::string 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(gsl::index position, bool trailing) = 0; + virtual TextHitTestResult HitTest(const Point& point) = 0; +}; +} // namespace cru::platform::graph |