glttf::BasicFont< T > Class Template Reference

An basic font template. More...

#include <font.h>

Inheritance diagram for glttf::BasicFont< T >:

glttf::Font List of all members.

Public Types

typedef T GlyphType
 The glyph type of this font.
typedef T::Parameter Parameter
 The parameter type of this font.

Public Member Functions

 BasicFont (const std::string &filename, unsigned int size=32, Font::FontStyle style=Font::PLAIN, unsigned long faceIndex=Font::DEFAULT_FACE_INDEX)
 Create a new font from file.
 ~BasicFont ()
 Destructor.
void setupState ()
 Set up rendering state.
void cleanupState ()
 Clean up rendering state.
void setParameter (const Parameter &param)
 Set glyph creation parameter.
const ParametergetParameter () const
 Get glyph creation parameter.

Protected Member Functions

GlyphmakeGlyph (FT_GlyphSlot glyph)
 Create a new glyph.

Detailed Description

template<class T>
class glttf::BasicFont< T >

An basic font template.

Parameters:
T The glyph type of this font
Author:
Riku Salminen


Constructor & Destructor Documentation

template<class T>
glttf::BasicFont< T >::BasicFont ( const std::string &  filename,
unsigned int  size = 32,
Font::FontStyle  style = Font::PLAIN,
unsigned long  faceIndex = Font::DEFAULT_FACE_INDEX 
) [inline]

Create a new font from file.

Parameters:
filename The file name to load
size the point size of the font
style the style of the font
faceIndex the index of the font face in the font file
Exceptions:
std::runtime_error if the display list can't be compiled or on tesselation errors
See also:
Font::Font(const std::string&, unsigned int, Font::FontStyle, unsigned long), Vectorizer


Member Function Documentation

template<class T>
void glttf::BasicFont< T >::setupState (  )  [inline, virtual]

Set up rendering state.

Calls Font::setupState() and GlyphType::setupState().

See also:
Font::setupState()

Reimplemented from glttf::Font.

template<class T>
void glttf::BasicFont< T >::cleanupState (  )  [inline, virtual]

Clean up rendering state.

Calls Font::cleanupState() and GlyphType::setupState.

See also:
Font::cleanupState()

Reimplemented from glttf::Font.

template<class T>
void glttf::BasicFont< T >::setParameter ( const Parameter param  )  [inline]

Set glyph creation parameter.

Destroys cached glyphs

Parameters:
param the new parameter to use for glyph creation
Exceptions:
std::logic_error if rendering state is set

template<class T>
const Parameter& glttf::BasicFont< T >::getParameter (  )  const [inline]

Get glyph creation parameter.

Returns:
the parameter used in glyph creation

template<class T>
Glyph* glttf::BasicFont< T >::makeGlyph ( FT_GlyphSlot  glyph  )  [inline, protected, virtual]

Create a new glyph.

Calls Policy::makeGlyph(glyph).

Parameters:
glyph the FreeType glyph which the glyph is built from
Returns:
a pointer to a new Glyph object. The caller is responsible for destroying the new object.
Exceptions:
std::runtime_error on errors
See also:
FT_GlyphSlot

Implements glttf::Font.


The documentation for this class was generated from the following file:
Generated on Mon Jan 8 12:08:37 2007 for GLttf by  doxygen 1.5.1