Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGLFont Class Reference

A wrapper class for FTFont.

Holds pointer to FTFont object and its description: face size, font file and class ID. It wraps Render and BBox functions.

Definition at line 23 of file TGLFontManager.h.

Public Types

enum  EMode {
  kUndef = -1 , kBitmap , kPixmap , kTexture ,
  kOutline , kPolygon , kExtrude
}
 
enum  ETextAlignH_e { kLeft , kRight , kCenterH }
 
enum  ETextAlignV_e { kBottom , kTop , kCenterV }
 

Public Member Functions

 TGLFont ()
 Constructor.
 
 TGLFont (const TGLFont &o)
 Assignment operator.
 
 TGLFont (Int_t size, Int_t font, EMode mode, FTFont *f=nullptr, TGLFontManager *mng=nullptr)
 Constructor.
 
virtual ~TGLFont ()
 Destructor.
 
void BBox (const char *txt, Float_t &llx, Float_t &lly, Float_t &llz, Float_t &urx, Float_t &ury, Float_t &urz) const
 Get bounding box.
 
void BBox (const wchar_t *txt, Float_t &llx, Float_t &lly, Float_t &llz, Float_t &urx, Float_t &ury, Float_t &urz) const
 Get bounding box.
 
 ClassDef (TGLFont, 0)
 
void CopyAttributes (const TGLFont &o)
 Assignment operator.
 
Float_t GetAscent () const
 Get font's ascent.
 
Float_t GetDepth () const
 
Float_t GetDescent () const
 Get font's descent. The returned value is positive.
 
Int_t GetFile () const
 
const FTFont * GetFont () const
 
Float_t GetLineHeight () const
 Get font's line-height.
 
const TGLFontManagerGetManager () const
 
EMode GetMode () const
 
Int_t GetSize () const
 
Int_t GetTrashCount () const
 
Int_t IncTrashCount () const
 
void MeasureBaseLineParams (Float_t &ascent, Float_t &descent, Float_t &line_height, const char *txt="Xj") const
 Measure font's base-line parameters from the passed text.
 
Bool_t operator< (const TGLFont &o) const
 
virtual void PostRender () const
 Reset GL state after FTFont rendering.
 
virtual void PreRender (Bool_t autoLight=kTRUE, Bool_t lightOn=kFALSE) const
 Set-up GL state before FTFont rendering.
 
void Render (const char *txt, Double_t x, Double_t y, Double_t angle, Double_t mgn) const
 
void Render (const TString &txt) const
 Render text.
 
void Render (const TString &txt, Float_t x, Float_t y, Float_t z, ETextAlignH_e alignH, ETextAlignV_e alignV) const
 Render text with given alignmentrepl and at given position.
 
void Render (const wchar_t *txt, Double_t x, Double_t y, Double_t angle, Double_t mgn) const
 
void SetDepth (Float_t d)
 
void SetFont (FTFont *f)
 
void SetManager (TGLFontManager *mng)
 
void SetTrashCount (Int_t c) const
 

Protected Attributes

Int_t fFile
 
EMode fMode
 
Int_t fSize
 
Int_t fTrashCount
 

Private Member Functions

TGLFontoperator= (const TGLFont &o)
 
template<class Char >
void RenderHelper (const Char *txt, Double_t x, Double_t y, Double_t angle, Double_t) const
 mgn is simply ignored, because ROOT's TVirtualX TGX11 are complete mess with painting attributes.
 

Private Attributes

Float_t fDepth
 
FTFont * fFont
 
TGLFontManagerfManager
 

#include <TGLFontManager.h>

Member Enumeration Documentation

◆ EMode

Enumerator
kUndef 
kBitmap 
kPixmap 
kTexture 
kOutline 
kPolygon 
kExtrude 

Definition at line 26 of file TGLFontManager.h.

◆ ETextAlignH_e

Enumerator
kLeft 
kRight 
kCenterH 

Definition at line 33 of file TGLFontManager.h.

◆ ETextAlignV_e

Enumerator
kBottom 
kTop 
kCenterV 

Definition at line 34 of file TGLFontManager.h.

Constructor & Destructor Documentation

◆ TGLFont() [1/3]

TGLFont::TGLFont ( )

Constructor.

Definition at line 52 of file TGLFontManager.cxx.

◆ TGLFont() [2/3]

TGLFont::TGLFont ( Int_t  size,
Int_t  font,
EMode  mode,
FTFont *  f = nullptr,
TGLFontManager mng = nullptr 
)

Constructor.

Definition at line 62 of file TGLFontManager.cxx.

◆ TGLFont() [3/3]

TGLFont::TGLFont ( const TGLFont o)

Assignment operator.

Definition at line 72 of file TGLFontManager.cxx.

◆ ~TGLFont()

TGLFont::~TGLFont ( )
virtual

Destructor.

Definition at line 87 of file TGLFontManager.cxx.

Member Function Documentation

◆ BBox() [1/2]

void TGLFont::BBox ( const char *  txt,
Float_t llx,
Float_t lly,
Float_t llz,
Float_t urx,
Float_t ury,
Float_t urz 
) const

Get bounding box.

Definition at line 154 of file TGLFontManager.cxx.

◆ BBox() [2/2]

void TGLFont::BBox ( const wchar_t *  txt,
Float_t llx,
Float_t lly,
Float_t llz,
Float_t urx,
Float_t ury,
Float_t urz 
) const

Get bounding box.

Definition at line 165 of file TGLFontManager.cxx.

◆ ClassDef()

TGLFont::ClassDef ( TGLFont  ,
 
)

◆ CopyAttributes()

void TGLFont::CopyAttributes ( const TGLFont o)

Assignment operator.

Definition at line 95 of file TGLFontManager.cxx.

◆ GetAscent()

Float_t TGLFont::GetAscent ( ) const

Get font's ascent.

Definition at line 115 of file TGLFontManager.cxx.

◆ GetDepth()

Float_t TGLFont::GetDepth ( ) const
inline

Definition at line 74 of file TGLFontManager.h.

◆ GetDescent()

Float_t TGLFont::GetDescent ( ) const

Get font's descent. The returned value is positive.

Definition at line 123 of file TGLFontManager.cxx.

◆ GetFile()

Int_t TGLFont::GetFile ( ) const
inline

Definition at line 62 of file TGLFontManager.h.

◆ GetFont()

const FTFont * TGLFont::GetFont ( ) const
inline

Definition at line 70 of file TGLFontManager.h.

◆ GetLineHeight()

Float_t TGLFont::GetLineHeight ( ) const

Get font's line-height.

Definition at line 131 of file TGLFontManager.cxx.

◆ GetManager()

const TGLFontManager * TGLFont::GetManager ( ) const
inline

Definition at line 72 of file TGLFontManager.h.

◆ GetMode()

EMode TGLFont::GetMode ( ) const
inline

Definition at line 63 of file TGLFontManager.h.

◆ GetSize()

Int_t TGLFont::GetSize ( ) const
inline

Definition at line 61 of file TGLFontManager.h.

◆ GetTrashCount()

Int_t TGLFont::GetTrashCount ( ) const
inline

Definition at line 65 of file TGLFontManager.h.

◆ IncTrashCount()

Int_t TGLFont::IncTrashCount ( ) const
inline

Definition at line 67 of file TGLFontManager.h.

◆ MeasureBaseLineParams()

void TGLFont::MeasureBaseLineParams ( Float_t ascent,
Float_t descent,
Float_t line_height,
const char *  txt = "Xj" 
) const

Measure font's base-line parameters from the passed text.

Note that the measured parameters are not the same as the ones returned by get-functions - those were set by the font designer.

Definition at line 141 of file TGLFontManager.cxx.

◆ operator<()

Bool_t TGLFont::operator< ( const TGLFont o) const
inline

Definition at line 100 of file TGLFontManager.h.

◆ operator=()

TGLFont & TGLFont::operator= ( const TGLFont o)
private

◆ PostRender()

void TGLFont::PostRender ( ) const
virtual

Reset GL state after FTFont rendering.

Definition at line 406 of file TGLFontManager.cxx.

◆ PreRender()

void TGLFont::PreRender ( Bool_t  autoLight = kTRUE,
Bool_t  lightOn = kFALSE 
) const
virtual

Set-up GL state before FTFont rendering.

Definition at line 365 of file TGLFontManager.cxx.

◆ Render() [1/4]

void TGLFont::Render ( const char *  txt,
Double_t  x,
Double_t  y,
Double_t  angle,
Double_t  mgn 
) const

Definition at line 283 of file TGLFontManager.cxx.

◆ Render() [2/4]

void TGLFont::Render ( const TString txt) const

Render text.

Definition at line 291 of file TGLFontManager.cxx.

◆ Render() [3/4]

void TGLFont::Render ( const TString txt,
Float_t  x,
Float_t  y,
Float_t  z,
ETextAlignH_e  alignH,
ETextAlignV_e  alignV 
) const

Render text with given alignmentrepl and at given position.

Definition at line 313 of file TGLFontManager.cxx.

◆ Render() [4/4]

void TGLFont::Render ( const wchar_t *  txt,
Double_t  x,
Double_t  y,
Double_t  angle,
Double_t  mgn 
) const

Definition at line 276 of file TGLFontManager.cxx.

◆ RenderHelper()

template<class Char >
void TGLFont::RenderHelper ( const Char *  txt,
Double_t  x,
Double_t  y,
Double_t  angle,
Double_t   
) const
private

mgn is simply ignored, because ROOT's TVirtualX TGX11 are complete mess with painting attributes.

Definition at line 178 of file TGLFontManager.cxx.

◆ SetDepth()

void TGLFont::SetDepth ( Float_t  d)
inline

Definition at line 75 of file TGLFontManager.h.

◆ SetFont()

void TGLFont::SetFont ( FTFont *  f)
inline

Definition at line 69 of file TGLFontManager.h.

◆ SetManager()

void TGLFont::SetManager ( TGLFontManager mng)
inline

Definition at line 71 of file TGLFontManager.h.

◆ SetTrashCount()

void TGLFont::SetTrashCount ( Int_t  c) const
inline

Definition at line 66 of file TGLFontManager.h.

Member Data Documentation

◆ fDepth

Float_t TGLFont::fDepth
private

Definition at line 42 of file TGLFontManager.h.

◆ fFile

Int_t TGLFont::fFile
protected

Definition at line 49 of file TGLFontManager.h.

◆ fFont

FTFont* TGLFont::fFont
private

Definition at line 39 of file TGLFontManager.h.

◆ fManager

TGLFontManager* TGLFont::fManager
private

Definition at line 40 of file TGLFontManager.h.

◆ fMode

EMode TGLFont::fMode
protected

Definition at line 50 of file TGLFontManager.h.

◆ fSize

Int_t TGLFont::fSize
protected

Definition at line 48 of file TGLFontManager.h.

◆ fTrashCount

Int_t TGLFont::fTrashCount
mutableprotected

Definition at line 52 of file TGLFontManager.h.

Libraries for TGLFont:

The documentation for this class was generated from the following files: