diff --git a/Components/Overlay/src/OgreFont.cpp b/Components/Overlay/src/OgreFont.cpp index 2eb7d422705..edcda4cb43a 100644 --- a/Components/Overlay/src/OgreFont.cpp +++ b/Components/Overlay/src/OgreFont.cpp @@ -528,6 +528,18 @@ namespace Ogre // Advance a column if(width) l += (width + char_spacer); + +#ifndef HAVE_FREETYPE + if (buffer != NULL) + { + int ix0, iy0, ix1, iy1; + stbtt__bitmap gbm; + stbtt_GetGlyphBitmapBoxSubpixel(&font, stbtt_FindGlyphIndex(&font, cp), scale, scale, 0.0f, 0.0f, &ix0, &iy0, &ix1, &iy1); + gbm.w = (ix1 - ix0); + gbm.h = (iy1 - iy0); + STBTT_free(buffer, gbm.w * gbm.h); + } +#endif } } #ifdef HAVE_FREETYPE