27 struct FT_LibraryRec_;
29 struct FT_CharMapRec_;
33 struct FT_BitmapGlyphRec_;
34 typedef struct FT_LibraryRec_* FT_Library;
35 typedef struct FT_FaceRec_* FT_Face;
36 typedef struct FT_CharMapRec_* FT_CharMap;
37 typedef struct FT_GlyphRec_* FT_Glyph;
38 typedef struct FT_Matrix_ FT_Matrix;
39 typedef struct FT_Bitmap_ FT_Bitmap;
40 typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph;
41 typedef signed long FT_Pos;
43 struct FT_Vector_ { FT_Pos
x,
y; };
44 struct FT_BBox_ { FT_Pos xMin, yMin, xMax, yMax; };
46 typedef struct FT_Vector_ FT_Vector;
47 typedef struct FT_BBox_ FT_BBox;
92 static const FT_BBox &
GetBox();
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
short Font_t
Font number (short).
short Short_t
Signed Short integer 2 bytes (short).
float Float_t
Float 4 bytes (float).
#define ClassDef(name, id)
TTF helper class containing glyphs description.
FT_Vector fPos
position of glyph origin
FT_Glyph fImage
glyph image
UInt_t fIndex
glyph index in face
static void SetKerning(Bool_t state)
Set kerning flag.
static Bool_t IsInitialized()
static void PrepareString(const char *string)
Put the characters in "string" in the "glyphs" array.
static void GetTextExtent(UInt_t &w, UInt_t &h, const char *text)
Get width (w) and height (h) when text is horizontal.
static Bool_t GetKerning()
static void Version(Int_t &major, Int_t &minor, Int_t &patch)
static Int_t GetTrailingBlanksWidth()
static void SetHinting(Bool_t state)
Set hinting flag.
static void Init()
Init TTF environment.
static void LayoutGlyphs()
Compute the glyphs positions, fgAscent and fgWidth (needed for alignment).
static void SetSmoothing(Bool_t state)
Set smoothing (anti-aliasing) flag.
static void SetRotationMatrix(Float_t angle)
Set the rotation matrix used to rotate the font outlines.
static void CleanupGlyphs()
Remove temporary data created by LayoutGlyphs.
static void SetTextFont(Font_t fontnumber)
Set specified font.
static Short_t CharToUnicode(UInt_t code)
Map char to unicode. Returns 0 in case no mapping exists.
static TTGlyph * GetGlyphs()
static Int_t GetNumGlyphs()
static void ComputeTrailingBlanksWidth(Int_t n)
Compute the trailing blanks width.
virtual ~TTF()
Cleanup TTF environment.
static const FT_BBox & GetBox()
static void GetTextAdvance(UInt_t &a, const char *text)
Get advance (a) when text is horizontal.
static Bool_t GetHinting()
static Bool_t GetSmoothing()
static void SetTextSize(Float_t textsize)
static FT_Matrix * GetRotMatrix()
Dynamic handle to work with freetype 2 library.
void GetTextExtent(UInt_t &w, UInt_t &h, const char *text)
Get width (w) and height (h) when text is horizontal.
Bool_t fKerning
use kerning (true by default)
std::unique_ptr< FT_Matrix > fRotMatrix
rotation matrix
std::vector< TTF::TTGlyph > fGlyphs
glyphs
Int_t fAscent
string ascent, used to compute Y alignment
Int_t SelectFontHandle(Int_t arg, const char *name=nullptr)
Return thread_local instance of TTFontHandle for speified font.
Bool_t SetTextSize(Float_t textsize)
Set current text size.
void SetRotationMatrix(Float_t angle)
Set the rotation matrix used to rotate the font outlines.
const FT_BBox & GetBox() const
void PrepareString(const char *string)
Put the characters in "string" in the "glyphs" array.
UInt_t CharToUnicode(UInt_t code)
Map char to unicode. Returns 0 in case no mapping exists.
FT_BitmapGlyph GetGlyphBitmap(UInt_t n, Bool_t smooth=kFALSE)
Return bitmap for specified glyph.
UInt_t GetNumGlyphs() const
static void SetHinting(Bool_t state)
FT_BBox fCBox
string control box
void SetTextFont(Font_t fontnumber)
Set specified font.
Int_t fTBlankW
trailing blanks width
TTF::TTGlyph * GetGlyphs()
Int_t GetTrailingBlanksWidth() const
void SetKerning(Bool_t state)
TTFontHandle * fFont
selected font
static Bool_t fgHinting
use hinting (false by default)
void Version(Int_t &major, Int_t &minor, Int_t &patch)
FT_Face GetFontFace() const
Return current font index.
void CleanupGlyphs()
Remove temporary data created by LayoutGlyphs.
void LayoutGlyphs()
Compute the glyphs positions, fgAscent and fgWidth (needed for alignment).
Bool_t GetKerning() const
static Bool_t GetSmoothing()
FT_Matrix * GetRotMatrix() const
void ComputeTrailingBlanksWidth(Int_t n)
Compute the trailing blanks width.
void GetTextAdvance(UInt_t &a, const char *text)
Get advance (a) when text is horizontal.
static Bool_t fgSmoothing
use anti-aliasing (true when >8 planes, false otherwise)
static FT_Library InitClose(Int_t direction=0)
Initialize or close FreeType library If argument is 0 - just return current handle Library initialize...
Int_t fWidth
string width, used to compute X alignment
static Bool_t GetHinting()
static void SetSmoothing(Bool_t state)