1
#ifndef __FTGlyphContainer__
2
#define __FTGlyphContainer__
18
* FTGlyphContainer holds the post processed FTGlyph objects.
22
class FTGL_EXPORT FTGlyphContainer
24
typedef FTVector<FTGlyph*> GlyphVector;
29
* @param face The Freetype face
31
FTGlyphContainer( FTFace* face);
39
* Sets the character map for the face.
41
* @param encoding the Freetype encoding symbol. See above.
42
* @return <code>true</code> if charmap was valid
45
bool CharMap( FT_Encoding encoding);
48
* Get the font index of the input character.
50
* @param characterCode The character code of the requested glyph in the
51
* current encoding eg apple roman.
52
* @return The font index for the character.
54
unsigned int FontIndex( const unsigned int characterCode ) const;
57
* Adds a glyph to this glyph list.
59
* @param glyph The FTGlyph to be inserted into the container
60
* @param characterCode The char code of the glyph NOT the glyph index.
62
void Add( FTGlyph* glyph, const unsigned int characterCode);
65
* Get a glyph from the glyph list
67
* @param characterCode The char code of the glyph NOT the glyph index
68
* @return An FTGlyph or <code>null</code> is it hasn't been
71
const FTGlyph* const Glyph( const unsigned int characterCode) const;
74
* Get the bounding box for a character.
75
* @param characterCode The char code of the glyph NOT the glyph index
77
FTBBox BBox( const unsigned int characterCode) const;
80
* Returns the kerned advance width for a glyph.
82
* @param characterCode glyph index of the character
83
* @param nextCharacterCode the next glyph in a string
84
* @return advance width
86
float Advance( const unsigned int characterCode, const unsigned int nextCharacterCode);
90
* @param characterCode the glyph to be Rendered
91
* @param nextCharacterCode the next glyph in the string. Used for kerning.
92
* @param penPosition the position to Render the glyph
93
* @return The distance to advance the pen position after Rendering
95
FTPoint Render( const unsigned int characterCode, const unsigned int nextCharacterCode, FTPoint penPosition);
98
* Queries the Font for errors.
100
* @return The current error code.
102
FT_Error Error() const { return err;}
111
* The Character Map object associated with the current face
116
* A structure to hold the glyphs
121
* Current error code. Zero means no error.
127
#endif // __FTGlyphContainer__