Commit 544a174e225dc4937342b1e309383a1baeb91a26

henry 2002-12-04T06:19:57

Error handling in Attach

diff --git a/include/FTFont.h b/include/FTFont.h
index 917f0aa..a13cb9e 100755
--- a/include/FTFont.h
+++ b/include/FTFont.h
@@ -58,7 +58,7 @@ class FTGL_EXPORT FTFont
         bool Open( const unsigned char *pBufferBytes, size_t bufferSizeInBytes);
 
         /**
-         * Attach auxilliary file to font (e.g., font metrics).
+         * Attach auxilliary file to font (e.g. font metrics).
          *
          * @param filename  auxilliary font file name.
          *
diff --git a/src/FTFont.cpp b/src/FTFont.cpp
index 1b2059d..14af89e 100755
--- a/src/FTFont.cpp
+++ b/src/FTFont.cpp
@@ -44,7 +44,7 @@ bool FTFont::Open( const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
     {
         FT_Face* ftFace = face.Face();      
         numGlyphs = (*ftFace)->num_glyphs;
-        
+        err = 0;
         return true;
     }
     else
@@ -57,7 +57,16 @@ bool FTFont::Open( const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
 
 bool FTFont::Attach( const char* filename)
 {
-    return face.Attach( filename);
+    if( face.Attach( filename))
+    {
+        err = 0;
+        return true;
+    }
+    else
+    {
+        err = face.Error();
+        return false;
+    }
 }