ROOT  6.06/08
Reference Guide
Classes | Public Member Functions | Static Public Member Functions | Protected Types | Static Protected Attributes | Friends | List of all members
TTF Class Reference

Interface to the freetype 2 library.

Definition at line 63 of file TTF.h.

Classes

class  TTGlyph
 TTF helper class containing glyphs description. More...
 

Public Member Functions

 TTF ()
 
virtual ~TTF ()
 Cleanup TTF environment. More...
 

Static Public Member Functions

static Short_t CharToUnicode (UInt_t code)
 Map char to unicode. Returns 0 in case no mapping exists. More...
 
static void LayoutGlyphs ()
 Compute the glyphs positions, fgAscent and fgWidth (needed for alignment). More...
 
static void PrepareString (const char *string)
 Put the characters in "string" in the "glyphs" array. More...
 
static void PrepareString (const wchar_t *string)
 Put the characters in "string" in the "glyphs" array. More...
 
static void SetRotationMatrix (Float_t angle)
 Set the rotation matrix used to rotate the font outlines. More...
 
static void Init ()
 Initialise the TrueType fonts interface. More...
 
static void Cleanup ()
 Cleanup. Is called by the gCleanupTTF destructor. More...
 
static Int_t GetAscent ()
 
static const FT_BBox & GetBox ()
 
static TTGlyphGetGlyphs ()
 
static Bool_t GetHinting ()
 
static Bool_t GetKerning ()
 
static Int_t GetNumGlyphs ()
 
static FT_Matrix * GetRotMatrix ()
 
static Bool_t GetSmoothing ()
 
static Int_t GetWidth ()
 
static void SetHinting (Bool_t state)
 Set hinting flag. More...
 
static void SetKerning (Bool_t state)
 Set kerning flag. More...
 
static void SetSmoothing (Bool_t state)
 Set smoothing (anti-aliasing) flag. More...
 
static void GetTextExtent (UInt_t &w, UInt_t &h, char *text)
 Get width (w) and height (h) when text is horizontal. More...
 
static void GetTextExtent (UInt_t &w, UInt_t &h, wchar_t *text)
 Get width (w) and height (h) when text is horizontal. More...
 
static void GetTextAdvance (UInt_t &a, char *text)
 Get advance (a) when text is horizontal. More...
 
static void SetTextFont (Font_t fontnumber)
 
static Int_t SetTextFont (const char *fontname, Int_t italic=0)
 Set text font to specified name. More...
 
static void SetTextSize (Float_t textsize)
 Set current text size. More...
 
static Bool_t IsInitialized ()
 
static void Version (Int_t &major, Int_t &minor, Int_t &patch)
 

Protected Types

enum  { kTTMaxFonts = 32, kMaxGlyphs = 1024 }
 

Static Protected Attributes

static Int_t fgAscent = 0
 
static FT_BBox fgCBox
 
static FT_CharMap fgCharMap [kTTMaxFonts]
 
static Int_t fgCurFontIdx = -1
 
static Int_t fgFontCount = 0
 
static Int_t fgFontID [kTTMaxFonts]
 
static FT_Face fgFace [kTTMaxFonts]
 
static TTF::TTGlyph fgGlyphs [kMaxGlyphs]
 
static Bool_t fgHinting = kFALSE
 
static Bool_t fgInit = kFALSE
 
static Bool_t fgKerning = kTRUE
 
static FT_Library fgLibrary
 
static Int_t fgNumGlyphs = 0
 
static FT_Matrix * fgRotMatrix
 
static Bool_t fgSmoothing = kTRUE
 
static Int_t fgTBlankW = 0
 
static Int_t fgWidth = 0
 

Friends

class TGX11TTF
 
class TGWin32
 
class TMathTextRenderer
 

#include <TTF.h>

+ Collaboration diagram for TTF:

Member Enumeration Documentation

§ anonymous enum

anonymous enum
protected
Enumerator
kTTMaxFonts 
kMaxGlyphs 

Definition at line 83 of file TTF.h.

Constructor & Destructor Documentation

§ TTF()

TTF::TTF ( )
inline

Definition at line 111 of file TTF.h.

§ ~TTF()

TTF::~TTF ( )
virtual

Cleanup TTF environment.

Definition at line 58 of file TTF.cxx.

Member Function Documentation

§ CharToUnicode()

Short_t TTF::CharToUnicode ( UInt_t  code)
static

Map char to unicode. Returns 0 in case no mapping exists.

Definition at line 104 of file TTF.cxx.

Referenced by PrepareString().

§ Cleanup()

void TTF::Cleanup ( )
static

Cleanup. Is called by the gCleanupTTF destructor.

Definition at line 88 of file TTF.cxx.

§ GetAscent()

Int_t TTF::GetAscent ( )
static

Definition at line 815 of file TTF.cxx.

Referenced by TGWin32::Align(), TGQuartz::AlignTTFString(), and TASImage::DrawText().

§ GetBox()

const FT_BBox & TTF::GetBox ( )
static

§ GetGlyphs()

TTF::TTGlyph * TTF::GetGlyphs ( )
static

§ GetHinting()

Bool_t TTF::GetHinting ( )
static

Definition at line 780 of file TTF.cxx.

§ GetKerning()

Bool_t TTF::GetKerning ( )
static

Definition at line 787 of file TTF.cxx.

Referenced by TText::GetTextAdvance().

§ GetNumGlyphs()

Int_t TTF::GetNumGlyphs ( )
static

§ GetRotMatrix()

FT_Matrix * TTF::GetRotMatrix ( )
static

Definition at line 829 of file TTF.cxx.

Referenced by TGWin32::Align(), TGQuartz::AlignTTFString(), and TASImage::DrawText().

§ GetSmoothing()

Bool_t TTF::GetSmoothing ( )
static

§ GetTextAdvance()

void TTF::GetTextAdvance ( UInt_t a,
char *  text 
)
static

Get advance (a) when text is horizontal.

Definition at line 160 of file TTF.cxx.

Referenced by TText::GetTextAdvance().

§ GetTextExtent() [1/2]

void TTF::GetTextExtent ( UInt_t w,
UInt_t h,
char *  text 
)
static

Get width (w) and height (h) when text is horizontal.

Definition at line 144 of file TTF.cxx.

Referenced by TText::GetBoundingBox(), TText::GetTextExtent(), TGWin32::GetTextExtent(), and TGWin32::RequestString().

§ GetTextExtent() [2/2]

void TTF::GetTextExtent ( UInt_t w,
UInt_t h,
wchar_t *  text 
)
static

Get width (w) and height (h) when text is horizontal.

Definition at line 173 of file TTF.cxx.

§ GetWidth()

Int_t TTF::GetWidth ( )
static

§ Init()

void TTF::Init ( )
static

§ IsInitialized()

Bool_t TTF::IsInitialized ( )
static

§ LayoutGlyphs()

void TTF::LayoutGlyphs ( )
static

Compute the glyphs positions, fgAscent and fgWidth (needed for alignment).

Perform the Glyphs transformation. Compute the string control box. If required take the "kerning" into account. SetRotation and PrepareString should have been called before.

Definition at line 193 of file TTF.cxx.

Referenced by TGQuartz::DrawText(), TGX11TTF::DrawText(), TASImage::DrawText(), TGWin32::DrawText(), TASImage::DrawTextTTF(), GetTextAdvance(), and GetTextExtent().

§ PrepareString() [1/2]

void TTF::PrepareString ( const char *  string)
static

Put the characters in "string" in the "glyphs" array.

Definition at line 259 of file TTF.cxx.

Referenced by TGQuartz::DrawText(), TGX11TTF::DrawText(), TASImage::DrawText(), TGWin32::DrawText(), TASImage::DrawTextTTF(), GetTextAdvance(), and GetTextExtent().

§ PrepareString() [2/2]

void TTF::PrepareString ( const wchar_t *  string)
static

Put the characters in "string" in the "glyphs" array.

Definition at line 297 of file TTF.cxx.

§ SetHinting()

void TTF::SetHinting ( Bool_t  state)
static

Set hinting flag.

Definition at line 335 of file TTF.cxx.

§ SetKerning()

void TTF::SetKerning ( Bool_t  state)
static

Set kerning flag.

Definition at line 343 of file TTF.cxx.

Referenced by TText::GetTextAdvance().

§ SetRotationMatrix()

void TTF::SetRotationMatrix ( Float_t  angle)
static

Set the rotation matrix used to rotate the font outlines.

Definition at line 351 of file TTF.cxx.

Referenced by TGQuartz::DrawText(), TGX11TTF::DrawText(), TASImage::DrawText(), TGWin32::DrawText(), TASImage::DrawTextTTF(), GetTextAdvance(), and GetTextExtent().

§ SetSmoothing()

void TTF::SetSmoothing ( Bool_t  state)
static

Set smoothing (anti-aliasing) flag.

Definition at line 374 of file TTF.cxx.

Referenced by TGQuartz::DrawText(), TGX11TTF::Init(), and TGWin32::OpenDisplay().

§ SetTextFont() [1/2]

void TTF::SetTextFont ( Font_t  fontnumber)
static

§ SetTextFont() [2/2]

Int_t TTF::SetTextFont ( const char *  fontname,
Int_t  italic = 0 
)
static

Set text font to specified name.

  • font : font name
  • italic : the fonts should be slanted. Used for symbol font.

Set text font to specified name. This function returns 0 if the specified font is found, 1 if not.

Definition at line 387 of file TTF.cxx.

§ SetTextSize()

void TTF::SetTextSize ( Float_t  textsize)
static

§ Version()

void TTF::Version ( Int_t major,
Int_t minor,
Int_t patch 
)
static

Definition at line 773 of file TTF.cxx.

Friends And Related Function Documentation

§ TGWin32

friend class TGWin32
friend

Definition at line 66 of file TTF.h.

§ TGX11TTF

friend class TGX11TTF
friend

Definition at line 65 of file TTF.h.

§ TMathTextRenderer

friend class TMathTextRenderer
friend

Definition at line 67 of file TTF.h.

Member Data Documentation

§ fgAscent

Int_t TTF::fgAscent = 0
staticprotected

Definition at line 85 of file TTF.h.

Referenced by TGX11TTF::Align(), GetAscent(), and LayoutGlyphs().

§ fgCBox

FT_BBox TTF::fgCBox
staticprotected

Definition at line 86 of file TTF.h.

Referenced by GetBox(), GetTextExtent(), and LayoutGlyphs().

§ fgCharMap

FT_CharMap TTF::fgCharMap
staticprotected

Definition at line 87 of file TTF.h.

Referenced by CharToUnicode(), and SetTextFont().

§ fgCurFontIdx

Int_t TTF::fgCurFontIdx = -1
staticprotected

Definition at line 88 of file TTF.h.

Referenced by CharToUnicode(), LayoutGlyphs(), PrepareString(), SetTextFont(), and SetTextSize().

§ fgFace

FT_Face TTF::fgFace
staticprotected

Definition at line 91 of file TTF.h.

Referenced by CharToUnicode(), Cleanup(), LayoutGlyphs(), PrepareString(), SetTextFont(), and SetTextSize().

§ fgFontCount

Int_t TTF::fgFontCount = 0
staticprotected

Definition at line 89 of file TTF.h.

Referenced by Cleanup(), SetTextFont(), and SetTextSize().

§ fgFontID

Int_t TTF::fgFontID
staticprotected

Definition at line 90 of file TTF.h.

Referenced by CharToUnicode(), and SetTextFont().

§ fgGlyphs

TTF::TTGlyph TTF::fgGlyphs
staticprotected

Definition at line 92 of file TTF.h.

Referenced by GetGlyphs(), LayoutGlyphs(), PrepareString(), and TGX11TTF::RenderString().

§ fgHinting

Bool_t TTF::fgHinting = kFALSE
staticprotected

Definition at line 93 of file TTF.h.

Referenced by GetHinting(), LayoutGlyphs(), PrepareString(), and SetHinting().

§ fgInit

Bool_t TTF::fgInit = kFALSE
staticprotected

§ fgKerning

Bool_t TTF::fgKerning = kTRUE
staticprotected

Definition at line 95 of file TTF.h.

Referenced by GetKerning(), LayoutGlyphs(), and SetKerning().

§ fgLibrary

FT_Library TTF::fgLibrary
staticprotected

Definition at line 96 of file TTF.h.

Referenced by Cleanup(), Init(), SetTextFont(), and Version().

§ fgNumGlyphs

Int_t TTF::fgNumGlyphs = 0
staticprotected

Definition at line 97 of file TTF.h.

Referenced by GetNumGlyphs(), LayoutGlyphs(), PrepareString(), and TGX11TTF::RenderString().

§ fgRotMatrix

FT_Matrix * TTF::fgRotMatrix
staticprotected

Definition at line 98 of file TTF.h.

Referenced by TGX11TTF::Align(), Cleanup(), GetRotMatrix(), LayoutGlyphs(), and SetRotationMatrix().

§ fgSmoothing

Bool_t TTF::fgSmoothing = kTRUE
staticprotected

Definition at line 99 of file TTF.h.

Referenced by TGX11TTF::DrawImage(), GetSmoothing(), TGX11TTF::RenderString(), and SetSmoothing().

§ fgTBlankW

Int_t TTF::fgTBlankW = 0
staticprotected

Definition at line 100 of file TTF.h.

Referenced by GetTextExtent(), and PrepareString().

§ fgWidth

Int_t TTF::fgWidth = 0
staticprotected

Definition at line 101 of file TTF.h.

Referenced by TGX11TTF::Align(), GetWidth(), and LayoutGlyphs().


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