This macro draw different variants of RPave on the RCanvas.
Also usage of custom font is demonstrated.
#include "ROOT/RPaveText.hxx"
#include "ROOT/RFont.hxx"
void rpave()
{
auto pave = canvas->Draw<
RPave>();
pave->border.width = 3;
pave->offsetX = pave->offsetY = 0.05_normal;
pave->width = 0.3_normal;
pave->height = 0.3_normal;
auto pave2 = canvas->Draw<
RPave>();
pave2->offsetX = pave2->offsetY = 0.05_normal;
pave2->width = 0.3_normal;
pave2->height = 0.3_normal;
auto text = canvas->Draw<RPaveText>();
text->AddLine(
"This is RPaveText");
text->AddLine(
"It can have several lines");
text->AddLine(
"It should be in top right corner");
text->offsetX =
text->offsetY = 0.05_normal;
text->width = 0.4_normal;
text->height = 0.3_normal;
std::string fname = __FILE__;
auto pos = fname.find(
"rpave.cxx");
fname.append("comic.woff2");
} else
fname = "comic.woff2";
canvas->Draw<RFont>("CustomFont", fname);
auto text2 = canvas->Draw<RPaveText>();
text2->AddLine("RPaveText with custom font");
text2->AddLine("It loaded from comic.woff2 file");
text2->AddLine("One also can provide valid URL");
text2->offsetX = text2->offsetY = 0.05_normal;
text2->width = 0.4_normal;
text2->height = 0.3_normal;
text2->text.font.family = "CustomFont";
canvas->SetSize(1000, 700);
canvas->Show();
}
RAttrValue< RColor > color
! fill color
static std::shared_ptr< RCanvas > Create(const std::string &title)
Create new canvas instance.
static R__DLLEXPORT constexpr RGB_t kRed
static R__DLLEXPORT constexpr RGB_t kYellow
static R__DLLEXPORT constexpr RGB_t kGreen
static R__DLLEXPORT constexpr RGB_t kBlue
Base class for paves with text, statistic, legends, placed relative to RFrame position and adjustable...
RAttrFill fill
! fill attributes
Namespace for ROOT features in testing.