Hash :
a264b05c
Author :
Date :
2001-08-05T21:37:18
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
#include "FTFace.h"
#include "FTLibrary.h"
#include "FTGL.h"
FTFace::FTFace()
: ftFace(0),
numCharMaps(0),
numGlyphs(0)
{}
FTFace::~FTFace()
{
if( ftFace)
{
Close();
delete ftFace; // is this a prob?
ftFace = 0;
}
}
bool FTFace::Open( const char* filename)
{
ftFace = new FT_Face;
err = FT_New_Face( *FTLibrary::Instance().GetLibrary(), filename, 0, ftFace);
if( err == FT_Err_Unknown_File_Format)
{
// ... the font file could be opened and read, but it appears
// ... that its font format is unsupported
delete ftFace;
ftFace = 0;
return false;
}
else if( err)
{
// ... another error code means that the font file could not
// ... be opened or read, or simply that it is broken...
delete ftFace;
ftFace = 0;
return false;
}
return true;
}
void FTFace::Close()
{
FT_Done_Face( *ftFace);
}
FTSize& FTFace::Size( const int size, const int res )
{
charSize.CharSize( ftFace, size, res, res);
return charSize;
}
bool FTFace::CharMap( CHARMAP encoding )
{
//Insert your own code here.
//End of user code.
return false;
}
FT_Glyph FTFace::Glyph( int index )
{
//Insert your own code here.
//End of user code.
}
FT_Vector FTFace::KernAdvance( int index1, int index2 )
{
//Insert your own code here.
//End of user code.
}