* Enable GL_TEXTURE_2D in FTFont::Render variations that need it.
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
diff --git a/src/FTFont/FTBufferFont.cpp b/src/FTFont/FTBufferFont.cpp
index a5d2e6a..a78abc2 100644
--- a/src/FTFont/FTBufferFont.cpp
+++ b/src/FTFont/FTBufferFont.cpp
@@ -138,8 +138,10 @@ inline FTPoint FTBufferFontImpl::RenderI(const T* string, const int len,
FTBBox bbox = BBox(string, len, position, spacing);
- int width = static_cast<int>(bbox.Upper().X() - bbox.Lower().X() + 2.5);
- int height = static_cast<int>(bbox.Upper().Y() - bbox.Lower().Y() + 2.5);
+ int width = static_cast<int>(bbox.Upper().X() - bbox.Lower().X()
+ + border + border + 0.5);
+ int height = static_cast<int>(bbox.Upper().Y() - bbox.Lower().Y()
+ + border + border + 0.5);
int texWidth = NextPowerOf2(width);
int texHeight = NextPowerOf2(height);
@@ -161,7 +163,9 @@ inline FTPoint FTBufferFontImpl::RenderI(const T* string, const int len,
glPushAttrib(GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT);
glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
+ /* FIXME: can we push/pop these instead? */
glEnable(GL_BLEND);
+ glEnable(GL_TEXTURE_2D);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // GL_ONE
glBindTexture(GL_TEXTURE_2D, id);
diff --git a/src/FTFont/FTTextureFont.cpp b/src/FTFont/FTTextureFont.cpp
index f977c0a..9773ddd 100644
--- a/src/FTFont/FTTextureFont.cpp
+++ b/src/FTFont/FTTextureFont.cpp
@@ -228,7 +228,9 @@ inline FTPoint FTTextureFontImpl::RenderI(const T* string, const int len,
FTPoint position, FTPoint spacing,
int renderMode)
{
+ /* FIXME: can we push/pop these instead? */
glEnable(GL_BLEND);
+ glEnable(GL_TEXTURE_2D);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // GL_ONE
FTTextureGlyphImpl::ResetActiveTexture();