Updated for FTVectorGlyph
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/FTGLOutlineFont.h b/include/FTGLOutlineFont.h
index 33dbc96..181d43d 100755
--- a/include/FTGLOutlineFont.h
+++ b/include/FTGLOutlineFont.h
@@ -1,9 +1,13 @@
#ifndef __FTGLOutlineFont
#define __FTGLOutlineFont
+
#include "FTFont.h"
#include "FTGL.h"
+
+class FTVectorGlyph;
+
class FTGLOutlineFont : public FTFont
{
public:
@@ -11,11 +15,17 @@ class FTGLOutlineFont : public FTFont
FTGLOutlineFont();
~FTGLOutlineFont();
+// bool render( const char* string);
+
// attributes
private:
// methods
bool MakeGlyphList();
+ // attributes
+ FTVectorGlyph* tempGlyph;
+
+
};
#endif
diff --git a/src/FTGLOutlineFont.cpp b/src/FTGLOutlineFont.cpp
index 7a31d65..4753055 100755
--- a/src/FTGLOutlineFont.cpp
+++ b/src/FTGLOutlineFont.cpp
@@ -1,8 +1,10 @@
-// Code generated by Object Plant
+#include "gl.h"
#include "FTGLOutlineFont.h"
#include "FTGlyphContainer.h"
#include "FTGL.h"
+#include "FTVectorGlyph.h"
+
FTGLOutlineFont::FTGLOutlineFont()
@@ -23,3 +25,39 @@ FTGLOutlineFont::~FTGLOutlineFont()
//End of user code.
}
+
+//bool FTGLOutlineFont::render( const char* string)
+//{
+//
+// glBegin( GL_LINE_LOOP);
+// FTFont::render( string);
+// glEnd();
+//}
+
+
+bool FTGLOutlineFont::MakeGlyphList()
+{
+ int glyphIndex;
+
+ numGlyphs = 127;
+
+ for( int n = 0; n < numGlyphs; ++n)
+ {
+ FT_Face* ftFace = face.Face();
+
+ glyphIndex = FT_Get_Char_Index( *ftFace, n);
+
+ err = FT_Load_Glyph( *ftFace, glyphIndex, FT_LOAD_DEFAULT);
+ if( err)
+ { }
+
+ FT_Glyph ftGlyph;
+
+ err = FT_Get_Glyph( (*ftFace)->glyph, &ftGlyph);
+ if( err)
+ {}
+
+ tempGlyph = new FTVectorGlyph( ftGlyph, glyphIndex);
+ glyphList->Add( tempGlyph);
+ }
+}