Commit 6acb6ea5a9dad559d5aad5a11a0f98177dd40475

henry 2001-08-19T22:32:57

Updated to reflect changes in FTFace & FTGlyphContainer

diff --git a/include/FTFont.h b/include/FTFont.h
index 55d96ce..c2ab3e8 100755
--- a/include/FTFont.h
+++ b/include/FTFont.h
@@ -25,13 +25,15 @@ class	FTFont
 		virtual bool Open( const char* fontname );
 		virtual void Close();
 		virtual bool FaceSize( const int size, const int res = 72 );
-		virtual bool CharMap( CHARMAP encoding );
+		virtual bool CharMap( FT_Encoding encoding );
 		virtual int	Ascender() const;
 		virtual int	Descender() const;
 		virtual void BBox( const char* text, int& llx, int& lly, int& urx, int& ury ) const;
 		virtual void render( const char* string );
 		
 		virtual FT_Error Error() const { return err;}
+//		virtual const char* ErrorString();
+
 		
 		// attributes
 		
diff --git a/src/FTFont.cpp b/src/FTFont.cpp
index fbad1f7..00067a2 100755
--- a/src/FTFont.cpp
+++ b/src/FTFont.cpp
@@ -22,14 +22,9 @@ FTFont::~FTFont()
 
 bool FTFont::Open( const char* fontname )
 {
-	//FIXME first check map to see if it's already open.
-//	FTFace face; // When we have a list of faces
-
 	if( face.Open( fontname))
 	{
-//		faceList.insert( FaceMap::value_type( string( fontname), face));
-		FT_Face* ftFace = face.Face();
-		
+		FT_Face* ftFace = face.Face();		
 		numGlyphs = (*ftFace)->num_glyphs;
 		
 		return true;
@@ -56,7 +51,7 @@ bool FTFont::FaceSize( const int size, const int res )
 	if( glyphList)
 		delete glyphList;
 	
-	glyphList = new FTGlyphContainer( face.Face(), numGlyphs);	
+	glyphList = new FTGlyphContainer( &face, numGlyphs);
 	
 	if( MakeGlyphList())
 	{
@@ -69,10 +64,10 @@ bool FTFont::FaceSize( const int size, const int res )
 }
 
 
-bool FTFont::CharMap( CHARMAP encoding)
+bool FTFont::CharMap( FT_Encoding encoding)
 {
-	face.CharMap( encoding);
-	return false; // for the moment seeing as this doesn't do anything!!!
+	err = face.CharMap( encoding);
+	return !err;
 }
 
 
@@ -112,3 +107,17 @@ void FTFont::render( const char* string )
 		++c;
 	}
 }
+
+
+//const char* FTFont::ErrorString()
+// {
+//         static char ukn[1024];
+// 
+//         for (uint32 i = 0; ft_errors[i].err_code != 0 || ft_errors[i].err_msg != 0; i++)
+//         {
+//                 if (ft_errors[i].err_code == fte)
+//                         return ft_errors[i].err_msg;
+//         }
+//         smprintf (ukn, 1024, "Unknown freetype2 error, errcode: 0x%x", fte);
+//         return ukn;
+// }