Added Glyph function
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
diff --git a/include/FTFace.h b/include/FTFace.h
index 9e56b2a..c02bd29 100755
--- a/include/FTFace.h
+++ b/include/FTFace.h
@@ -19,10 +19,13 @@ class FTFace
virtual ~FTFace();
bool Open( const char* filename);
void Close();
+
FTSize& Size( const int size, const int res);
bool CharMap( FT_Encoding encoding);
int CharIndex( int index ) const;
FT_Vector& KernAdvance( int index1, int index2);
+
+ FT_Glyph& Glyph( unsigned int index, FT_Int load_flags);
FT_Face* Face() const { return ftFace;}
FT_Error Error() const { return err;}
@@ -36,6 +39,7 @@ class FTFace
FT_Error err;
FTSize charSize;
FT_Face* ftFace;
+ FT_Glyph ftGlyph;
int numCharMaps;
int numGlyphs;
diff --git a/src/FTFace.cpp b/src/FTFace.cpp
index 1906dbe..3502b48 100755
--- a/src/FTFace.cpp
+++ b/src/FTFace.cpp
@@ -90,3 +90,22 @@ FT_Vector& FTFace::KernAdvance( int index1, int index2 )
return kernAdvance;
}
+
+
+FT_Glyph& FTFace::Glyph( unsigned int index, FT_Int load_flags)
+{
+ err = FT_Load_Glyph( *ftFace, index, load_flags);
+ err = FT_Get_Glyph( (*ftFace)->glyph, &ftGlyph);
+
+ if( !err)
+ {
+ return ftGlyph;
+ }
+ else
+ {
+ return NULL;
+ }
+}
+
+
+