Fixed the positional stuff in render(). Added leftside bearing offset.
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
diff --git a/src/FTPolyGlyph.cpp b/src/FTPolyGlyph.cpp
index 0c24b9e..ebf1131 100644
--- a/src/FTPolyGlyph.cpp
+++ b/src/FTPolyGlyph.cpp
@@ -148,9 +148,9 @@ float FTPolyGlyph::Render( const FT_Vector& pen)
{
if( glList)
{
- glTranslatef( pen.x, pen.y, 0);
+ glTranslatef( pen.x + pos.x, pen.y, 0);
glCallList( glList);
- glTranslatef( -pen.x, -pen.y, 0);
+ glTranslatef( -pen.x + pos.x, -pen.y, 0);
}
return advance;
diff --git a/src/FTTextureGlyph.cpp b/src/FTTextureGlyph.cpp
index d3d29af..965f1cf 100755
--- a/src/FTTextureGlyph.cpp
+++ b/src/FTTextureGlyph.cpp
@@ -75,8 +75,6 @@ FTTextureGlyph::~FTTextureGlyph()
float FTTextureGlyph::Render( const FT_Vector& pen)
{
-// int adv = advance/* + pos.x */+ ( v.x >> 16); // FIXME ??? pos.x = bearing X
-
// This could be really ugly!!
if( activeTextureID != glTextureID)
{
@@ -86,10 +84,10 @@ float FTTextureGlyph::Render( const FT_Vector& pen)
glBegin( GL_QUADS);
}
- glTexCoord2f( uv[0].x, uv[0].y); glVertex2f( pen.x, pen.y + pos.y);
- glTexCoord2f( uv[1].x, uv[0].y); glVertex2f( pen.x + destWidth, pen.y + pos.y);
- glTexCoord2f( uv[1].x, uv[1].y); glVertex2f( pen.x + destWidth, pen.y + pos.y - destHeight);
- glTexCoord2f( uv[0].x, uv[1].y); glVertex2f( pen.x, pen.y + pos.y - destHeight);
+ glTexCoord2f( uv[0].x, uv[0].y); glVertex2f( pen.x + pos.x, pen.y + pos.y);
+ glTexCoord2f( uv[1].x, uv[0].y); glVertex2f( pen.x + destWidth + pos.x, pen.y + pos.y);
+ glTexCoord2f( uv[1].x, uv[1].y); glVertex2f( pen.x + destWidth + pos.x, pen.y + pos.y - destHeight);
+ glTexCoord2f( uv[0].x, uv[1].y); glVertex2f( pen.x + pos.x, pen.y + pos.y - destHeight);
return advance;
}
diff --git a/src/FTVectorGlyph.cpp b/src/FTVectorGlyph.cpp
index d306306..2cba857 100755
--- a/src/FTVectorGlyph.cpp
+++ b/src/FTVectorGlyph.cpp
@@ -73,9 +73,9 @@ float FTVectorGlyph::Render( const FT_Vector& pen)
{
if( glList)
{
- glTranslatef( pen.x, pen.y, 0);
+ glTranslatef( pen.x + pos.x, pen.y, 0);
glCallList( glList);
- glTranslatef( -pen.x, -pen.y, 0);
+ glTranslatef( -pen.x + pos.x, -pen.y, 0);
}
return advance;