library: libCore #include "TAttText.h"

# TAttText

class description - source file - inheritance tree (.pdf)

## class TAttText

| Inheritance Chart:

`TAttText`

<-

`TButton`

<-

`TGroupButton` |

`TDialogCanvas`

<-

`TAttFillCanvas` |

`TAttLineCanvas` |

`TAttMarkerCanvas` |

`TAttTextCanvas` |

`TDrawPanelHist` |

`TFitPanel`

<-

`TFitPanelGraph` |

[more...]

        public:

                          TAttText()
                          TAttText(Int_t align, Float_t angle, Color_t color, Style_t font, Float_t tsize)
                          TAttText(const TAttText&)
                  virtual ~TAttText()
           static TClass* Class()
                     void Copy(TAttText& atttext) const
          virtual Short_t GetTextAlign() const
          virtual Float_t GetTextAngle() const
          virtual Color_t GetTextColor() const
           virtual Font_t GetTextFont() const
          virtual Float_t GetTextSize() const
          virtual TClass* IsA() const
             virtual void Modify()
                TAttText& operator=(const TAttText&)
             virtual void ResetAttText(Option_t* toption = "")
             virtual void SaveTextAttributes(ofstream& out, const char* name, Int_t alidef = 12, Float_t angdef = 0, Int_t coldef = 1, Int_t fondef = 61, Float_t sizdef = 1)
             virtual void SetTextAlign(Short_t align = 11)
             virtual void SetTextAngle(Float_t tangle = 0)
             virtual void SetTextAttributes()
             virtual void SetTextColor(Color_t tcolor = 1)
             virtual void SetTextFont(Font_t tfont = 62)
             virtual void SetTextSize(Float_t tsize = 1)
             virtual void SetTextSizePixels(Int_t npixels)
             virtual void ShowMembers(TMemberInspector& insp, char* parent)
             virtual void Streamer(TBuffer& b)
                     void StreamerNVirtual(TBuffer& b)

### Data Members

        protected:

          Float_t fTextAngle  Text angle
          Float_t fTextSize   Text size
          Short_t fTextAlign  Text alignment
          Color_t fTextColor  Text color index
           Font_t fTextFont   Text font number

## Class Description

    *-*-*-*-*-*-*-*-*-*-*-*-*Text Attributes class*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
    *-*                      =====================
    *-*  Text attributes are:
    *-*    Text Alignment
    *-*    Text Color
    *-*    Text Font
    *-*    Text Size
    *-*    Text Angle
    *-*
    *-*  This class is used (in general by secondary inheritance)
    *-*
    *-*  by many other classes (graphics, histograms).
    *-*    align : Text alignment = 10*HorizontalAlign + VerticalAlign
    *-*            For Horizontal alignment the following convention applies:
    *-*               1=left adjusted, 2=centered, 3=rigth 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
    *-*    angle : Text angle in degrees
    *-*    color : Text Color Index
    *-*    font  : Text font code = 10*fontnumber + precision
    *-*             Font numbers must be between 1 and 14
    *-*             precision = 0 fast hardware fonts (steps in the size)
    *-*             precision = 1 scalable and rotatable hardware fonts (see below)
    *-*             precision = 2 scalable and rotatable hardware fonts
    *-*             precision = 3 scalable and rotatable hardware fonts. Text size
    *-*                           is given in pixels.
    *-*    size  : Character size expressed in percentage of the current pad height
    *-*            The textsize in pixels (say charheight) will be:
    *-*             charheight = textsize*canvas_height if current pad is horizontal.
    *-*             charheight = textsize*canvas_width  if current pad is vertical.
    *-*             charheight = number of pixels if font precision is greater than 2
    *-*
    *-* Font quality and speed
    *-* ======================
    *-*  When precision 0 is used, only the original non-scaled system fonts
    *-*  are used. The fonts have a minimum (4)  and maximum (37) size in pixels.
    *-*  These fonts are fast and are of good quality. Their size varies with
    *-*  large steps and they cannot be rotated.
    *-*  Precision 1 and 2 fonts have a different behaviour depending if the
    *-*  True Type Fonts are used or not. If TTF are used, you always get
    *-*  very good quality scalable and rotatable fonts. However TTF are slow.
    *-*  Precision 1 and 2 fonts have a different behaviour for Postscript
    *-*  in case of TLatex objects. With precision 1, the Postscript text uses
    *-*  the old convention (see TPostScript) for some special characters
    *-*  to draw sub and superscripts or greek text.
    *-*  With precision 2 the "PostScript" special characters are drawn as such.
    *-*  To draw sub and superscripts it is highly recommended to use TLatex
    *-*  objects instead.
    *-*
    *-*  How to use True Type Fonts
    *-*  ==========================
    *-*  You can activate the TTF by adding (or activating) the following line
    *-*  in your .rootrc file.
    *-*  Unix.*.Root.UseTTFonts:     true
    *-*  WinNT  for NT
    *-*  You can check that you indeed use the TTF in your Root session.
    *-*  When the TTF is active, you get the following message at the start
    *-*  of a session:
    *-*    "FreeType Engine v1.x used to render TrueType fonts."
    *-*  You can also check with the command gEnv->Print().
    *-*
    *-*  List of the currently supported fonts (screen and PostScript)
    *-*  =============================================================
    *-*   Font ID       X11                       Win32 TTF       lfItalic  lfWeight  x 10
    *-*        1 : times-medium-i-normal      "Times New Roman"      1           4
    *-*        2 : times-bold-r-normal        "Times New Roman"      0           7
    *-*        3 : times-bold-i-normal        "Times New Roman"      1           7
    *-*        4 : helvetica-medium-r-normal  "Arial"                0           4
    *-*        5 : helvetica-medium-o-normal  "Arial"                1           4
    *-*        6 : helvetica-bold-r-normal    "Arial"                0           7
    *-*        7 : helvetica-bold-o-normal    "Arial"                1           7
    *-*        8 : courier-medium-r-normal    "Courier New"          0           4
    *-*        9 : courier-medium-o-normal    "Courier New"          1           4
    *-*       10 : courier-bold-r-normal      "Courier New"          0           7
    *-*       11 : courier-bold-o-normal      "Courier New"          1           7
    *-*       12 : symbol-medium-r-normal     "Symbol"               0           6
    *-*       13 : times-medium-r-normal      "Times New Roman"      0           4
    *-*       14 :                            "Wingdings"            0           4
    *-*
    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

TAttText()

    *-*-*-*-*-*-*-*-*-*-*-*-*AttText default constructor*-*-*-*-*-*-*-*-*-*-*-*
    *-*                      ===========================
    *-*  Default text attributes are taking from the current style
    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

TAttText(Int_t align, Float_t angle, Color_t color, Style_t font, Float_t tsize)

    *-*-*-*-*-*-*-*-*-*-*-*-*AttText normal constructor*-*-*-*-*-*-*-*-*-*-*-*
    *-*                      ===========================
    *-*  Text attributes are taking from the argument list
    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

~TAttText()

    *-*-*-*-*-*-*-*-*-*-*-*-*AttText destructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
    *-*                      =================

void Copy(TAttText &atttext) const

    *-*-*-*-*-*-*-*-*Copy this text attributes to a new atttext*-*-*-*-*-*-*-*-*
    *-*              ==========================================

void Modify()

    *-*-*-*-*-*-*-*-*-*Change current text attributes if necessary*-*-*-*-*-*-*
    *-*                ===========================================

void ResetAttText(Option_t *)

    *-*-*-*-*-*-*-*-*Reset this text attributes to default values*-*-*-*-*-*-*
    *-*              ============================================

void SaveTextAttributes(ofstream &out, const char *name, Int_t alidef, Float_t angdef, Int_t coldef, Int_t fondef, Float_t sizdef)

     Save text attributes as C++ statement(s) on output stream out

void SetTextAttributes()

    *-*-*-*-*-*-*-*-*Invoke the DialogCanvas Text attributes*-*-*-*-*-*-*
    *-*              =======================================

void SetTextSizePixels(Int_t npixels)

     Set the text size in pixels.
     If the font precision is greater than 2, the text size is set to npixels,
     otherwise the text size is computed as a per cent of the pad size.

### Inline Functions

                Short_t GetTextAlign() const
                Float_t GetTextAngle() const
                Color_t GetTextColor() const
                 Font_t GetTextFont() const
                Float_t GetTextSize() const
                   void SetTextAlign(Short_t align = 11)
                   void SetTextAngle(Float_t tangle = 0)
                   void SetTextColor(Color_t tcolor = 1)
                   void SetTextFont(Font_t tfont = 62)
                   void SetTextSize(Float_t tsize = 1)
                TClass* Class()
                TClass* IsA() const
                   void ShowMembers(TMemberInspector& insp, char* parent)
                   void Streamer(TBuffer& b)
                   void StreamerNVirtual(TBuffer& b)
               TAttText TAttText(const TAttText&)
              TAttText& operator=(const TAttText&)

Author: Rene Brun 12/12/94
Last update: root/base:$Name: $:$Id: TAttText.cxx,v 1.17 2004/09/13 16:39:12 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *