Commit 5f23d8044a78a7880eb6f41fedbd8a2bc4424c1e

sammy 2008-05-11T11:28:38

* Honour the pen's Z coordinate when rendering glyphs (except the raster ones, where the Z coordinate makes no sense).

diff --git a/src/FTGlyph/FTExtrudeGlyph.cpp b/src/FTGlyph/FTExtrudeGlyph.cpp
index a360c0b..02127ab 100644
--- a/src/FTGlyph/FTExtrudeGlyph.cpp
+++ b/src/FTGlyph/FTExtrudeGlyph.cpp
@@ -133,7 +133,7 @@ FTExtrudeGlyphImpl::~FTExtrudeGlyphImpl()
 const FTPoint& FTExtrudeGlyphImpl::RenderImpl(const FTPoint& pen,
                                               int renderMode)
 {
-    glTranslatef(pen.Xf(), pen.Yf(), 0);
+    glTranslatef(pen.Xf(), pen.Yf(), pen.Zf());
     if(glList)
     {
         if(renderMode & FTGL::RENDER_FRONT)
@@ -152,7 +152,7 @@ const FTPoint& FTExtrudeGlyphImpl::RenderImpl(const FTPoint& pen,
         if(renderMode & FTGL::RENDER_SIDE)
             RenderSide();
     }
-    glTranslatef(-pen.Xf(), -pen.Yf(), 0);
+    glTranslatef(-pen.Xf(), -pen.Yf(), -pen.Zf());
 
     return advance;
 }
diff --git a/src/FTGlyph/FTOutlineGlyph.cpp b/src/FTGlyph/FTOutlineGlyph.cpp
index 9cd3d43..b2c00eb 100644
--- a/src/FTGlyph/FTOutlineGlyph.cpp
+++ b/src/FTGlyph/FTOutlineGlyph.cpp
@@ -113,7 +113,7 @@ FTOutlineGlyphImpl::~FTOutlineGlyphImpl()
 const FTPoint& FTOutlineGlyphImpl::RenderImpl(const FTPoint& pen,
                                               int renderMode)
 {
-    glTranslatef(pen.Xf(), pen.Yf(), 0.0f);
+    glTranslatef(pen.Xf(), pen.Yf(), pen.Zf());
     if(glList)
     {
         glCallList(glList);
@@ -122,7 +122,7 @@ const FTPoint& FTOutlineGlyphImpl::RenderImpl(const FTPoint& pen,
     {
         DoRender();
     }
-    glTranslatef(-pen.Xf(), -pen.Yf(), 0.0f);
+    glTranslatef(-pen.Xf(), -pen.Yf(), -pen.Zf());
 
     return advance;
 }
diff --git a/src/FTGlyph/FTPolygonGlyph.cpp b/src/FTGlyph/FTPolygonGlyph.cpp
index 46346a2..67927bb 100644
--- a/src/FTGlyph/FTPolygonGlyph.cpp
+++ b/src/FTGlyph/FTPolygonGlyph.cpp
@@ -116,7 +116,7 @@ FTPolygonGlyphImpl::~FTPolygonGlyphImpl()
 const FTPoint& FTPolygonGlyphImpl::RenderImpl(const FTPoint& pen,
                                               int renderMode)
 {
-    glTranslatef(pen.Xf(), pen.Yf(), 0.0f);
+    glTranslatef(pen.Xf(), pen.Yf(), pen.Zf());
     if(glList)
     {
         glCallList(glList);
@@ -125,7 +125,7 @@ const FTPoint& FTPolygonGlyphImpl::RenderImpl(const FTPoint& pen,
     {
         DoRender();
     }
-    glTranslatef(-pen.Xf(), -pen.Yf(), 0.0f);
+    glTranslatef(-pen.Xf(), -pen.Yf(), -pen.Zf());
 
     return advance;
 }