Glyphs are know retrieved from the FTFace object rather than with direct freetype calls.
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
diff --git a/src/FTGLBitmapFont.cpp b/src/FTGLBitmapFont.cpp
index 3992d34..f47d3a7 100755
--- a/src/FTGLBitmapFont.cpp
+++ b/src/FTGLBitmapFont.cpp
@@ -18,18 +18,10 @@ FTGLBitmapFont::~FTGLBitmapFont()
bool FTGLBitmapFont::MakeGlyphList()
{
// if( preCache)
-
- FT_Face* ftFace = face.Face();
-
-// numGlyphs = 256; // FIXME hack
-
+// numGlyphs = 256; // FIXME hack
for( unsigned int c = 0; c < numGlyphs; ++c)
{
- err = FT_Load_Glyph( *ftFace, c, FT_LOAD_DEFAULT);
- FT_Glyph ftGlyph;
-
- err = FT_Get_Glyph( (*ftFace)->glyph, &ftGlyph);
-
+ FT_Glyph ftGlyph = face.Glyph( c, FT_LOAD_DEFAULT);
// FT_HAS_VERTICAL(face)
tempGlyph = new FTBitmapGlyph( ftGlyph, c);
diff --git a/src/FTGLOutlineFont.cpp b/src/FTGLOutlineFont.cpp
index 78d70da..7e3f782 100755
--- a/src/FTGLOutlineFont.cpp
+++ b/src/FTGLOutlineFont.cpp
@@ -17,17 +17,11 @@ FTGLOutlineFont::~FTGLOutlineFont()
bool FTGLOutlineFont::MakeGlyphList()
{
-// int glyphIndex;
- FT_Face* ftFace = face.Face();
-
numGlyphs = 127; // FIXME hack
for( unsigned int n = 0; n < numGlyphs; ++n)
{
- err = FT_Load_Glyph( *ftFace, n, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); // FT_LOAD_DEFAULT... FT_LOAD_NO_SCALE
- FT_Glyph ftGlyph;
-
- err = FT_Get_Glyph( (*ftFace)->glyph, &ftGlyph);
+ FT_Glyph ftGlyph = face.Glyph( n, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP);
tempGlyph = new FTVectorGlyph( ftGlyph, n);
glyphList->Add( tempGlyph);
diff --git a/src/FTGLPixmapFont.cpp b/src/FTGLPixmapFont.cpp
index 682772c..f6eb46b 100755
--- a/src/FTGLPixmapFont.cpp
+++ b/src/FTGLPixmapFont.cpp
@@ -18,17 +18,10 @@ FTGLPixmapFont::~FTGLPixmapFont()
bool FTGLPixmapFont::MakeGlyphList()
{
// if( preCache)
- FT_Face* ftFace = face.Face();
-
// numGlyphs = 256; // FIXME hack
-
for( unsigned int c = 0; c < numGlyphs; ++c)
{
- err = FT_Load_Glyph( *ftFace, c, FT_LOAD_DEFAULT);
- FT_Glyph ftGlyph;
-
- err = FT_Get_Glyph( (*ftFace)->glyph, &ftGlyph);
-
+ FT_Glyph ftGlyph = face.Glyph( c, FT_LOAD_DEFAULT);
// FT_HAS_VERTICAL(face)
tempGlyph = new FTPixmapGlyph( ftGlyph, c);
diff --git a/src/FTGLPolygonFont.cpp b/src/FTGLPolygonFont.cpp
index 8661ffe..1548049 100755
--- a/src/FTGLPolygonFont.cpp
+++ b/src/FTGLPolygonFont.cpp
@@ -16,16 +16,11 @@ FTGLPolygonFont::~FTGLPolygonFont()
bool FTGLPolygonFont::MakeGlyphList()
{
- FT_Face* ftFace = face.Face();
-
numGlyphs = 127; // FIXME hack
for( unsigned int n = 0; n < numGlyphs; ++n)
{
- err = FT_Load_Glyph( *ftFace, n, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); // FT_LOAD_DEFAULT... FT_LOAD_NO_SCALE
- FT_Glyph ftGlyph;
-
- err = FT_Get_Glyph( (*ftFace)->glyph, &ftGlyph);
+ FT_Glyph ftGlyph = face.Glyph( n, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP);
tempGlyph = new FTPolyGlyph( ftGlyph, n);
glyphList->Add( tempGlyph);
diff --git a/src/FTGLTextureFont.cpp b/src/FTGLTextureFont.cpp
index 7b5bc93..2ec77bf 100755
--- a/src/FTGLTextureFont.cpp
+++ b/src/FTGLTextureFont.cpp
@@ -104,8 +104,6 @@ bool FTGLTextureFont::MakeGlyphList()
unsigned int FTGLTextureFont::FillGlyphs( unsigned int glyphStart, int id, int width, int height, unsigned char* textdata)
{
- FT_Face* ftFace = face.Face();
-
int currentTextX = padding;
int currentTextY = padding;// + padding;
@@ -117,11 +115,8 @@ unsigned int FTGLTextureFont::FillGlyphs( unsigned int glyphStart, int id, int w
for( n = glyphStart; n <= numGlyphs; ++n)
{
- err = FT_Load_Glyph( *ftFace, n, FT_LOAD_NO_HINTING); // FT_LOAD_DEFAULT
- FT_Glyph ftGlyph;
+ FT_Glyph ftGlyph = face.Glyph( n, FT_LOAD_NO_HINTING);
- err = FT_Get_Glyph( (*ftFace)->glyph, &ftGlyph);
-
unsigned char* data = textdata + (( currentTextY * width) + currentTextX);
currTextU = (float)currentTextX / (float)width;