{
TCanvas *c = new TCanvas;
TLatex *l = new TLatex(0.5, 0.5, "AVAVAVAVAVAVAVAVAVA#color[2]{X}");
l->Draw();
c->SaveAs("c1.eps");
}
The original idea came from Oleksandr Grebenyuk. It has been implemented
in a such way that the kerning mechanism is activated only when needed. If
not needed the old way of text rendering is used. It was done that way
because most of the time kerning is not needed and text rendered using
the kerning mechanism takes more space in the PS/PDF files.
{
TCanvas* canvas = new TCanvas("canvas");
TH1F* histo = new TH1F("histo","test 1",10,0.,10.);
histo->SetFillColor(2);
histo->Fill(2.);
histo->Draw();
canvas->Print("plots.pdf(","Title:One bin filled");
histo->Fill(4.);
histo->Draw();
canvas->Print("plots.pdf","Title:Two bins filled");
histo->Fill(6.);
histo->Draw();
canvas->Print("plots.pdf","Title:Three bins filled");
histo->Fill(8.);
histo->Draw();
canvas->Print("plots.pdf","Title:Four bins filled");
histo->Fill(8.);
histo->Draw();
canvas->Print("plots.pdf)","Title:The fourth bin content is 2");
}
Each character string following the keyword "Title:" makes a new entry in
the table of contents.
TText t(.5,.5,"\\t\\");
t.Draw();
{
TImage *img = TImage::Open("$ROOTSYS/tutorials/image/rose512.jpg");
img->Draw("x");
gPad->Update();
TH1F *h1f = new TH1F("h1f","Test random numbers",100,-5,5);
h1f->FillRandom("gaus",10000);
h1f->Draw();
gPad->Update();
}
{
TCanvas c("c","c",0,0,400,100);
TLatex t0(.05,.45,"Symbol: #font[122]{abc} - Symbol Italic #font[152]{abc}");
t0.SetTextSize(0.36);
t0.Draw();
c.Print("symbolitalic.ps");
c.Print("symbolitalic.pdf");
c.Print("symbolitalic.gif");
c.Print("symbolitalic.svg");
}
{
gStyle->SetTextFont(132);
(new TLatex(0.01, 0.9, "Positive k#kern[0.3]{e}#kern[0.3]{r}#kern[0.3]{n}#kern[0.3]{i}#kern[0.3]{n}#kern[0.3]{g} with #^{}kern[0.3]"))->Draw();
(new TLatex(0.01, 0.7, "Negative k#kern[-0.3]{e}#kern[-0.3]{r}#kern[-0.3]{n}#kern[-0.3]{i}#kern[-0.3]{n}#kern[-0.3]{g} with #^{}kern[-0.3]"))->Draw();
(new TLatex(0.01, 0.5, "Vertical a#lower[0.2]{d}#lower[0.4]{j}#lower[0.1]{u}#lower[-0.1]{s}#lower[-0.3]{t}#lower[-0.4]{m}#lower[-0.2]{e}#lower[0.1]{n}t with #^{}lower[-0.4...+0.4]"))->Draw();
(new TLatex(0.01, 0.3, "Font styles: #^{}bf{#bf{bold}}, #^{}it{#it{italic}}, #^{}bf{#^{}it{#bf{#it{bold italic}}}}, #^{}bf{#^{}bf{#bf{#bf{unbold}}}}"))->Draw();
(new TLatex(0.01, 0.1, "Font styles: abc#alpha#beta#gamma, #^{}it{#it{abc#alpha#beta#gamma}}, #^{}it{#^{}it{#it{#it{abc#alpha#beta#gamma}}}}"))->Draw();
}
t1 = new TH1F("test","test", 100,1,1000);
t1.Draw();
gPad->SetLogx(1);