Properly handle Render's position argument in FTTextureFont and FTBufferFont. Addresses SF bug #2883801.
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
diff --git a/src/FTFont/FTBufferFont.cpp b/src/FTFont/FTBufferFont.cpp
index a171c87..4f6560e 100644
--- a/src/FTFont/FTBufferFont.cpp
+++ b/src/FTFont/FTBufferFont.cpp
@@ -311,16 +311,16 @@ inline FTPoint FTBufferFontImpl::RenderI(const T* string, const int len,
glNormal3f(0.0f, 0.0f, 1.0f);
glTexCoord2f(0.0f,
1.0f / texHeight * (texHeight - height));
- glVertex2f(low.Xf(), up.Yf());
+ glVertex3f(low.Xf(), up.Yf(), position.Zf());
glTexCoord2f(0.0f,
1.0f);
- glVertex2f(low.Xf(), low.Yf());
+ glVertex3f(low.Xf(), low.Yf(), position.Zf());
glTexCoord2f(1.0f / texWidth * width,
1.0f);
- glVertex2f(up.Xf(), low.Yf());
+ glVertex3f(up.Xf(), low.Yf(), position.Zf());
glTexCoord2f(1.0f / texWidth * width,
1.0f / texHeight * (texHeight - height));
- glVertex2f(up.Xf(), up.Yf());
+ glVertex3f(up.Xf(), up.Yf(), position.Zf());
glEnd();
glPopClientAttrib();
diff --git a/src/FTGlyph/FTTextureGlyph.cpp b/src/FTGlyph/FTTextureGlyph.cpp
index f1d7725..28189dc 100644
--- a/src/FTGlyph/FTTextureGlyph.cpp
+++ b/src/FTGlyph/FTTextureGlyph.cpp
@@ -178,16 +178,16 @@ const FTPoint& FTTextureGlyphImpl::RenderImpl(const FTPoint& pen,
glBegin(GL_QUADS);
glTexCoord2f(uv[0].Xf(), uv[0].Yf());
- glVertex2f(dx, dy);
+ glVertex3f(dx, dy, pen.Zf());
glTexCoord2f(uv[0].Xf(), uv[1].Yf());
- glVertex2f(dx, dy - destHeight);
+ glVertex3f(dx, dy - destHeight, pen.Zf());
glTexCoord2f(uv[1].Xf(), uv[1].Yf());
- glVertex2f(dx + destWidth, dy - destHeight);
+ glVertex3f(dx + destWidth, dy - destHeight, pen.Zf());
glTexCoord2f(uv[1].Xf(), uv[0].Yf());
- glVertex2f(dx + destWidth, dy);
+ glVertex3f(dx + destWidth, dy, pen.Zf());
glEnd();
return advance;