Re: Text angle/alignment in TText and TPaveText objects

Rene Brun (Rene.Brun@cern.ch)
Wed, 28 Oct 1998 08:28:19 +0100


Charles Leggett wrote:
>
> Is SetTextAngle() implemented for TPaveText objects? I can't seem to get it to
> work. ie:
>
> TPaveText *l1 = new TPaveText(0.9,0,1.1,.5);
> l1->AddText("text");
> l1->SetTextAngle(90.);
> l1->Draw();
>
> does not produce rotated text.
>
> Also, the meaning of SetTextAlign seems to shift for TText objects when
> SetTextAngle is used. That is, for text rotated 90 degrees, an alignment of (21)
> becomes an alignment of (12). Or another way of looking at it is that the X and
> Y axes that the alignment is done relative to are the axes of the text string,
> not those of the pad. Is this intentional?
>
> Charles Leggett

TPaveText::AddText returns a pointer to the TText object. Do:
TText *text = l1->AddText("text");
text->SetTextAngle(90);
text->SetTextAlign(22);
l1->Draw();

In the version 2.00/13 coming this week, I have added new functionality
to TPaveText. It is now possible to add/delete a line of text,
to change the text attributes,etc.

Rene Brun