Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXFont Class Reference

Font class. More...

#include <FXFont.h>

Inheritance diagram for FX::FXFont:

FX::FXId FX::FXObject List of all members.

Public Member Functions

 FXFont (FXApp *a, const FXString &string)
 FXFont (FXApp *a, const FXString &face, FXuint sz, FXuint wt=FONTWEIGHT_NORMAL, FXuint sl=FONTSLANT_REGULAR, FXuint enc=FONTENCODING_DEFAULT, FXuint setw=FONTSETWIDTH_DONTCARE, FXuint h=0)
 FXFont (FXApp *a, const FXFontDesc &fontdesc)
virtual void create ()
virtual void detach ()
virtual void destroy ()
FXString getName () const
FXString getActualName () const
FXuint getSize () const
FXuint getActualSize () const
FXuint getWeight () const
FXuint getActualWeight () const
FXuint getSlant () const
FXuint getActualSlant () const
FXuint getEncoding () const
FXuint getActualEncoding () const
FXuint getSetWidth () const
FXuint getActualSetWidth () const
FXuint getHints () const
void setFontDesc (const FXFontDesc &fontdesc)
void getFontDesc (FXFontDesc &fontdesc) const
FXbool setFont (const FXString &string)
FXString getFont () const
FXbool isFontMono () const
FXbool hasChar (FXint ch) const
FXint getMinChar () const
FXint getMaxChar () const
FXint leftBearing (FXchar ch) const
FXint rightBearing (FXchar ch) const
FXint getFontWidth () const
FXint getFontHeight () const
FXint getFontAscent () const
FXint getFontDescent () const
FXint getFontLeading () const
FXint getFontSpacing () const
FXint getTextWidth (const FXchar *text, FXuint n) const
FXint getTextWidth (const FXString &text) const
FXint getTextHeight (const FXchar *text, FXuint n) const
FXint getTextHeight (const FXString &text) const
virtual void save (FXStream &store) const
virtual void load (FXStream &store)
virtual ~FXFont ()

Static Public Member Functions

FXbool listFonts (FXFontDesc *&fonts, FXuint &numfonts, const FXString &face, FXuint wt=FONTWEIGHT_DONTCARE, FXuint sl=FONTSLANT_DONTCARE, FXuint sw=FONTSETWIDTH_DONTCARE, FXuint en=FONTENCODING_DEFAULT, FXuint h=0)

Detailed Description

Font class.

See also:


Constructor & Destructor Documentation

FX::FXFont::FXFont FXApp a,
const FXString string
 

Construct a font with given font description of the form:.

fontname [ "[" foundry "]" ] ["," size ["," weight ["," slant ["," setwidth ["," encoding ["," hints]]]]]]

For example:

"helvetica [bitstream],12,bold,i,normal,iso8859-1,0"

Typically, at least the font name, and size must be given for normal font matching. As a special case, raw X11 fonts can also be passed, for example:

"9x15bold"

Finally, an old FOX 1.0 style font string may be passed as well:

"[helvetica] 90 700 1 1 0 0"

FX::FXFont::FXFont FXApp a,
const FXString face,
FXuint  sz,
FXuint  wt = FONTWEIGHT_NORMAL,
FXuint  sl = FONTSLANT_REGULAR,
FXuint  enc = FONTENCODING_DEFAULT,
FXuint  setw = FONTSETWIDTH_DONTCARE,
FXuint  h = 0
 

Construct a font with given name, size in points, weight, slant, character set encoding, setwidth, and hints.

The font name may be comprised of a family name and optional foundry name enclosed in square brackets, for example, "helvetica [bitstream]".

FX::FXFont::FXFont FXApp a,
const FXFontDesc fontdesc
 

Construct font from font description.

virtual FX::FXFont::~FXFont  )  [virtual]
 

Destroy font.


Member Function Documentation

virtual void FX::FXFont::create  )  [virtual]
 

Create the font.

Reimplemented from FX::FXId.

virtual void FX::FXFont::detach  )  [virtual]
 

Detach the font.

Reimplemented from FX::FXId.

virtual void FX::FXFont::destroy  )  [virtual]
 

Destroy the font.

Reimplemented from FX::FXId.

FXString FX::FXFont::getName  )  const [inline]
 

Get font family name.

FXString FX::FXFont::getActualName  )  const [inline]
 

Get actual family name.

FXuint FX::FXFont::getSize  )  const [inline]
 

Get size in deci-points.

FXuint FX::FXFont::getActualSize  )  const [inline]
 

Get actual size in deci-points.

FXuint FX::FXFont::getWeight  )  const [inline]
 

Get font weight.

FXuint FX::FXFont::getActualWeight  )  const [inline]
 

Get actual font weight.

FXuint FX::FXFont::getSlant  )  const [inline]
 

Get slant.

FXuint FX::FXFont::getActualSlant  )  const [inline]
 

Get actual slant.

FXuint FX::FXFont::getEncoding  )  const [inline]
 

Get character set encoding.

FXuint FX::FXFont::getActualEncoding  )  const [inline]
 

Get actual encoding.

FXuint FX::FXFont::getSetWidth  )  const [inline]
 

Get setwidth.

FXuint FX::FXFont::getActualSetWidth  )  const [inline]
 

Get actual setwidth.

FXuint FX::FXFont::getHints  )  const [inline]
 

Get hints.

void FX::FXFont::setFontDesc const FXFontDesc fontdesc  ) 
 

Change font description.

void FX::FXFont::getFontDesc FXFontDesc fontdesc  )  const
 

Get font description.

FXbool FX::FXFont::setFont const FXString string  ) 
 

Change the font to the specified font description string.

FXString FX::FXFont::getFont  )  const
 

Return the font description as a string suitable for parsing with setFont(), see above.

FXbool FX::FXFont::isFontMono  )  const
 

Find out if the font is monotype or proportional.

FXbool FX::FXFont::hasChar FXint  ch  )  const
 

See if font has glyph for ch.

FXint FX::FXFont::getMinChar  )  const
 

Get first character glyph in font.

FXint FX::FXFont::getMaxChar  )  const
 

Get last character glyph in font.

FXint FX::FXFont::leftBearing FXchar  ch  )  const
 

Left bearing.

FXint FX::FXFont::rightBearing FXchar  ch  )  const
 

Right bearing.

FXint FX::FXFont::getFontWidth  )  const
 

Width of widest character in font.

FXint FX::FXFont::getFontHeight  )  const
 

Height of highest character in font.

FXint FX::FXFont::getFontAscent  )  const
 

Ascent from baseline.

FXint FX::FXFont::getFontDescent  )  const
 

Descent from baseline.

FXint FX::FXFont::getFontLeading  )  const
 

Get font leading [that is lead-ing as in Pb!].

FXint FX::FXFont::getFontSpacing  )  const
 

Get font line spacing.

FXint FX::FXFont::getTextWidth const FXchar *  text,
FXuint  n
const
 

Calculate width of given text in this font.

FXint FX::FXFont::getTextWidth const FXString text  )  const
 

Calculate width of given text in this font.

FXint FX::FXFont::getTextHeight const FXchar *  text,
FXuint  n
const
 

Calculate height of given text in this font.

FXint FX::FXFont::getTextHeight const FXString text  )  const
 

Calculate height of given text in this font.

FXbool FX::FXFont::listFonts FXFontDesc *&  fonts,
FXuint &  numfonts,
const FXString face,
FXuint  wt = FONTWEIGHT_DONTCARE,
FXuint  sl = FONTSLANT_DONTCARE,
FXuint  sw = FONTSETWIDTH_DONTCARE,
FXuint  en = FONTENCODING_DEFAULT,
FXuint  h = 0
[static]
 

List all fonts matching hints.

If listFonts() returns TRUE then fonts points to a newly-allocated array of length numfonts. It is the caller's responsibility to free this array using FXFREE().

virtual void FX::FXFont::save FXStream store  )  const [virtual]
 

Save font data into stream.

Reimplemented from FX::FXId.

virtual void FX::FXFont::load FXStream store  )  [virtual]
 

Load font data from stream.

Reimplemented from FX::FXId.

Copyright © 1997-2004 Jeroen van der Zijp