00001 #ifndef __FTGlyphContainer__
00002 #define __FTGlyphContainer__
00003
00004 #include <ft2build.h>
00005 #include FT_FREETYPE_H
00006 #include FT_GLYPH_H
00007
00008 #include "FTGL.h"
00009 #include "FTBBox.h"
00010 #include "FTPoint.h"
00011 #include "FTVector.h"
00012
00013 class FTFace;
00014 class FTGlyph;
00015 class FTCharmap;
00016
00017
00018
00019
00020
00021
00022 class FTGL_EXPORT FTGlyphContainer
00023 {
00024 typedef FTVector<FTGlyph*> GlyphVector;
00025 public:
00026
00027
00028
00029
00030
00031 FTGlyphContainer( FTFace* face);
00032
00033
00034
00035
00036 ~FTGlyphContainer();
00037
00038
00039
00040
00041
00042
00043
00044
00045 bool CharMap( FT_Encoding encoding);
00046
00047
00048
00049
00050
00051
00052
00053
00054 unsigned int FontIndex( const unsigned int characterCode ) const;
00055
00056
00057
00058
00059
00060
00061
00062 void Add( FTGlyph* glyph, const unsigned int characterCode);
00063
00064
00065
00066
00067
00068
00069
00070
00071 FTGlyph* Glyph( const unsigned int characterCode) const;
00072
00073
00074
00075
00076
00077 FTBBox BBox( const unsigned int characterCode) const;
00078
00079
00080
00081
00082
00083
00084
00085
00086 float Advance( const unsigned int characterCode, const unsigned int nextCharacterCode);
00087
00088
00089
00090
00091
00092
00093
00094
00095 FTPoint Render( const unsigned int characterCode, const unsigned int nextCharacterCode, FTPoint penPosition);
00096
00097
00098
00099
00100
00101
00102 FT_Error Error() const { return err;}
00103
00104 private:
00105
00106
00107
00108 FTFace* face;
00109
00110
00111
00112
00113 FTCharmap* charMap;
00114
00115
00116
00117
00118 GlyphVector glyphs;
00119
00120
00121
00122
00123 FT_Error err;
00124 };
00125
00126
00127 #endif // __FTGlyphContainer__