TLegend problem with saved raster graphics

This is an up-to-date ROOT “v5-34-00-patches” here (Ubuntu 10.04.4 LTS / i686, gcc 4.4.3) …

A “minimal” working example: [code]{
TF1 *f1 = new TF1(“f1”, “TMath::BreitWigner(x,[0],[1])”, -10, 10);
f1->SetLineColor(kBlue);
f1->SetParameters(-3, 3);

TF1 *f2 = new TF1(“f2”, “TMath::Gaus(x,[0],[1],1)”, -10, 10);
f2->SetLineColor(kBlack);
f2->SetParameters(3, 3);

TLegend *legend = new TLegend(0.55, 0.72, 0.88, 0.88, “”, “brNDC”);
legend->SetFillColor(gStyle->GetCanvasColor());
legend->AddEntry(f1, “Breit-Wigner (X#mu=-3.0,X#Gamma=3.0)”, “l”);
legend->AddEntry(f2, “Gaussian (X#mu=3.0,X#sigma=3.0)”, “l”);

TCanvas *canvas = new TCanvas(“canvas”,“canvas”);
f1->Draw(“L”);
f2->Draw(“L SAME”);
legend->Draw();

canvas->SaveAs(“canvas.eps”);
canvas->SaveAs(“canvas.pdf”);
canvas->SaveAs(“canvas.gif”);
canvas->SaveAs(“canvas.jpg”);
}[/code] Compare the saved vector graphics files (".eps", “.pdf”) with the saved raster graphics files (".gif", “.jpg”). Note that in the saved raster graphics files there is a “space character” in the middle of “X#mu”, “X#Gamma”, “X#sigma”, which should NOT be there (and in fact everything is fine in the saved vector graphics files).

Another question is … if I do NOT say “legend->SetFillColor(gStyle->GetCanvasColor());”, the legend is “grey” … while the whole canvas is “white” … shouldn’t the “FillColor” of the legend be automatically set the same as the “CanvasColor”?

yes, weird … is that new ?

Yes that would be better may be.

I do not know when the “additional space” problem appeared.
I can only say that it is not present in v5-28-00-patches, while it is there in v5-34-00-patches (for at least the last 4 months).

ok. looking at it now.

I think I know what it is.
I think you should have the same problem with 5.28 running in batch.
I am rebuilding 5.28 now.

I checked the v5-28-00-patches in batch mode. No “apparent” problem in saved raster graphics.

I noticed a small problem in the “.eps” file in v5-28-00-patches, though. In the upper line “X#mu” are “too close” to each other (actually the right side of “X” covers the left side of “#mu”). This does not appear in the bottom line (there’s another “X#mu”), but in this line the “,” character is too close to “X”.
Maybe these problem are closely related to the original “additional space”?

I do not think so. I am investigating.