CrystalSpace

Public API Reference

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

iFont Struct Reference
[2D]

A font object. More...

#include <fontserv.h>

Inheritance diagram for iFont:

iBase List of all members.

Public Methods

virtual void AddDeleteCallback (iFontDeleteNotify *func)=0
 Add a font delete notification callback routine. More...

virtual bool RemoveDeleteCallback (iFontDeleteNotify *func)=0
 Remove a font delete notification callback. More...

virtual void SetSize (int iSize)=0
 Set the size for this font in Point. More...

virtual int GetSize ()=0
 Query current font size in Point. More...

virtual void GetMaxSize (int &oW, int &oH)=0
 Return the maximum width and height of a single glyph, in pixels. More...

virtual bool GetGlyphSize (uint8 c, int &oW, int &oH)=0
 Return character size in pixels. More...

virtual bool GetGlyphSize (uint8 c, int &oW, int &oH, int &adv, int &left, int &top)=0
 Return character width, height, advance, x- and y-bearing in pixels. More...

virtual uint8GetGlyphBitmap (uint8 c, int &oW, int &oH)=0
 Return a pointer to a bitmap containing a rendered character. More...

virtual uint8GetGlyphBitmap (uint8 c, int &oW, int &oH, int &adv, int &left, int &top)=0
 Return a pointer to a bitmap containing a rendered character. More...

virtual uint8GetGlyphAlphaBitmap (uint8 c, int &oW, int &oH)=0
 Return a pointer to a bitmap containing the alpha bitmap for the rendered character. More...

virtual uint8GetGlyphAlphaBitmap (uint8 c, int &oW, int &oH, int &adv, int &left, int &top)=0
 Return a pointer to a bitmap containing the alpha bitmap for the rendered character. More...

virtual void GetDimensions (const char *text, int &oW, int &oH)=0
 Return the width and height of text written with this font. More...

virtual void GetDimensions (const char *text, int &oW, int &oH, int &desc)=0
 Return the width and height of text written with this font. More...

virtual int GetLength (const char *text, int maxwidth)=0
 Determine how many characters from this string can be written without exceeding given width (in pixels). More...

virtual int GetDescent ()=0
 Get the font's descent in pixels. More...

virtual int GetAscent ()=0
 Get the font's ascent in pixels. More...


Detailed Description

A font object.

Objects of this class are used by canvas driver to paint glyphs.

Definition at line 76 of file fontserv.h.


Member Function Documentation

virtual void iFont::AddDeleteCallback iFontDeleteNotify   func [pure virtual]
 

Add a font delete notification callback routine.

This routine will be called from font destructor, with the font instance being passed as argument. Another parameter is provided to supply additional data.

virtual int iFont::GetAscent   [pure virtual]
 

Get the font's ascent in pixels.

Returns a value <0 if an error occured. The sum of descent and ascent must not necessarily equal the maximum height.

virtual int iFont::GetDescent   [pure virtual]
 

Get the font's descent in pixels.

Returns a value <0 if an error occured. The sum of descent and ascent must not necessarily equal the maximum height.

virtual void iFont::GetDimensions const char *    text,
int &    oW,
int &    oH,
int &    desc
[pure virtual]
 

Return the width and height of text written with this font.

desc gives the maximum descender.

virtual void iFont::GetDimensions const char *    text,
int &    oW,
int &    oH
[pure virtual]
 

Return the width and height of text written with this font.

virtual uint8* iFont::GetGlyphAlphaBitmap uint8    c,
int &    oW,
int &    oH,
int &    adv,
int &    left,
int &    top
[pure virtual]
 

Return a pointer to a bitmap containing the alpha bitmap for the rendered character.

Returns NULL if error occured. The oW and oH parameters are filled with bitmap width and height. adv holds the advance in x-direction, left and top hold the x- and y-bearing.

virtual uint8* iFont::GetGlyphAlphaBitmap uint8    c,
int &    oW,
int &    oH
[pure virtual]
 

Return a pointer to a bitmap containing the alpha bitmap for the rendered character.

Returns NULL if error occured. The oW and oH parameters are filled with bitmap width and height.

virtual uint8* iFont::GetGlyphBitmap uint8    c,
int &    oW,
int &    oH,
int &    adv,
int &    left,
int &    top
[pure virtual]
 

Return a pointer to a bitmap containing a rendered character.

Returns NULL if error occured. The oW and oH parameters are filled with bitmap width and height. adv holds the advance in x-direction, left and top hold the x- and y-bearing.

virtual uint8* iFont::GetGlyphBitmap uint8    c,
int &    oW,
int &    oH
[pure virtual]
 

Return a pointer to a bitmap containing a rendered character.

Returns NULL if error occured. The oW and oH parameters are filled with bitmap width and height.

virtual bool iFont::GetGlyphSize uint8    c,
int &    oW,
int &    oH,
int &    adv,
int &    left,
int &    top
[pure virtual]
 

Return character width, height, advance, x- and y-bearing in pixels.

Returns false if values could not be determined.

virtual bool iFont::GetGlyphSize uint8    c,
int &    oW,
int &    oH
[pure virtual]
 

Return character size in pixels.

Returns false if values could not be determined.

virtual int iFont::GetLength const char *    text,
int    maxwidth
[pure virtual]
 

Determine how many characters from this string can be written without exceeding given width (in pixels).

virtual void iFont::GetMaxSize int &    oW,
int &    oH
[pure virtual]
 

Return the maximum width and height of a single glyph, in pixels.

Return -1 if it could not be determined.

virtual int iFont::GetSize   [pure virtual]
 

Query current font size in Point.

If server does not support rescalable fonts, this method returns 0.

virtual bool iFont::RemoveDeleteCallback iFontDeleteNotify   func [pure virtual]
 

Remove a font delete notification callback.

virtual void iFont::SetSize int    iSize [pure virtual]
 

Set the size for this font in Point.

All other methods will change their behaviour as soon as you call this method; but not all font managers supports rescalable fonts in which case this method will be unimplemented.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14