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"
{
auto canvas = RCanvas::Create("RPave example");
pave->fill.color = RColor::kBlue;
pave->fill.style = RAttrFill::k3001;
pave->border.color = RColor::kGreen;
pave->corner = RPave::kTopLeft;
pave2->fill.color = RColor::kRed;
pave2->fill.style = RAttrFill::k3002;
pave2->corner = RPave::kBottomLeft;
text->AddLine(
"This is RPaveText");
text->AddLine(
"It can have several lines");
text->AddLine(
"It should be in top right corner");
text->fill.color = RColor::kYellow;
text->fill.style = RAttrFill::k3003;
text->corner = RPave::kTopRight;
auto pos =
fname.find(
"rpave.cxx");
if (pos > 0) {
fname.resize(pos);
fname.append(
"comic.woff2"); }
else fname =
"comic.woff2";
text2->AddLine(
"RPaveText with custom font");
text2->AddLine(
"It loaded from comic.woff2 file");
text2->AddLine(
"One also can provide valid URL");
text2->fill.color = RColor::kGreen;
text2->fill.style = RAttrFill::k3004;
text2->corner = RPave::kBottomRight;
text2->text.font.family =
"CustomFont";
canvas->SetSize(1000, 700);
canvas->Show();
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char text
Base class for paves with text, statistic, legends, placed relative to RFrame position and adjustable...
- Date
- 2020-06-18
- Warning
- This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
- Author
- Sergey Linev s.lin.nosp@m.ev@g.nosp@m.si.de
Definition in file rpave.cxx.