ROOT logo
ROOT » GRAF2D » GRAF » TTF

class TTF


TTF

Interface to the freetype 2 library.


Function Members (Methods)

public:
TTF()
TTF(const TTF&)
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 voidGetTextExtent(UInt_t& w, UInt_t& h, char* 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 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)
static voidSetTextSize(Float_t textsize)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
static voidVersion(Int_t& major, Int_t& minor, Int_t& patch)

Data Members

private:
enum { kTTMaxFonts
kMaxGlyphs
};
private:
static Int_tfgAscentstring ascent, used to compute Y alignment
static FT_BBoxfgCBoxstring control box
static void*fgCharMap[32]font character map
static Int_tfgCurFontIdxcurrent font index
static void*fgFace[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 void*fgLibraryFreeType 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_tfgTBlankWtrailing blanks width
static Int_tfgWidthstring width, used to compute X alignment

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

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 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 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)
 Set text font to specified name.
 font       : font name

 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
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()
{ }