class XFont : public AFont

A class for X fonts.

Inheritance:


Public Methods

XFont (const string *foundry, int name, int style, int size, bool scalable)
Creates new X font with the specified name, style and point size.
~XFont ()
void Scale (double factor)
scale the X font (if scalable) with factor.
static int FindFamily (const char *desc)
Gets family name from X font description.
static int FindStyle (const char *desc)
Gets font style from X font description.
static int FindSize (const char *desc)
Gets point size from X font description.
int GetLeading ()
Gets the standard leading, or line spacing, for the font.
int GetAscent ()
Gets font ascent (distance from base line to top of characters).
int GetDescent ()
Gets font descent (distance from base line to bottom of characters).
int GetHeight ()
Gets total height of font (= is leading + ascent + descent)
int GetMaxAscent ()
Gets the maximum ascent of all characters in this Font.
int GetMaxDescent ()
Gets the maximum descent of all characters.
int GetMaxAdvance ()
Gets maximum advance width of any character (-1 if unknown).
int StringWidth (const string *str)
Returns width of specified String in Font.
int StringWidth (const char *str)
see above.
void Box (const string *s, int &wd, int &ht)
calculates height and width of multiline string in grafport.
void Box (const char *s, int &wd, int &ht)
see above.
long GetXFid ()
Return x font id of stored X font.
void GetXLFD (char *xd)
Get XLFD description.
void GetXLFD (string *xd)
Get XLFD description.
void GetPostScript (char *ps)
Get PostScript name of this Font.
XFontStruct* GetXFontStruct ()

Protected Methods

void CalcXLFD (string *fn, bool scalable)
Calculate X logical font description.
static bool IsScalableFont (const string *name)
static XFontStruct* LoadQueryScalableFont (Display *d, const char *name, int size)

Inherited from AFont:

Public Fields

static const int HELVETICA
static const int TIMESROMAN
static const int COURIER
static const int NEWCENTURYSCHLBK
static const int SYMBOL
static const int PLAIN
static const int BOLD
static const int ITALIC

Public Methods

int GetFamily()
int GetStyle()
int GetSize()
bool IsScalable()
const string* GetFoundry()
void SetScalable(bool b)
bool IsUnderlined()
void SetUnderlined(bool b)
double GetFactor()
void SetFactor(double d)
bool IsPlain()
bool IsBold()
bool IsItalic()

Documentation

A class for X fonts.
XFont(const string *foundry, int name, int style, int size, bool scalable)
Creates new X font with the specified name, style and point size.

~XFont()

void Scale(double factor)
scale the X font (if scalable) with factor.

static int FindFamily(const char *desc)
Gets family name from X font description.

static int FindStyle(const char *desc)
Gets font style from X font description.

static int FindSize(const char *desc)
Gets point size from X font description.

int GetLeading()
Gets the standard leading, or line spacing, for the font.

int GetAscent()
Gets font ascent (distance from base line to top of characters).

int GetDescent()
Gets font descent (distance from base line to bottom of characters).

int GetHeight()
Gets total height of font (= is leading + ascent + descent)

int GetMaxAscent()
Gets the maximum ascent of all characters in this Font.

int GetMaxDescent()
Gets the maximum descent of all characters.

int GetMaxAdvance()
Gets maximum advance width of any character (-1 if unknown).

int StringWidth(const string *str)
Returns width of specified String in Font.

int StringWidth(const char *str)
see above.

void Box(const string *s, int &wd, int &ht)
calculates height and width of multiline string in grafport.

void Box(const char *s, int &wd, int &ht)
see above.

long GetXFid()
Return x font id of stored X font.

void GetXLFD(char *xd)
Get XLFD description.

void GetXLFD(string *xd)
Get XLFD description.

void GetPostScript(char *ps)
Get PostScript name of this Font.

XFontStruct* GetXFontStruct()

void CalcXLFD(string *fn, bool scalable)
Calculate X logical font description.

static bool IsScalableFont(const string *name)

static XFontStruct* LoadQueryScalableFont(Display *d, const char *name, int size)


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de