Commit afb26f6ed0d8a8e998ec1d94f1897af7caf5e3d7

henry 2001-08-21T03:33:13

Glyphs are know retrieved from the FTFace object rather than with direct freetype calls.

diff --git a/src/FTGLBitmapFont.cpp b/src/FTGLBitmapFont.cpp
index 3992d34..f47d3a7 100755
--- a/src/FTGLBitmapFont.cpp
+++ b/src/FTGLBitmapFont.cpp
@@ -18,18 +18,10 @@ FTGLBitmapFont::~FTGLBitmapFont()
 bool FTGLBitmapFont::MakeGlyphList()
 {
 //	if( preCache)
-
-	FT_Face* ftFace = face.Face();
-	
-//	numGlyphs = 256; // FIXME hack
-	
+//	numGlyphs = 256; // FIXME hack	
 	for( unsigned int c = 0; c < numGlyphs; ++c)
 	{
-		err = FT_Load_Glyph( *ftFace, c, FT_LOAD_DEFAULT);
-		FT_Glyph ftGlyph;
-		
-		err = FT_Get_Glyph( (*ftFace)->glyph, &ftGlyph);
-
+		FT_Glyph ftGlyph = face.Glyph( c, FT_LOAD_DEFAULT);
 //		FT_HAS_VERTICAL(face)
 
 		tempGlyph = new FTBitmapGlyph( ftGlyph, c);
diff --git a/src/FTGLOutlineFont.cpp b/src/FTGLOutlineFont.cpp
index 78d70da..7e3f782 100755
--- a/src/FTGLOutlineFont.cpp
+++ b/src/FTGLOutlineFont.cpp
@@ -17,17 +17,11 @@ FTGLOutlineFont::~FTGLOutlineFont()
 
 bool FTGLOutlineFont::MakeGlyphList()
 {
-//	int glyphIndex;
-	FT_Face* ftFace = face.Face();
-	
 	numGlyphs = 127; // FIXME hack
 	
 	for( unsigned int n = 0; n < numGlyphs; ++n)
 	{
-		err = FT_Load_Glyph( *ftFace, n, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); // FT_LOAD_DEFAULT... FT_LOAD_NO_SCALE
-		FT_Glyph ftGlyph;
-		
-		err = FT_Get_Glyph( (*ftFace)->glyph, &ftGlyph);
+		FT_Glyph ftGlyph = face.Glyph( n, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP);
 		
 		tempGlyph = new FTVectorGlyph( ftGlyph, n);
 		glyphList->Add( tempGlyph);
diff --git a/src/FTGLPixmapFont.cpp b/src/FTGLPixmapFont.cpp
index 682772c..f6eb46b 100755
--- a/src/FTGLPixmapFont.cpp
+++ b/src/FTGLPixmapFont.cpp
@@ -18,17 +18,10 @@ FTGLPixmapFont::~FTGLPixmapFont()
 bool FTGLPixmapFont::MakeGlyphList()
 {
 //	if( preCache)
-	FT_Face* ftFace = face.Face();
-	
 //	numGlyphs = 256; // FIXME hack
-	
 	for( unsigned int c = 0; c < numGlyphs; ++c)
 	{
-		err = FT_Load_Glyph( *ftFace, c, FT_LOAD_DEFAULT);
-		FT_Glyph ftGlyph;
-		
-		err = FT_Get_Glyph( (*ftFace)->glyph, &ftGlyph);
-
+		FT_Glyph ftGlyph = face.Glyph( c, FT_LOAD_DEFAULT);
 //		FT_HAS_VERTICAL(face)
 
 		tempGlyph = new FTPixmapGlyph( ftGlyph, c);
diff --git a/src/FTGLPolygonFont.cpp b/src/FTGLPolygonFont.cpp
index 8661ffe..1548049 100755
--- a/src/FTGLPolygonFont.cpp
+++ b/src/FTGLPolygonFont.cpp
@@ -16,16 +16,11 @@ FTGLPolygonFont::~FTGLPolygonFont()
 
 bool FTGLPolygonFont::MakeGlyphList()
 {
-	FT_Face* ftFace = face.Face();
-	
 	numGlyphs = 127; // FIXME hack
 	
 	for( unsigned int n = 0; n < numGlyphs; ++n)
 	{
-		err = FT_Load_Glyph( *ftFace, n, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); // FT_LOAD_DEFAULT... FT_LOAD_NO_SCALE
-		FT_Glyph ftGlyph;
-		
-		err = FT_Get_Glyph( (*ftFace)->glyph, &ftGlyph);
+		FT_Glyph ftGlyph = face.Glyph( n, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP);
 		
 		tempGlyph = new FTPolyGlyph( ftGlyph, n);
 		glyphList->Add( tempGlyph);
diff --git a/src/FTGLTextureFont.cpp b/src/FTGLTextureFont.cpp
index 7b5bc93..2ec77bf 100755
--- a/src/FTGLTextureFont.cpp
+++ b/src/FTGLTextureFont.cpp
@@ -104,8 +104,6 @@ bool FTGLTextureFont::MakeGlyphList()
 
 unsigned int FTGLTextureFont::FillGlyphs( unsigned int glyphStart, int id, int width, int height, unsigned char* textdata)
 {
-	FT_Face* ftFace = face.Face();
-	
 	int currentTextX = padding;
 	int currentTextY = padding;// + padding;
 	
@@ -117,11 +115,8 @@ unsigned int FTGLTextureFont::FillGlyphs( unsigned int glyphStart, int id, int w
 	
 	for( n = glyphStart; n <= numGlyphs; ++n)
 	{
-		err = FT_Load_Glyph( *ftFace, n, FT_LOAD_NO_HINTING); // FT_LOAD_DEFAULT
-		FT_Glyph ftGlyph;
+		FT_Glyph ftGlyph = face.Glyph( n, FT_LOAD_NO_HINTING);
 		
-		err = FT_Get_Glyph( (*ftFace)->glyph, &ftGlyph);
-	
 		unsigned char* data = textdata + (( currentTextY * width) + currentTextX);
 		
 		currTextU = (float)currentTextX / (float)width;