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
00012
00013
00014
00015
00016
00017
00018 class FTGL_EXPORT FTFace
00019 {
00020 public:
00021
00022
00023
00024
00025
00026 FTFace( const char* fontFilePath);
00027
00028
00029
00030
00031
00032
00033
00034 FTFace( const unsigned char *pBufferBytes, size_t bufferSizeInBytes );
00035
00036
00037
00038
00039
00040
00041 virtual ~FTFace();
00042
00043
00044
00045
00046
00047
00048
00049
00050 bool Attach( const char* fontFilePath);
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 bool Attach( const unsigned char *pBufferBytes, size_t bufferSizeInBytes);
00061
00062
00063
00064
00065
00066
00067 FT_Face* Face() const { return ftFace;}
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079 const FTSize& Size( const unsigned int size, const unsigned int res);
00080
00081
00082
00083
00084
00085
00086 unsigned int CharMapCount();
00087
00088
00089
00090
00091
00092
00093 FT_Encoding* CharMapList();
00094
00095
00096
00097
00098 FTPoint KernAdvance( unsigned int index1, unsigned int index2);
00099
00100
00101
00102
00103 FT_GlyphSlot Glyph( unsigned int index, FT_Int load_flags);
00104
00105
00106
00107
00108 unsigned int GlyphCount() const { return numGlyphs;}
00109
00110
00111
00112
00113
00114
00115 FT_Error Error() const { return err; }
00116
00117 private:
00118
00119
00120
00121 FT_Face* ftFace;
00122
00123
00124
00125
00126 FTSize charSize;
00127
00128
00129
00130
00131 int numGlyphs;
00132
00133 FT_Encoding* fontEncodingList;
00134
00135
00136
00137
00138 bool hasKerningTable;
00139
00140
00141
00142
00143 FT_Error err;
00144 };
00145
00146
00147 #endif // __FTFace__