Commit 06d66c75fb262a3b0f20e525941d9b54802115ba

henry 2001-08-07T21:28:07

Minor tidy ups. Tidied up the error stuff

diff --git a/include/FTFont.h b/include/FTFont.h
index 3a0c703..898384d 100755
--- a/include/FTFont.h
+++ b/include/FTFont.h
@@ -48,11 +48,10 @@ class	FTFont
 		
 		// future list of sizes
 		FTSize charSize;
+
+//		string fontName;
 		
 		int numGlyphs;
-		
-		string fontName;
-		
 		FTGlyphContainer*	glyphList;
 		
 		FT_Vector pen;
diff --git a/src/FTFont.cpp b/src/FTFont.cpp
index 5c81e06..de31df1 100755
--- a/src/FTFont.cpp
+++ b/src/FTFont.cpp
@@ -5,9 +5,9 @@
 
 
 FTFont::FTFont()
-:	fontName(0),
-	numFaces(0),
-	glyphList(0)
+:	numFaces(0),
+	glyphList(0),
+	err(0)
 {
 	pen.x = 0;
 	pen.y = 0;
@@ -15,10 +15,12 @@ FTFont::FTFont()
 
 
 FTFont::~FTFont()
-{}
+{
+	Close();
+}
 
 
-bool	FTFont::Open( const char* fontname )
+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
@@ -34,12 +36,13 @@ bool	FTFont::Open( const char* fontname )
 	}
 	else
 	{
+		err = face.Error();
 		return false;
 	}
 }
 
 
-void	FTFont::Close()
+void FTFont::Close()
 {
 	face.Close();
 	delete glyphList;
@@ -55,9 +58,14 @@ bool FTFont::FaceSize( const int size, const int res )
 	
 	glyphList = new FTGlyphContainer( face.Face(), numGlyphs);	
 	
-	MakeGlyphList();
-
-	return true;
+	if( MakeGlyphList())
+	{
+		return true;
+	}
+	else
+	{
+		return false;
+	}
 }
 
 
@@ -94,7 +102,7 @@ int	FTFont::Descender() const
 }
 
 
-void	FTFont::BBox( const char* text, int& llx, int& lly, int& urx, int& ury ) const
+void FTFont::BBox( const char* text, int& llx, int& lly, int& urx, int& ury ) const
 {
 //Insert your own code here.