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

ufo::UTextureFontRenderer Class Reference

A basic (multimedia library independent) implementation of texture fonts. More...

#include <utexturefont.hpp>

Inheritance diagram for ufo::UTextureFontRenderer:

ufo::UFontRenderer ufo::UVolatileData ufo::UObject ufo::UCollectable List of all members.

Public Member Functions

 UTextureFontRenderer (const UFontInfo &fontInfo)
bool isValid () const
int drawString (UGraphics *g, const char *text, unsigned int nChar, int xA=0, int yA=0)
void beginDrawing (UGraphics *g)
void endDrawing (UGraphics *g)
void refresh ()
const UFontMetricsgetFontMetrics () const
UFontInfo getFontInfo () const
std::string getSystemName () const

Static Public Member Functions

UPluginBasecreatePlugin ()
void destroyPlugin (UPluginBase *plugin)
UFontInfo queryFont (const UFontInfo &fontInfo)
std::vector< UFontInfolistFonts (const UFontInfo &fontInfo)
std::vector< UFontInfolistFonts ()

Detailed Description

A basic (multimedia library independent) implementation of texture fonts.

Author:
Johannes Schmidt


Constructor & Destructor Documentation

ufo::UTextureFontRenderer::UTextureFontRenderer const UFontInfo fontInfo  ) 
 

Parameters:
Specifies the font familiy (like Courier, Helvetica, ...)
pointSize The point size
weight The font weight, e.g. UFont::Bold, UFont::Normal, ...
style Further style attributes (UFont::Style


Member Function Documentation

void ufo::UTextureFontRenderer::beginDrawing UGraphics g  )  [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();
 

Implements ufo::UFontRenderer.

int ufo::UTextureFontRenderer::drawString UGraphics g,
const char *  text,
unsigned int  nChar,
int  xA = 0,
int  yA = 0
[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)

Implements ufo::UFontRenderer.

void ufo::UTextureFontRenderer::endDrawing UGraphics g  )  [virtual]
 

Ends the drawing block started with beginDrawing.

Implements ufo::UFontRenderer.

UFontInfo ufo::UTextureFontRenderer::getFontInfo  )  const [virtual]
 

Returns a font info object which describes several font attributes

Implements ufo::UFontRenderer.

const UFontMetrics* ufo::UTextureFontRenderer::getFontMetrics  )  const [virtual]
 

Returns the font metrics object for this font.

Implements ufo::UFontRenderer.

std::string ufo::UTextureFontRenderer::getSystemName  )  const [virtual]
 

The system dependent name of the used font.

Implements ufo::UFontRenderer.

bool ufo::UTextureFontRenderer::isValid  )  const
 

Returns true when this font renderer is ready to draw characters.

std::vector<UFontInfo> ufo::UTextureFontRenderer::listFonts  )  [static]
 

List all available fonts.

std::vector<UFontInfo> ufo::UTextureFontRenderer::listFonts const UFontInfo fontInfo  )  [static]
 

List all matching fonts.


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