Commit 23cb67ba2ae73ff9a3d189c557eca97bc246d3b0

henry 2001-08-20T22:36:44

Added Glyph function

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;
+	}
+}
+
+
+