ROOT » GRAF2D » GRAF » TTF

class TTF


TTF

Interface to the freetype 2 library.


Function Members (Methods)

public:
virtual~TTF()
static Short_tCharToUnicode(UInt_t code)
static TClass*Class()
static voidCleanup()
static Int_tGetAscent()
static const FT_BBox&GetBox()
static TTGlyph*GetGlyphs()
static Bool_tGetHinting()
static Bool_tGetKerning()
static Int_tGetNumGlyphs()
static FT_Matrix*GetRotMatrix()
static Bool_tGetSmoothing()
static voidGetTextAdvance(UInt_t& a, char* text)
static voidGetTextExtent(UInt_t& w, UInt_t& h, char* text)
static voidGetTextExtent(UInt_t& w, UInt_t& h, wchar_t* text)
static Int_tGetWidth()
static voidInit()
virtual TClass*IsA() const
static Bool_tIsInitialized()
static voidLayoutGlyphs()
TTF&operator=(const TTF&)
static voidPrepareString(const char* string)
static voidPrepareString(const wchar_t* string)
static voidSetHinting(Bool_t state)
static voidSetKerning(Bool_t state)
static voidSetRotationMatrix(Float_t angle)
static voidSetSmoothing(Bool_t state)
static voidSetTextFont(Font_t fontnumber)
static Int_tSetTextFont(const char* fontname, Int_t italic = 0)
static voidSetTextSize(Float_t textsize)
virtual voidShowMembers(TMemberInspector& insp) const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
TTF()
TTF(const TTF&)
static voidVersion(Int_t& major, Int_t& minor, Int_t& patch)

Data Members

protected:
static Int_tfgAscentstring ascent, used to compute Y alignment
static FT_BBoxfgCBoxstring control box
static FT_CharMapfgCharMap[32]font character map
static Int_tfgCurFontIdxcurrent font index
static FT_FacefgFace[32]font face
static Int_tfgFontCountnumber of fonts loaded
static char*fgFontName[32]font name
static TTGlyphfgGlyphs[1024]glyphs
static Bool_tfgHintinguse hinting (true by default)
static Bool_tfgInittrue if the Init has been called
static Bool_tfgKerninguse kerning (true by default)
static FT_LibraryfgLibraryFreeType font library
static Int_tfgNumGlyphsnumber of glyphs in the string
static FT_Matrix*fgRotMatrixrotation matrix
static Bool_tfgSmoothinguse anti-aliasing (true when >8 planes, false otherwise)
static Int_tfgSymbItaFontIdxSymbol italic font index
static Int_tfgTBlankWtrailing blanks width
static Int_tfgWidthstring width, used to compute X alignment
static TTF::(anonymous)kMaxGlyphs
static TTF::(anonymous)kTTMaxFonts

Class Charts

Inheritance Chart:
TTF

Function documentation

~TTF()
 Cleanup TTF environment.
void Init()
 Initialise the TrueType fonts interface.
void Cleanup()
 Cleanup. Is called by the gCleanupTTF destructor.
Short_t CharToUnicode(UInt_t code)
 Map char to unicode. Returns 0 in case no mapping exists.
void GetTextExtent(UInt_t& w, UInt_t& h, char* text)
 Get width (w) and height (h) when text is horizontal.
void GetTextAdvance(UInt_t& a, char* text)
 Get advance (a) when text is horizontal.
void GetTextExtent(UInt_t& w, UInt_t& h, wchar_t* text)
 Get width (w) and height (h) when text is horizontal.
void LayoutGlyphs()
 Compute the glyps 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.
void PrepareString(const char* string)
 Put the characters in "string" in the "glyphs" array.
void PrepareString(const wchar_t* string)
 Put the characters in "string" in the "glyphs" array.
void SetHinting(Bool_t state)
 Set hinting flag.
void SetKerning(Bool_t state)
 Set kerning flag.
void SetRotationMatrix(Float_t angle)
 Set the rotation matrix used to rotate the font outlines.
void SetSmoothing(Bool_t state)
 Set smoothing (anti-aliasing) flag.
Int_t SetTextFont(const char* fontname, Int_t italic = 0)
 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.
void SetTextFont(Font_t fontnumber)
 Set specified font.
 List of the currently supported fonts (screen and PostScript)

   Font ID       X11                        TTF
        1 : times-medium-i-normal       timesi.ttf
        2 : times-bold-r-normal         timesbd.ttf
        3 : times-bold-i-normal         timesi.ttf
        4 : helvetica-medium-r-normal   arial.ttf
        5 : helvetica-medium-o-normal   ariali.ttf
        6 : helvetica-bold-r-normal     arialbd.ttf
        7 : helvetica-bold-o-normal     arialbi.ttf
        8 : courier-medium-r-normal     cour.ttf
        9 : courier-medium-o-normal     couri.ttf
       10 : courier-bold-r-normal       courbd.ttf
       11 : courier-bold-o-normal       courbi.ttf
       12 : symbol-medium-r-normal      symbol.ttf
       13 : times-medium-r-normal       times.ttf
       14 :                             wingding.ttf
       15 : symbol oblique is emulated from symbol.ttf
void SetTextSize(Float_t textsize)
 Set current text size.
void Version(Int_t& major, Int_t& minor, Int_t& patch)
Bool_t GetHinting()
Bool_t GetKerning()
Bool_t GetSmoothing()
Bool_t IsInitialized()
Int_t GetWidth()
Int_t GetAscent()
Int_t GetNumGlyphs()
FT_Matrix * GetRotMatrix()
const FT_BBox & GetBox()
TTGlyph * GetGlyphs()
TTF()
{ }