FontFTGL Class Reference

Implementation of Font using FTGL. More...

#include <font_ftgl.h>

Inherits Font.

Inheritance diagram for FontFTGL:

Inheritance graph
[legend]
Collaboration diagram for FontFTGL:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 FontFTGL (const char *file, int ptsize)
 Construct font.
virtual ~FontFTGL ()
 Destroy allocated font.
virtual void RenderUTF8 (const std::string &utf8str, float x, float y)
 Render utf-8 encoded text.
virtual int Ascent ()
 Get line height.
virtual int getTextWidth (const std::string &utf8str)=0
 Render some text in 3D.Get With of text in pixels.
virtual int getWwidth ()=0
 Get width of W.

Private Attributes

FTGLPixmapFont * mFont
 FTGL font structure.

Detailed Description

Implementation of Font using FTGL.

This was first try of font. The implementation is without any kind of cache. Don't expect high performance, but it works.

Note:
Currently the implementation isn't complete and isn't woking.

Definition at line 20 of file font_ftgl.h.


Constructor & Destructor Documentation

FontFTGL::FontFTGL const char *  file,
int  ptsize
 

Construct font.

Program is killed if contruction fails.

Parameters:
file Path with file. locateFile isn't used inside.
ptsize Size of font.

Definition at line 15 of file font_ftgl.cpp.

References DIE(), LOGE, and mFont.

Here is the call graph for this function:

FontFTGL::~FontFTGL  )  [virtual]
 

Destroy allocated font.

Definition at line 28 of file font_ftgl.cpp.

References mFont.


Member Function Documentation

int FontFTGL::Ascent  )  [virtual]
 

Get line height.

The value is usefull if you want to render multiline text and need to know height of line.

Returns:
Height if line in font.

Implements Font.

Definition at line 52 of file font_ftgl.cpp.

References assertL, and mFont.

virtual int FontFTGL::getTextWidth const std::string &  utf8str  )  [pure virtual]
 

Render some text in 3D.Get With of text in pixels.

Get width of utf-8 encoded text.

Returns:
Width of text.

Implements Font.

virtual int FontFTGL::getWwidth  )  [pure virtual]
 

Get width of W.

W is usuallu the most width char in font so you may use this as aproximation.

Returns:
Width of W.

Implements Font.

void FontFTGL::RenderUTF8 const std::string &  utf8str,
float  x,
float  y
[virtual]
 

Render utf-8 encoded text.

This function must be called in 2D opengl mode.

Parameters:
utf8str string to render
x x coordinate of text
y y cooridnate of text

Implements Font.

Definition at line 37 of file font_ftgl.cpp.

References assertL, mFont, TIN, and utf8tows().

Here is the call graph for this function:


Member Data Documentation

FTGLPixmapFont* FontFTGL::mFont [private]
 

FTGL font structure.

Definition at line 64 of file font_ftgl.h.

Referenced by Ascent(), FontFTGL(), RenderUTF8(), and ~FontFTGL().


The documentation for this class was generated from the following files:
Generated on Wed Apr 12 14:14:16 2006 for bjs by  doxygen 1.4.5