00001 #ifndef __FTFace__
00002 #define __FTFace__
00003
00004 #include <ft2build.h>
00005 #include FT_FREETYPE_H
00006 #include FT_GLYPH_H
00007
00008 #include "FTGL.h"
00009 #include "FTPoint.h"
00010 #include "FTSize.h"
00011
00018 class FTGL_EXPORT FTFace
00019 {
00020 public:
00026 FTFace( const char* fontFilePath);
00027
00034 FTFace( const unsigned char *pBufferBytes, size_t bufferSizeInBytes );
00035
00041 virtual ~FTFace();
00042
00050 bool Attach( const char* fontFilePath);
00051
00060 bool Attach( const unsigned char *pBufferBytes, size_t bufferSizeInBytes);
00061
00067 FT_Face* Face() const { return ftFace;}
00068
00079 const FTSize& Size( const unsigned int size, const unsigned int res);
00080
00086 unsigned int CharMapCount();
00087
00093 FT_Encoding* CharMapList();
00094
00098 FTPoint KernAdvance( unsigned int index1, unsigned int index2);
00099
00103 FT_GlyphSlot Glyph( unsigned int index, FT_Int load_flags);
00104
00108 unsigned int GlyphCount() const { return numGlyphs;}
00109
00115 FT_Error Error() const { return err; }
00116
00117 private:
00121 FT_Face* ftFace;
00122
00126 FTSize charSize;
00127
00131 int numGlyphs;
00132
00133 FT_Encoding* fontEncodingList;
00134
00138 bool hasKerningTable;
00139
00143 FT_Error err;
00144 };
00145
00146
00147 #endif // __FTFace__