diff --git a/Components/Overlay/src/OgreOverlayTranslator.cpp b/Components/Overlay/src/OgreOverlayTranslator.cpp index d5943637646..e0dcef8ec27 100644 --- a/Components/Overlay/src/OgreOverlayTranslator.cpp +++ b/Components/Overlay/src/OgreOverlayTranslator.cpp @@ -216,6 +216,9 @@ void ElementTranslator::translate(ScriptCompiler* compiler, const AbstractNodePt succ = getString(prop->values.front(), &val); } + if(prop->name == "space_width") + compiler->addError(ScriptCompiler::CE_DEPRECATEDSYMBOL, prop->file, prop->line, prop->name); + if(!succ || !newElement->setParameter(prop->name, val)) compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, prop->file, prop->line); } diff --git a/Components/Overlay/src/OgreTextAreaOverlayElement.cpp b/Components/Overlay/src/OgreTextAreaOverlayElement.cpp index bc123397ba4..09f199a05cb 100644 --- a/Components/Overlay/src/OgreTextAreaOverlayElement.cpp +++ b/Components/Overlay/src/OgreTextAreaOverlayElement.cpp @@ -245,11 +245,6 @@ namespace Ogre { float left = _getDerivedLeft() * 2.0f - 1.0f; float top = -( (_getDerivedTop() * 2.0f ) - 1.0f ); - if(!mSpaceWidth) - { - mSpaceWidth = mFont->getGlyphInfo(UNICODE_SPACE).advance * mCharHeight; - } - // Use iterator auto iend = decoded.end(); bool newLine = true; @@ -267,7 +262,7 @@ namespace Ogre { { break; } - else if (character == UNICODE_SPACE) // space + else if (character == UNICODE_SPACE && mSpaceWidth) // space { len += mSpaceWidth * 2.0f * mViewportAspectCoef; } @@ -310,7 +305,7 @@ namespace Ogre { } continue; } - else if (character == UNICODE_SPACE) // space + else if (character == UNICODE_SPACE && mSpaceWidth) // space { // Just leave a gap, no tris left += mSpaceWidth * 2.0f * mViewportAspectCoef; @@ -323,6 +318,15 @@ namespace Ogre { Real horiz_height = glyphInfo.aspectRatio * mViewportAspectCoef ; const Font::UVRect& uvRect = glyphInfo.uvRect; + if(uvRect.isNull()) + { + // Just leave a gap, no tris + left += glyphInfo.advance * mCharHeight * 2.0f * mViewportAspectCoef; + // Also reduce tri count + mRenderOp.vertexData->vertexCount -= 6; + continue; + } + left += glyphInfo.bearing * mCharHeight * 2 * mViewportAspectCoef; // each vert is (x, y, z, u, v) diff --git a/Media/packs/SdkTrays.zip b/Media/packs/SdkTrays.zip index 69524e61e2c..1b55966baae 100644 Binary files a/Media/packs/SdkTrays.zip and b/Media/packs/SdkTrays.zip differ