Commit e3206aab6f5ead73b115b0962503c4e0eac61e6e

henry 2001-08-22T22:58:09

Fixed the positional stuff in render(). Added leftside bearing offset.

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;