Crazy Eddies GUI System  0.6.0
Public Member Functions | List of all members
CEGUI::FontGlyph Class Reference

internal class representing a single font glyph. More...

Public Member Functions

 FontGlyph ()
 construct an empty uninitialized FontGlyph
 
 FontGlyph (float advance)
 FontGlyph constructor.
 
 FontGlyph (float advance, const Image *image)
 A better :-) FontGlyph constructor.
 
const ImagegetImage () const
 Return the CEGUI::Image object rendered for this glyph.
 
const ImagesetgetImageset () const
 Return the parent CEGUI::Imageset object for this glyph.
 
Size getSize (float x_scale, float y_scale) const
 Return the scaled pixel size of the glyph.
 
float getWidth (float x_scale) const
 Return the scaled widht of the glyph.
 
float getHeight (float y_scale) const
 Return the scaled height of the glyph.
 
float getRenderedAdvance (float x_scale) const
 Return the rendered advance value for this glyph. More...
 
float getAdvance (float x_scale=1.0) const
 Return the horizontal advance value for the glyph. More...
 
void setAdvance (float advance)
 Set the horizontal advance value for the glyph.
 
void setImage (const Image *image)
 Set the CEGUI::Image object rendered for this glyph.
 

Detailed Description

internal class representing a single font glyph.

For TrueType fonts initially all FontGlyph's are empty (getImage() will return NULL), but they are filled by demand.

Member Function Documentation

float CEGUI::FontGlyph::getAdvance ( float  x_scale = 1.0) const
inline

Return the horizontal advance value for the glyph.

The returned value is the number of pixels the pen should move horizontally to position itself ready to render the next glyph. This is not always the same as the glyph image width or rendererd advance, since it allows for horizontal overhangs.

Referenced by CEGUI::Font::drawTextLine(), CEGUI::Font::drawTextLineJustified(), CEGUI::Font::getCharAtPixel(), and CEGUI::Font::getTextExtent().

float CEGUI::FontGlyph::getRenderedAdvance ( float  x_scale) const
inline

Return the rendered advance value for this glyph.

The rendered advance value is the total number of pixels from the current pen position that will be occupied by this glyph when rendered.

References CEGUI::Image::getOffsetX(), and CEGUI::Image::getWidth().

Referenced by CEGUI::Font::getTextExtent().