00001 #ifndef __FTFace__
00002 #define __FTFace__
00003
00004 #include "FTGL.h"
00005
00006 #include <ft2build.h>
00007 #include FT_FREETYPE_H
00008 #include FT_GLYPH_H
00009
00010 #include "FTPoint.h"
00011 #include "FTSize.h"
00012
00019 class FTGL_EXPORT FTFace
00020 {
00021 public:
00027 FTFace( const char* filename);
00028
00035 FTFace( const unsigned char *pBufferBytes, size_t bufferSizeInBytes );
00036
00042 virtual ~FTFace();
00043
00051 bool Attach( const char* filename);
00052
00061 bool Attach( const unsigned char *pBufferBytes, size_t bufferSizeInBytes);
00062
00066 void Close();
00067
00073 FT_Face* Face() const { return ftFace;}
00074
00085 const FTSize& Size( const unsigned int size, const unsigned int res);
00086
00087 unsigned int UnitsPerEM() const;
00088
00094 unsigned int CharMapCount();
00095
00101 FT_Encoding* CharMapList();
00102
00106 FTPoint KernAdvance( unsigned int index1, unsigned int index2);
00107
00111 FT_GlyphSlot Glyph( unsigned int index, FT_Int load_flags);
00112
00116 unsigned int GlyphCount() const { return numGlyphs;}
00117
00123 FT_Error Error() const { return err; }
00124
00125 private:
00129 FT_Face* ftFace;
00130
00134 FTSize charSize;
00135
00139 int numGlyphs;
00140
00141 FT_Encoding* fontEncodingList;
00142
00146 FT_Error err;
00147 };
00148
00149
00150 #endif // __FTFace__