Removed glyph index parameter from c_stor (see FTGlyph) and updated comments
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 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
diff --git a/include/FTBitmapGlyph.h b/include/FTBitmapGlyph.h
index e8d200a..d650ba5 100755
--- a/include/FTBitmapGlyph.h
+++ b/include/FTBitmapGlyph.h
@@ -11,9 +11,24 @@
class FTBitmapGlyph : public FTGlyph
{
public:
- // methods
- FTBitmapGlyph( FT_Glyph glyph, unsigned int glyphIndex);
+ /**
+ * Constructor
+ *
+ * @param
+ */
+ FTBitmapGlyph( FT_Glyph glyph);
+
+ /**
+ *
+ */
virtual ~FTBitmapGlyph();
+
+ /**
+ *
+ * @param pen
+ *
+ * @return
+ */
virtual float Render( const FT_Vector& pen);
// attributes
diff --git a/include/FTPixmapGlyph.h b/include/FTPixmapGlyph.h
index f0a2ac3..3485e8d 100755
--- a/include/FTPixmapGlyph.h
+++ b/include/FTPixmapGlyph.h
@@ -12,7 +12,7 @@ class FTPixmapGlyph : public FTGlyph
{
public:
// methods
- FTPixmapGlyph( FT_Glyph glyph, const unsigned int glyphIndex);
+ FTPixmapGlyph( FT_Glyph glyph);
virtual ~FTPixmapGlyph();
virtual float Render( const FT_Vector& pen);
diff --git a/include/FTPolyGlyph.h b/include/FTPolyGlyph.h
index a692b63..7682fcd 100644
--- a/include/FTPolyGlyph.h
+++ b/include/FTPolyGlyph.h
@@ -13,7 +13,7 @@ class FTPolyGlyph : public FTGlyph
{
public:
// methods
- FTPolyGlyph( FT_Glyph glyph, unsigned int glyphIndex);
+ FTPolyGlyph( FT_Glyph glyph);
virtual ~FTPolyGlyph();
virtual float Render( const FT_Vector& pen);
diff --git a/include/FTTextureGlyph.h b/include/FTTextureGlyph.h
index 6e16a04..bac8d4c 100755
--- a/include/FTTextureGlyph.h
+++ b/include/FTTextureGlyph.h
@@ -13,7 +13,7 @@ class FTTextureGlyph : public FTGlyph
{
public:
// methods
- FTTextureGlyph( FT_Glyph glyph, unsigned int gi, int id, unsigned char* data, int stride, int height, float u, float v);
+ FTTextureGlyph( FT_Glyph glyph, int id, unsigned char* data, int stride, int height, float u, float v);
virtual ~FTTextureGlyph();
virtual float Render( const FT_Vector& pen);
diff --git a/src/FTBitmapGlyph.cpp b/src/FTBitmapGlyph.cpp
index e2bc09b..07af04a 100755
--- a/src/FTBitmapGlyph.cpp
+++ b/src/FTBitmapGlyph.cpp
@@ -4,8 +4,8 @@
#include "FTGL.h"
-FTBitmapGlyph::FTBitmapGlyph( FT_Glyph glyph, unsigned int gi)
-: FTGlyph( gi),
+FTBitmapGlyph::FTBitmapGlyph( FT_Glyph glyph)
+: FTGlyph(),
destWidth(0),
destHeight(0),
data(0)
@@ -25,7 +25,7 @@ FTBitmapGlyph::FTBitmapGlyph( FT_Glyph glyph, unsigned int gi)
int srcHeight = source->rows;
int srcPitch = source->pitch;
- advance = glyph->advance.x >> 16; // this is 6 in the freetype docs!!!!!!
+ advance = glyph->advance.x >> 16;
pos.x = bitmap->left;
pos.y = srcHeight - bitmap->top;
diff --git a/src/FTPixmapGlyph.cpp b/src/FTPixmapGlyph.cpp
index 7011e73..1970be9 100755
--- a/src/FTPixmapGlyph.cpp
+++ b/src/FTPixmapGlyph.cpp
@@ -4,8 +4,8 @@
#include "FTGL.h"
-FTPixmapGlyph::FTPixmapGlyph( FT_Glyph glyph, const unsigned int gi)
-: FTGlyph(gi),
+FTPixmapGlyph::FTPixmapGlyph( FT_Glyph glyph)
+: FTGlyph(),
destWidth(0),
destHeight(0),
numGreys(0),
@@ -14,7 +14,9 @@ FTPixmapGlyph::FTPixmapGlyph( FT_Glyph glyph, const unsigned int gi)
// This function will always fail if the glyph's format isn't scalable????
FT_Error err = FT_Glyph_To_Bitmap( &glyph, ft_render_mode_normal, 0, 1);
if( err || ft_glyph_format_bitmap != glyph->format)
- { return;}
+ {
+ return;
+ }
FT_BitmapGlyph bitmap = (FT_BitmapGlyph)glyph;
FT_Bitmap* source = &bitmap->bitmap;
@@ -27,7 +29,7 @@ FTPixmapGlyph::FTPixmapGlyph( FT_Glyph glyph, const unsigned int gi)
int srcPitch = source->pitch;
numGreys = source->num_grays;
- advance = glyph->advance.x >> 16; // this is 6 in the freetype docs!!!!!!
+ advance = glyph->advance.x >> 16;
pos.x = bitmap->left;
pos.y = srcHeight - bitmap->top;
@@ -81,6 +83,7 @@ float FTPixmapGlyph::Render( const FT_Vector& pen)
glDrawPixels( destWidth, destHeight, GL_RGBA, GL_UNSIGNED_BYTE, (const GLvoid*)data);
+
// Restore the glyph origin
glBitmap( 0, 0, 0.0, 0.0, -pen.x - pos.x, -pen.y + pos.y, (const GLubyte *)0);
diff --git a/src/FTPolyGlyph.cpp b/src/FTPolyGlyph.cpp
index 3800b53..ded0c01 100644
--- a/src/FTPolyGlyph.cpp
+++ b/src/FTPolyGlyph.cpp
@@ -49,8 +49,8 @@ void ftglCombine( GLdouble coords[3], void* vertex_data[4], GLfloat weight[4], v
}
-FTPolyGlyph::FTPolyGlyph( FT_Glyph glyph, unsigned int gi)
-: FTGlyph(gi),
+FTPolyGlyph::FTPolyGlyph( FT_Glyph glyph)
+: FTGlyph(),
vectoriser(0),
numPoints(0),
numContours(0),
@@ -77,7 +77,7 @@ FTPolyGlyph::FTPolyGlyph( FT_Glyph glyph, unsigned int gi)
vectoriser->Output( data);
contourFlag = vectoriser->ContourFlag();
- advance = glyph->advance.x >> 16; // this is 6 in the freetype docs!!!!!!
+ advance = glyph->advance.x >> 16;
delete vectoriser;
diff --git a/src/FTTextureGlyph.cpp b/src/FTTextureGlyph.cpp
index 7d81b38..a42b8a2 100755
--- a/src/FTTextureGlyph.cpp
+++ b/src/FTTextureGlyph.cpp
@@ -6,8 +6,8 @@
int FTTextureGlyph::activeTextureID = 0;
-FTTextureGlyph::FTTextureGlyph( FT_Glyph glyph, unsigned int gi, int id, unsigned char* data, int stride, int height, float u, float v)
-: FTGlyph(gi),
+FTTextureGlyph::FTTextureGlyph( FT_Glyph glyph, int id, unsigned char* data, int stride, int height, float u, float v)
+: FTGlyph(),
destWidth(0),
destHeight(0),
numGreys(0),
diff --git a/src/FTVectorGlyph.cpp b/src/FTVectorGlyph.cpp
index 1aea823..975be93 100755
--- a/src/FTVectorGlyph.cpp
+++ b/src/FTVectorGlyph.cpp
@@ -6,8 +6,8 @@
-FTVectorGlyph::FTVectorGlyph( FT_Glyph glyph, unsigned int gi)
-: FTGlyph(gi),
+FTVectorGlyph::FTVectorGlyph( FT_Glyph glyph)
+: FTGlyph(),
vectoriser(0),
numPoints(0),
numContours(0),
@@ -35,7 +35,7 @@ FTVectorGlyph::FTVectorGlyph( FT_Glyph glyph, unsigned int gi)
data = new double[ numPoints * 3];
vectoriser->Output( data);
- advance = glyph->advance.x >> 16; // this is 6 in the freetype docs!!!!!!
+ advance = glyph->advance.x >> 16;
delete vectoriser;
diff --git a/src/FTVectorGlyph.h b/src/FTVectorGlyph.h
index ac4e436..560d7a1 100755
--- a/src/FTVectorGlyph.h
+++ b/src/FTVectorGlyph.h
@@ -13,7 +13,7 @@ class FTVectorGlyph : public FTGlyph
{
public:
// methods
- FTVectorGlyph( FT_Glyph glyph, unsigned int glyphIndex);
+ FTVectorGlyph( FT_Glyph glyph);
virtual ~FTVectorGlyph();
virtual float Render( const FT_Vector& pen);