comparison Framework/Radiography/RadiographyTextLayer.h @ 1190:f417a0ae282b

wip: TextLayer with new fonts
author Alain Mazy <alain@mazy.be>
date Tue, 26 Nov 2019 15:27:48 +0100
parents 77e0eb83ff63
children c6a36ecd641d
comparison
equal deleted inserted replaced
1184:848dcba80d81 1190:f417a0ae282b
28 class RadiographyScene; 28 class RadiographyScene;
29 29
30 class RadiographyTextLayer : public RadiographyAlphaLayer 30 class RadiographyTextLayer : public RadiographyAlphaLayer
31 { 31 {
32 private: 32 private:
33 std::string text_; 33 std::string text_;
34 std::string fontName_; 34 size_t fontSize_;
35 uint8_t foreground_;
35 36
37 static bool fontHasBeenConfigured_;
38 static Orthanc::EmbeddedResources::FileResourceId fontResourceId_;
36 public: 39 public:
37 RadiographyTextLayer(MessageBroker& broker, const RadiographyScene& scene) : 40 RadiographyTextLayer(MessageBroker& broker, const RadiographyScene& scene) :
38 RadiographyAlphaLayer(broker, scene) 41 RadiographyAlphaLayer(broker, scene)
39 { 42 {
40 } 43 }
41 44
42 void LoadText(const Orthanc::Font& font, 45 void LoadText(const std::string& utf8, size_t fontSize, uint8_t foreground);
43 const std::string& utf8);
44 46
45 const std::string& GetText() const 47 const std::string& GetText() const
46 { 48 {
47 return text_; 49 return text_;
48 } 50 }
49 51
50 const std::string& GetFontName() const 52 const size_t& GetFontSize() const
51 { 53 {
52 return fontName_; 54 return fontSize_;
55 }
56
57 const size_t& GetForeground() const
58 {
59 return foreground_;
60 }
61
62 static void SetFont(Orthanc::EmbeddedResources::FileResourceId fontResourceId)
63 {
64 fontResourceId_ = fontResourceId;
65 fontHasBeenConfigured_ = true;
53 } 66 }
54 }; 67 };
55 } 68 }