- Your Widget Set For OpenGL
Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | Related Pages

ufo::UFontRenderer Class Reference

This class is responsible for low level rendering of fonts. More...

#include <ufontrenderer.hpp>

Inheritance diagram for ufo::UFontRenderer:

ufo::UVolatileData ufo::UObject ufo::UCollectable ufo::UGL_BuiltinFontRenderer ufo::UGL_TextureFontRenderer ufo::UTextureFontRenderer List of all members.

Public Member Functions

virtual int drawString (UGraphics *g, const char *text, unsigned int nChar, int xA=0, int yA=0)=0
virtual void beginDrawing (UGraphics *g)=0
virtual void endDrawing (UGraphics *g)=0
virtual const UFontMetricsgetFontMetrics () const =0
virtual UFontInfo getFontInfo () const =0
virtual std::string getSystemName () const =0

Detailed Description

This class is responsible for low level rendering of fonts.

Usually this class is not used directly. Use instead the graphics object.

Author:
Johannes Schmidt


Member Function Documentation

virtual void ufo::UFontRenderer::beginDrawing UGraphics g  )  [pure virtual]
 

If you have to draw several strings after each other, you can optimize the drawing with using beginDrawing before and endDrawing at the end. You should not call any other method which changes the drawing state within one enclosing block. Example:

     beginDrawing();
     drawString(line1, strlen(line1), 0, 0);
     drawString(line1, strlen(line1), lineHeight, 0);
     endDrawing();
 

Implemented in ufo::UTextureFontRenderer, ufo::UGL_BuiltinFontRenderer, and ufo::UGL_TextureFontRenderer.

virtual int ufo::UFontRenderer::drawString UGraphics g,
const char *  text,
unsigned int  nChar,
int  xA = 0,
int  yA = 0
[pure virtual]
 

Draws the string at the given position

Parameters:
text The character array which should be drawn
nChar The length of the character array
xA The x offset on the screen
yA The y offset on the screen
Returns:
The advance in x direction (must be the same value like the width returned getStringSize)

Implemented in ufo::UTextureFontRenderer, ufo::UGL_BuiltinFontRenderer, and ufo::UGL_TextureFontRenderer.

virtual void ufo::UFontRenderer::endDrawing UGraphics g  )  [pure virtual]
 

Ends the drawing block started with beginDrawing.

Implemented in ufo::UTextureFontRenderer, ufo::UGL_BuiltinFontRenderer, and ufo::UGL_TextureFontRenderer.

virtual UFontInfo ufo::UFontRenderer::getFontInfo  )  const [pure virtual]
 

Returns a font info object which describes several font attributes

Implemented in ufo::UTextureFontRenderer, ufo::UGL_BuiltinFontRenderer, and ufo::UGL_TextureFontRenderer.

virtual const UFontMetrics* ufo::UFontRenderer::getFontMetrics  )  const [pure virtual]
 

Returns the font metrics object for this font.

Implemented in ufo::UTextureFontRenderer, ufo::UGL_BuiltinFontRenderer, and ufo::UGL_TextureFontRenderer.

virtual std::string ufo::UFontRenderer::getSystemName  )  const [pure virtual]
 

The system dependent name of the used font.

Implemented in ufo::UTextureFontRenderer, ufo::UGL_BuiltinFontRenderer, and ufo::UGL_TextureFontRenderer.


The documentation for this class was generated from the following file:
The libUFO Project - written by Johannes Schmidt