Split lines in TText or TLatex

Hi

I am reading strings from an ASCII-file and would like to place them quite close to the right border of a canvas I created. In many cases the strings are too long and, therefore, parts of the line are not visible anymore since the are beyond the border of the canvas.
Is there a simple way to split the lines without going through the string and using #splitline?

Cheers,
delos

No, if you use one single to TLatex it is the only way.
You can also to several call to TLatex.
You can also do a right alignment … surely it is the best see:
root.cern.ch/root/html604/TAttText.html#T1

Hi couet

Thanks for the reply. I can’t use right alignment though, because the text would then reach into my graph I placed on the left hand side of the text.

Cheers,
delos

By the way:

Some of the text disappears when I resize the window and when I print it a pdf the text is italic.

Cheers,
delos

Yes the font do not have all the same extension. You can also you a TPaveText instead of a simple text.
It will make sure the text fits in a box.
root.cern.ch/root/html604/TPaveText.html

Hi couet

Thanks. TPaveText seems to resize the text if it doesn’t fit inside the box. It doesn’t wrap the lines if they are too long (maybe an idea for a new feature?).

Cheers,
delos

Hi

I am still having a hard time wrapping my Text and fitting it into a text box. Anyone who had a similar problem?

Cheers,
Joachim

There is no automatic text box doing wrapping.
Simple add line in the PaveText and it will make sure the text will fit in the box…
but no wrapping.