aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/graph/text_layout.hpp
blob: 4f6e81e1bb8f59537dedf6ea4521449a70a3632d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once
#include "resource.hpp"

#include <memory>
#include <string>
#include <vector>

namespace cru::platform::graph {
struct IFont;

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;
};
}  // namespace cru::platform::graph