Got rid of Close() and improved som error handling
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
diff --git a/include/FTFont.h b/include/FTFont.h
index 8167691..5dba96b 100755
--- a/include/FTFont.h
+++ b/include/FTFont.h
@@ -74,11 +74,6 @@ class FTGL_EXPORT FTFont
bool Attach( const char* filename);
/**
- * Disposes of the font
- */
- void Close();
-
- /**
* Set the char size for the current face.
*
* @param size the face size in points (1/72 inch)
diff --git a/src/FTFont.cpp b/src/FTFont.cpp
index 9f53253..80da315 100755
--- a/src/FTFont.cpp
+++ b/src/FTFont.cpp
@@ -18,7 +18,7 @@ FTFont::FTFont()
FTFont::~FTFont()
{
- Close();
+ delete glyphList;
}
@@ -30,7 +30,7 @@ bool FTFont::Open( const char* fontname, bool p)
{
FT_Face* ftFace = face.Face();
numGlyphs = (*ftFace)->num_glyphs;
-
+ err = 0;
return true;
}
else
@@ -66,12 +66,6 @@ bool FTFont::Attach( const char* filename)
}
-void FTFont::Close()
-{
- delete glyphList;
-}
-
-
bool FTFont::FaceSize( const unsigned int size, const unsigned int res )
{
charSize = face.Size( size, res);
@@ -118,8 +112,9 @@ bool FTFont::MakeGlyphList()
bool FTFont::CharMap( FT_Encoding encoding)
{
- err = face.CharMap( encoding);
- return !err;
+ bool result = face.CharMap( encoding);
+ err = face.Error();
+ return result;
}