118 struct LayoutChunk_t;
183 for (
Int_t i=0; i<256; i++) {
193 const char *
start,
int numChars,
194 int curX,
int newX,
int y)
const;
228 struct FontStateMap_t;
229 struct XLFDAttributes_t;
243 const char *
GetUid(
const char *
string);
246 int FindStateNum(
const FontStateMap_t *map,
const char *strKey);
void DrawCharsExp(Drawable_t dst, GContext_t gc, const char *source, Int_t numChars, Int_t x, Int_t y) const
Draw a string of characters on the screen.
Int_t CharBbox(Int_t index, Int_t *x, Int_t *y, Int_t *w, Int_t *h) const
Use the information in the TGTextLayout token to return the bounding box for the character specified ...
char ** GetFontFamilies()
Return information about the font families that are available on the current display.
void ToPostscript(TString *dst) const
Outputs the contents of a text layout in Postscript format.
FontAttributes_t & operator=(const FontAttributes_t &f)
void FreeFontFamilies(char **f)
Delete an array of families allocated GetFontFamilies() method.
virtual ~TGTextLayout()
destructor
void UnderlineChars(Drawable_t dst, GContext_t gc, const char *string, Int_t x, Int_t y, Int_t firstChar, Int_t lastChar) const
This procedure draws an underline for a given range of characters in a given string.
FontAttributes_t GetFontAttributes() const
void DrawChars(Drawable_t dst, GContext_t gc, const char *source, Int_t numChars, Int_t x, Int_t y) const
Perform a quick sanity check to ensure we won't overflow the X coordinate space.
TGTextLayout * ComputeTextLayout(const char *string, Int_t numChars, Int_t wrapLength, Int_t justify, Int_t flags, UInt_t *width, UInt_t *height) const
Computes the amount of screen space needed to display a multi-line, justified string of text...
Collectable string class.
void operator=(const TGFont &font)
const char * NameOfFont(TGFont *font)
Given a font, return a textual string identifying it.
TGFont * MakeFont(TGFont *font, FontStruct_t fontStruct, const char *fontName)
Helper for GetNativeFont() and GetFontFromAttributes().
Definitions for TRefCnt, base class for reference counted objects.
FontH_t GetFontHandle() const
void Print(Option_t *option="") const
List all fonts in the pool.
char ** GetAttributeInfo(const FontAttributes_t *fa)
Return information about the font attributes as an array of strings.
int FindStateNum(const FontStateMap_t *map, const char *strKey)
Given a lookup table, map a string to a number in the table.
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save the used font as a C++ statement(s) on output stream out.
void FreeAttributeInfo(char **info)
Free attributes info.
FontStruct_t operator()() const
Not inline due to a bug in g++ 2.96 20000731 (Red Hat Linux 7.0)
TGFont * GetFontFromAttributes(FontAttributes_t *fa, TGFont *fontPtr)
Given a desired set of attributes for a font, find a font with the closest matching attributes and cr...
TGFont * GetNativeFont(const char *name, Bool_t fixedDefault=kTRUE)
The return value is a pointer to an TGFont object that represents the native font.
THashTable implements a hash table to store TObject's.
#define ClassDef(name, id)
Int_t PostscriptFontName(TString *dst) const
Return the name of the corresponding Postscript font for this TGFont.
The TNamed class is the base class for all named ROOT classes.
Int_t DistanceToText(Int_t x, Int_t y) const
Computes the distance in pixels from the given point to the given text layout.
Bool_t FieldSpecified(const char *field)
Helper function for ParseXLFD().
void DrawText(Drawable_t dst, GContext_t gc, Int_t x, Int_t y, Int_t firstChar, Int_t lastChar) const
Use the information in the TGTextLayout object to display a multi-line, justified string of text...
virtual ~TGFont()
Delete font.
void UnderlineChar(Drawable_t dst, GContext_t gc, Int_t x, Int_t y, Int_t underline) const
Use the information in the TGTextLayout object to display an underline below an individual character...
void operator=(const TGTextLayout &tlayout)
Int_t XTextWidth(const char *string, Int_t numChars=-1) const
Return text widht in pixels.
Int_t PointToChar(Int_t x, Int_t y) const
Use the information in the TGTextLayout token to determine the character closest to the given point...
void SetRefCount(UInt_t r)
Double_t length(const TVector2 &v)
void FreeFont(const TGFont *font)
Free font. If ref count is 0 delete font.
TGFont * FindFontByHandle(FontH_t font) const
Find font based on its font handle. Returns 0 if font is not found.
LayoutChunk_t * NewChunk(TGTextLayout *layout, int *maxPtr, const char *start, int numChars, int curX, int newX, int y) const
Helper function for ComputeTextLayout().
virtual ~TGFontPool()
Cleanup font pool.
TGFontPool(const TGFontPool &fp)
Bool_t ParseFontName(const char *string, FontAttributes_t *fa)
Converts a string into a set of font attributes that can be used to construct a font.
Bool_t ParseXLFD(const char *string, XLFDAttributes_t *xa)
Break up a fully specified XLFD into a set of font attributes.
TGFont * GetFont(const char *font, Bool_t fixedDefault=kTRUE)
Get the specified font.
Int_t IntersectText(Int_t x, Int_t y, Int_t w, Int_t h) const
Determines whether a text layout lies entirely inside, entirely outside, or overlaps a given rectangl...
void GetFontMetrics(FontMetrics_t *m) const
Get font metrics.
TGFontPool & operator=(const TGFontPool &fp)
Int_t TextWidth(const char *string, Int_t numChars=-1) const
A wrapper function for the more complicated interface of MeasureChars.
Mother of all ROOT objects.
FontAttributes_t(const FontAttributes_t &f)
const char * FindStateString(const FontStateMap_t *map, int numKey)
Given a lookup table, map a number to a string in the table.
FontStruct_t GetFontStruct() const
TGFont * FindFont(FontStruct_t font) const
Find font based on its font struct. Returns 0 if font is not found.
Int_t MeasureChars(const char *source, Int_t numChars, Int_t maxLength, Int_t flags, Int_t *length) const
Determine the number of characters from the string that will fit in the given horizontal span...
const char * GetUid(const char *string)
Given a string, this procedure returns a unique identifier for the string.
void Print(Option_t *option="") const
Print font info.