Added FT_Error member and accessor function. Minor tidy ups
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 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
diff --git a/include/FTFace.h b/include/FTFace.h
index 5f08829..3c3c9fd 100755
--- a/include/FTFace.h
+++ b/include/FTFace.h
@@ -1,13 +1,14 @@
#ifndef __FTFace__
#define __FTFace__
+//#include "FTGL.h"
+
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_GLYPH_H
#include "FTSize.h"
-#include "FTGL.h"
class FTFace
@@ -24,13 +25,15 @@ class FTFace
FT_Vector KernAdvance( int index1, int index2 );
FT_Face* Face() const { return ftFace;}
+ FT_Error Error() const { return err;}
+
// attributes
private:
// methods
// attributes
-// FONTTYPE fontType;
+ FT_Error err;
FTSize charSize;
FT_Face* ftFace;
int numCharMaps;
diff --git a/src/FTFace.cpp b/src/FTFace.cpp
index 16d4b4d..5f51765 100755
--- a/src/FTFace.cpp
+++ b/src/FTFace.cpp
@@ -1,23 +1,15 @@
-#include "assert.h"
-
#include "FTFace.h"
#include "FTLibrary.h"
#include "FTGL.h"
-// OPSignature: FTFace:FTFace()
FTFace::FTFace()
: ftFace(0),
numCharMaps(0),
numGlyphs(0)
-{
-//Insert your own code here.
-
-//End of user code.
-}
+{}
-// OPSignature: FTFace:~FTFace()
FTFace::~FTFace()
{
if( ftFace)
@@ -29,11 +21,10 @@ FTFace::~FTFace()
}
-// OPSignature: bool FTFace:open( const char*:filename FONTTYPE:fontType )
bool FTFace::Open( const char* filename)
{
ftFace = new FT_Face;
- FT_Error err = FT_New_Face( *FTLibrary::Instance().GetLibrary(), filename, 0, ftFace);
+ err = FT_New_Face( *FTLibrary::Instance().GetLibrary(), filename, 0, ftFace);
if( err == FT_Err_Unknown_File_Format)
{
@@ -56,14 +47,12 @@ bool FTFace::Open( const char* filename)
}
-// OPSignature: bool FTFace:open( const char*:filename FONTTYPE:fontType )
void FTFace::Close()
{
FT_Done_Face( *ftFace);
}
-// OPSignature: bool FTFace:SetSize( const int:size const int:res )
FTSize& FTFace::Size( const int size, const int res )
{
charSize.CharSize( ftFace, size, res, res);
@@ -71,16 +60,15 @@ FTSize& FTFace::Size( const int size, const int res )
}
-// OPSignature: void FTFace:SetCharMap( CHARMAP:encoding )
bool FTFace::CharMap( CHARMAP encoding )
{
//Insert your own code here.
-//End of user code.
+//End of user code.
+ return false;
}
-// OPSignature: FT_Glyph FTFace:GetGlyph( int:index )
FT_Glyph FTFace::Glyph( int index )
{
//Insert your own code here.
@@ -89,7 +77,6 @@ FT_Glyph FTFace::Glyph( int index )
}
-// OPSignature: FT_Vector FTFace:GetKernAdvance( int:index1 int:index2 )
FT_Vector FTFace::KernAdvance( int index1, int index2 )
{
//Insert your own code here.