24#include "ROOT/RPaveText.hxx"
25#include "ROOT/RFont.hxx"
32 auto canvas = RCanvas::Create(
"RPave example");
35 auto pave = canvas->Draw<
RPave>();
37 pave->fill.style = RAttrFill::k3001;
38 pave->border.color = RColor::kGreen;
39 pave->border.width = 3;
40 pave->corner = RPave::kTopLeft;
41 pave->offsetX = pave->offsetY = 0.05_normal;
42 pave->width = 0.3_normal;
43 pave->height = 0.3_normal;
46 auto pave2 = canvas->Draw<
RPave>();
48 pave2->fill.style = RAttrFill::k3002;
49 pave2->corner = RPave::kBottomLeft;
50 pave2->offsetX = pave2->offsetY = 0.05_normal;
51 pave2->width = 0.3_normal;
52 pave2->height = 0.3_normal;
54 auto text = canvas->Draw<RPaveText>();
55 text->AddLine(
"This is RPaveText");
56 text->AddLine(
"It can have several lines");
57 text->AddLine(
"It should be in top right corner");
58 text->fill.color = RColor::kYellow;
59 text->fill.style = RAttrFill::k3003;
60 text->corner = RPave::kTopRight;
61 text->offsetX =
text->offsetY = 0.05_normal;
62 text->width = 0.4_normal;
63 text->height = 0.3_normal;
65 std::string fname = __FILE__;
66 auto pos = fname.find(
"rpave.cxx");
67 if (pos > 0) { fname.resize(pos); fname.append(
"comic.woff2"); }
68 else fname =
"comic.woff2";
69 canvas->Draw<RFont>(
"CustomFont", fname);
71 auto text2 = canvas->Draw<RPaveText>();
72 text2->AddLine(
"RPaveText with custom font");
73 text2->AddLine(
"It loaded from comic.woff2 file");
74 text2->AddLine(
"One also can provide valid URL");
75 text2->fill.color = RColor::kGreen;
76 text2->fill.style = RAttrFill::k3004;
77 text2->corner = RPave::kBottomRight;
78 text2->offsetX = text2->offsetY = 0.05_normal;
79 text2->width = 0.4_normal;
80 text2->height = 0.3_normal;
81 text2->text.font.family =
"CustomFont";
83 canvas->SetSize(1000, 700);
Option_t Option_t TPoint TPoint const char text
RAttrValue< RColor > color
! fill color
Base class for paves with text, statistic, legends, placed relative to RFrame position and adjustable...
RAttrFill fill
! fill attributes