FTGlyphContainer Class Reference

#include <FTGlyphContainer.h>

List of all members.

Public Member Functions

 FTGlyphContainer (FTFace *face)
 ~FTGlyphContainer ()
bool CharMap (FT_Encoding encoding)
unsigned int FontIndex (const unsigned int characterCode) const
void Add (FTGlyph *glyph, const unsigned int characterCode)
FTGlyphGlyph (const unsigned int characterCode) const
FTBBox BBox (const unsigned int characterCode) const
float Advance (const unsigned int characterCode, const unsigned int nextCharacterCode)
FTPoint Render (const unsigned int characterCode, const unsigned int nextCharacterCode, FTPoint penPosition)
FT_Error Error () const
 FTGlyphContainer (FTFace *face)
 ~FTGlyphContainer ()
bool CharMap (FT_Encoding encoding)
unsigned int FontIndex (const unsigned int characterCode) const
void Add (FTGlyph *glyph, const unsigned int characterCode)
FTGlyphGlyph (const unsigned int characterCode) const
FTBBox BBox (const unsigned int characterCode) const
float Advance (const unsigned int characterCode, const unsigned int nextCharacterCode)
FTPoint Render (const unsigned int characterCode, const unsigned int nextCharacterCode, FTPoint penPosition)
FT_Error Error () const

Private Types

typedef FTVector< FTGlyph * > GlyphVector
typedef FTVector< FTGlyph * > GlyphVector

Private Attributes

FTFaceface
FTCharmapcharMap
GlyphVector glyphs
FT_Error err
FTFaceface
FTCharmapcharMap


Detailed Description

FTGlyphContainer holds the post processed FTGlyph objects.

See also:
FTGlyph

Definition at line 22 of file FTGlyphContainer.h.


Member Typedef Documentation

typedef FTVector<FTGlyph*> FTGlyphContainer::GlyphVector [private]

Definition at line 24 of file FTGlyphContainer.h.

typedef FTVector<FTGlyph*> FTGlyphContainer::GlyphVector [private]

Definition at line 24 of file FTGlyphContainer.h.


Constructor & Destructor Documentation

FTGlyphContainer::FTGlyphContainer ( FTFace face  ) 

Constructor

Parameters:
face The Freetype face

Definition at line 7 of file FTGlyphContainer.cxx.

References charMap, face, glyphs, NULL, and FTVector< FT_VECTOR_ITEM_TYPE >::push_back().

FTGlyphContainer::~FTGlyphContainer (  ) 

Destructor

Definition at line 16 of file FTGlyphContainer.cxx.

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

FTGlyphContainer::FTGlyphContainer ( FTFace face  ) 

Constructor

Parameters:
face The Freetype face

FTGlyphContainer::~FTGlyphContainer (  ) 

Destructor


Member Function Documentation

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.cxx.

References FTCharmap::CharMap(), charMap, err, FTCharmap::Error(), and result().

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.cxx.

References charMap, and FTCharmap::FontIndex().

Referenced by FTFont::CheckGlyph().

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.cxx.

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

Referenced by FTFont::CheckGlyph().

FTGlyph * 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.cxx.

References charMap, FTCharmap::GlyphListIndex(), and glyphs.

Referenced by FTFont::CheckGlyph().

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.cxx.

References charMap, FTCharmap::GlyphListIndex(), and glyphs.

Referenced by FTFont::BBox().

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.cxx.

References charMap, face, FTCharmap::FontIndex(), FTCharmap::GlyphListIndex(), glyphs, FTFace::KernAdvance(), width, and FTPoint::X().

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

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.cxx.

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

Referenced by FTFont::Render().

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().

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

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.

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.

FTGlyph* 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.

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

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

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

FT_Error FTGlyphContainer::Error (  )  const [inline]

Queries the Font for errors.

Returns:
The current error code.

Definition at line 102 of file FTGlyphContainer.h.


Member Data Documentation

FTFace* FTGlyphContainer::face [private]

The FTGL face

Definition at line 108 of file FTGlyphContainer.h.

Referenced by Advance(), FTGlyphContainer(), and Render().

FTCharmap* FTGlyphContainer::charMap [private]

The Character Map object associated with the current face

Definition at line 113 of file FTGlyphContainer.h.

Referenced by Add(), Advance(), BBox(), CharMap(), FontIndex(), FTGlyphContainer(), Glyph(), Render(), and ~FTGlyphContainer().

GlyphVector FTGlyphContainer::glyphs [private]

A structure to hold the glyphs

Definition at line 118 of file FTGlyphContainer.h.

Referenced by Add(), Advance(), BBox(), FTGlyphContainer(), Glyph(), Render(), and ~FTGlyphContainer().

FT_Error FTGlyphContainer::err [private]

Current error code. Zero means no error.

Definition at line 123 of file FTGlyphContainer.h.

Referenced by CharMap().

FTFace* FTGlyphContainer::face [private]

The FTGL face

Definition at line 108 of file FTGlyphContainer.h.

FTCharmap* FTGlyphContainer::charMap [private]

The Character Map object associated with the current face

Definition at line 113 of file FTGlyphContainer.h.


The documentation for this class was generated from the following files:
Generated on Tue Jul 5 16:25:33 2011 for ROOT_528-00b_version by  doxygen 1.5.1