Minor tidy ups. Tidied up the error stuff
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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
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.