Hello,
I am trying to store a number of canvases in a pdf file that needs to inherit a name from a histogram bin label. The string and const char* sets up fine, and the canvas definitely has a value stored to it, but when I try to print the pdf I get a seg fault.
This is what I am doing: [code]
const char* tagn=cuttags->GetXaxis()->GetBinLabel(j+1);
tagname.at(j)=tagn;
tagname.at(j);
std::transform(tagname.at(j).begin(), tagname.at(j).end(), tagname.at(j).begin(), [](char ch)
{return ch==’ ’ ? ‘_’ :ch;
});
string tago=tagname.at(j)+".pdf";
const char* tag=tago.c_str();
string closetag=tagname.at(j)+".pdf)";
string opentag=tagname.at(j)+".pdf(";
const char* ct=closetag.c_str();
const char* ot=opentag.c_str();
canvas[0][j]->Print(ot);
for (int i=1; i<10; i++)
{
canvas[i][j]->Print(tag);
}
canvas[10][j]->Print(ct);
[/code]
with the error happening at the first Print useage.
The first few lines of the stack trace are #5 0x00000030c08183f9 in FT_Done_Glyph () from /usr/lib64/libfreetype.so.6
#6 0x00007f2b009bf3f8 in TTF::LayoutGlyphs() () from /a/data/xenia/share/atlas/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/lib/libGraf.so
#7 0x00007f2b009bffe3 in TTF::GetTextAdvance(unsigned int&, char*) () from /a/data/xenia/share/atlas/ATLASLocalRootBase/x86_64/root/6.04.16-x86_64-slc6-gcc49-opt/lib/libGraf.so
Is it possible to print canvases in this manner?