I noticed that the FPS meter in my app (using a TextAreaOverlayElement) had a weird problem where the space character was displayed about twice as wide as it should be (I'm using a fixed-width font).
The strange thing is that this extra-wide space only seemed to affect that one TextAreaOverlayElement, other TextAreaOverlayElements that I created later had normal looking spaces. After a bit of debugging I think I found the issue, and it seems that if you create and use a TextAreaOverlayElement before the font has been loaded, it gets a bad value set in the mSpaceWidth member. I'm not setting the space-width at all. I made a local change in OgreTextAreaOverlayElement.cpp which appears to fix the issue:
OgreTextAreaOverlayElement.cpp, line 153:
Code: Select all
void TextAreaOverlayElement::updatePositionGeometry()
{
float *pVert;
if (mFont.isNull() || ! mFont->isLoaded())
{
// if font is not loaded, avoid setting mSpaceWidth with bad value
// not initialised yet, probably due to the order of creation in a template
return;
}
...