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

ufo::UFontMetrics Class Reference

Describes metrics of a font. More...

#include <ufontmetrics.hpp>

Inheritance diagram for ufo::UFontMetrics:

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

Public Member Functions

virtual UFontRenderergetFontRenderer () const =0
virtual int getAscent () const =0
virtual int getDescent () const =0
virtual int getLineskip () const =0
virtual int getHeight () const =0
virtual int getMaxAscent () const =0
virtual int getMaxDescent () const =0
virtual int getMaxCharWidth () const =0
virtual int getUnderlinePosition () const =0
virtual int getUnderlineThickness () const =0
virtual int getStringWidth (const std::string &text) const
virtual int getStringWidth (const char *text, unsigned int nChar) const =0
virtual int getCharWidth (const wchar_t chA) const =0
virtual unsigned int viewToModel (const std::string &text, unsigned int w) const
virtual unsigned int viewToModel (const char *text, unsigned int nChar, unsigned int w) const =0

Detailed Description

Describes metrics of a font.

This class describes the metrices of single characters as well as character strings.

Author:
Johannes Schmidt


Member Function Documentation

virtual int ufo::UFontMetrics::getAscent  )  const [pure virtual]
 

returns the space between the base line and the top of the highest character

virtual int ufo::UFontMetrics::getCharWidth const wchar_t  chA  )  const [pure virtual]
 

Returns the width of the given character.

virtual int ufo::UFontMetrics::getDescent  )  const [pure virtual]
 

returns the space between the base line and the bottom of the highest character

virtual int ufo::UFontMetrics::getHeight  )  const [pure virtual]
 

Returns the total height of text. This means ascent + descent.

virtual int ufo::UFontMetrics::getLineskip  )  const [pure virtual]
 

returns the space in pixels between the descent of one line and the ascent of the next line

virtual int ufo::UFontMetrics::getStringWidth const char *  text,
unsigned int  nChar
const [pure virtual]
 

returns the width for the given text and the specified length.

Returns:
the minimal width needed to paint this text

virtual int ufo::UFontMetrics::getStringWidth const std::string &  text  )  const [inline, virtual]
 

returns the width for the given text. Calls internally getStringWidth(const char*, unsigned int);

Returns:
getStringWidth

virtual int ufo::UFontMetrics::getUnderlinePosition  )  const [pure virtual]
 

returns the position of the underline relative to the base line.

virtual int ufo::UFontMetrics::getUnderlineThickness  )  const [pure virtual]
 

returns the thickness of the underline.

virtual unsigned int ufo::UFontMetrics::viewToModel const char *  text,
unsigned int  nChar,
unsigned int  w
const [pure virtual]
 

This method converts the view matrix to the model index, i.e. returns index of that character which will be drawn at the specified x position.

Parameters:
text The text which should be drawn.
nChar The maximal amount of characters
w The x position (in pixels) of the searched character
Returns:
The index of the character

virtual unsigned int ufo::UFontMetrics::viewToModel const std::string &  text,
unsigned int  w
const [inline, virtual]
 

See also:
viewToModel(const char * text, unsigned int nChar, unsigned int w)


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