TLegend Entry wrong space padding

Hi,

I’m trying to build a legend and use space padding to align the entries, but it is not working. Is there a way around hard coding all the strings?

example:

    TCanvas *c = new TCanvas();
    Int_t bins[7] = {1, 22, 29, 35, 44, 70, 200};

    c->Draw();
    TLegend *leg = new TLegend(0.1,0.1,0.9,0.9);
    for(int i=0;i<6;i++){
        leg->AddEntry("test",Form("test: %3d - %3d",bins[i],bins[i+1]),"f");
    }
    leg->Draw();

I also tried to copy it into a char* with snprintf first, same result. It is aligned when printing to stdout but not in the canvas.

use a non proportional font:

leg->SetTextFont(82);