TAttText
Text Alignment
The text alignment is an integer number (
align
) allowing to control the horizontal and vertical position of the text string with respect to the text position. The text alignment of any class inheriting from TAttText
can be changed using the method SetTextAlign
and retrieved using the method GetTextAlign
.
align = 10*HorizontalAlign + VerticalAlign
For horizontal alignment the following convention applies:
1=left adjusted, 2=centered, 3=right adjusted
For vertical alignment the following convention applies:
1=bottom adjusted, 2=centered, 3=top adjusted
For example:
align = 11 = left adjusted and bottom adjusted
align = 32 = right adjusted and vertically centered
color
The text color is a color index (integer) pointing in the ROOT color table. The text color of any class inheriting from
TAttText
can be changed using the method SetTextColor
and retrieved using the method GetTextColor
. The following table shows the first 50 default colors.Text Size
If the text precision (see next paragraph) is smaller than 3, the text size (
textsize
) is a fraction of the current pad size. Therefore the same textsize
value can generate text outputs with different absolute sizes in two different pads. The text size in pixels (charheight
) is computed the following way:
if (pad_width < pad_height) charheight = textsize*pad_width;
else charheight = textsize*pad_height;
If the text precision is equal to 3, the text size doesn’t depend on the pad’s dimensions. A given
textsize
value always generates the same absolute size. The text size (charheight
) is given in pixels:
charheight = textsize;
Note that to scale fonts to the same size as the old True Type package a scale factor of
0.93376068
is apply to the text size before drawing.
The text size of any class inheriting from
TAttText
can be changed using the method SetTextSize
and retrieved using the method GetTextSize
.
No comments:
Post a Comment