Main Page | Class Hierarchy | Data Structures | File List | Data Fields | Globals

FTGlyphContainer Class Reference

#include <FTGlyphContainer.h>


Detailed Description

FTGlyphContainer holds the post processed FTGlyph objects.

See also:
FTGlyph

Definition at line 22 of file FTGlyphContainer.h.

Public Member Functions

 FTGlyphContainer (FTFace *face)
 Constructor.

 ~FTGlyphContainer ()
 Destructor.

bool CharMap (FT_Encoding encoding)
 Sets the character map for the face.

unsigned int FontIndex (const unsigned int characterCode) const
 Get the font index of the input character.

void Add (FTGlyph *glyph, const unsigned int characterCode)
 Adds a glyph to this glyph list.

const FTGlyph *const  Glyph (const unsigned int characterCode) const
 Get a glyph from the glyph list.

FTBBox BBox (const unsigned int characterCode) const
 Get the bounding box for a character.

float Advance (const unsigned int characterCode, const unsigned int nextCharacterCode)
 Returns the kerned advance width for a glyph.

FTPoint Render (const unsigned int characterCode, const unsigned int nextCharacterCode, FTPoint penPosition)
 Renders a character.

FT_Error Error () const
 Queries the Font for errors.


Constructor & Destructor Documentation

FTGlyphContainer::FTGlyphContainer FTFace face  ) 
 

Constructor.

Parameters:
face The Freetype face

Definition at line 7 of file FTGlyphContainer.cpp.

References FTVector< FT_VECTOR_ITEM_TYPE >::push_back().

FTGlyphContainer::~FTGlyphContainer  ) 
 

Destructor.

Definition at line 16 of file FTGlyphContainer.cpp.

References FTVector< FT_VECTOR_ITEM_TYPE >::begin(), FTVector< FT_VECTOR_ITEM_TYPE >::clear(), and FTVector< FT_VECTOR_ITEM_TYPE >::end().


Member Function Documentation

void FTGlyphContainer::Add FTGlyph glyph,
const unsigned int  characterCode
 

Adds a glyph to this glyph list.

Parameters:
glyph The FTGlyph to be inserted into the container
characterCode The char code of the glyph NOT the glyph index.

Definition at line 43 of file FTGlyphContainer.cpp.

References FTCharmap::InsertIndex(), FTVector< FT_VECTOR_ITEM_TYPE >::push_back(), and FTVector< FT_VECTOR_ITEM_TYPE >::size().

float FTGlyphContainer::Advance const unsigned int  characterCode,
const unsigned int  nextCharacterCode
 

Returns the kerned advance width for a glyph.

Parameters:
characterCode glyph index of the character
nextCharacterCode the next glyph in a string
Returns:
advance width

Definition at line 63 of file FTGlyphContainer.cpp.

References FTCharmap::FontIndex(), FTCharmap::GlyphListIndex(), FTFace::KernAdvance(), and FTPoint::X().

Referenced by FTFont::Advance(), and FTFont::BBox().

FTBBox FTGlyphContainer::BBox const unsigned int  characterCode  )  const
 

Get the bounding box for a character.

Parameters:
characterCode The char code of the glyph NOT the glyph index

Definition at line 57 of file FTGlyphContainer.cpp.

References FTCharmap::GlyphListIndex().

Referenced by FTFont::BBox().

bool FTGlyphContainer::CharMap FT_Encoding  encoding  ) 
 

Sets the character map for the face.

Parameters:
encoding the Freetype encoding symbol. See above.
Returns:
true if charmap was valid and set correctly

Definition at line 29 of file FTGlyphContainer.cpp.

References FTCharmap::CharMap(), and FTCharmap::Error().

Referenced by FTFont::CharMap().

FT_Error FTGlyphContainer::Error  )  const [inline]
 

Queries the Font for errors.

Returns:
The current error code.

Definition at line 102 of file FTGlyphContainer.h.

Referenced by FTFont::CharMap().

unsigned int FTGlyphContainer::FontIndex const unsigned int  characterCode  )  const
 

Get the font index of the input character.

Parameters:
characterCode The character code of the requested glyph in the current encoding eg apple roman.
Returns:
The font index for the character.

Definition at line 37 of file FTGlyphContainer.cpp.

References FTCharmap::FontIndex().

const FTGlyph *const FTGlyphContainer::Glyph const unsigned int  characterCode  )  const
 

Get a glyph from the glyph list.

Parameters:
characterCode The char code of the glyph NOT the glyph index
Returns:
An FTGlyph or null is it hasn't been loaded.

Definition at line 50 of file FTGlyphContainer.cpp.

References FTCharmap::GlyphListIndex().

FTPoint FTGlyphContainer::Render const unsigned int  characterCode,
const unsigned int  nextCharacterCode,
FTPoint  penPosition
 

Renders a character.

Parameters:
characterCode the glyph to be Rendered
nextCharacterCode the next glyph in the string. Used for kerning.
penPosition the position to Render the glyph
Returns:
The distance to advance the pen position after Rendering

Definition at line 75 of file FTGlyphContainer.cpp.

References FTFace::Error(), FTCharmap::FontIndex(), FTCharmap::GlyphListIndex(), and FTFace::KernAdvance().

Referenced by FTFont::Render().


The documentation for this class was generated from the following files:
Generated on Sun Dec 5 22:24:07 2004 for FTGL by doxygen 1.3.6